Package org.glassfish.pfl.basic.contain
Class ResourceFactory<T>
- java.lang.Object
-
- org.glassfish.pfl.basic.contain.ResourceFactory<T>
-
- Type Parameters:
T
- Type created by resource factory.
public class ResourceFactory<T> extends java.lang.Object
A thread-safe, contention-free lazy resource factory.
-
-
Field Summary
Fields Modifier and Type Field Description private NullaryFunction<T>
cons
private T
value
-
Constructor Summary
Constructors Constructor Description ResourceFactory(NullaryFunction<T> cons)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
-
-
-
Field Detail
-
value
private volatile T value
-
cons
private final NullaryFunction<T> cons
-
-
Constructor Detail
-
ResourceFactory
public ResourceFactory(NullaryFunction<T> cons)
-
-
Method Detail
-
get
public T get()
-
-