S - The type of provided instances (subjects).public class Provider<S> extends XProvider<S,RuntimeException>
The tool maintains a number of such subjects and only creates as many as are actually required at most at the same time in its application context. The subjects are retained and reused for subsequent operations.
In this respect, this tool is suitable for providing subject types whose instantiation is relatively "expensive", which are rather unsuitable for concurrent access, but are designed for multiple or permanent use. Database or other client-server connections may be an example.
Note: this implementation cannot detect when an internal operation is taking place in the course of an operation to which the same subject could be made available.
This implementation does not support checked exceptions to occur while creating new subject instances.
XProviderCopyright © 2022 Andreas Kluge-Kaindl, Bremen (de). All rights reserved.