Package org.aksw.commons.util.ref
Class SingletonLazyRef<T>
java.lang.Object
org.aksw.commons.util.ref.SingletonLazyRef<T>
- All Implemented Interfaces:
Serializable,Supplier<Ref<T>>
A wrapper that turns a supplier of references into a singleton such that
at any given time (on a specific jvm) only a most a single reference will have been
acquired from that supplier.
The intended use case is to allow for sharing a supplier of a
DataSource
across a cluster. Each involved jvm may obtain its own singleton instnance from that supplier
such that there is only one connection pool per jvm from where connections can be drawn.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary