PerThreadSingleton is an implementation of the
SingletonStrategy used to provide common factory access to a single object
instance based on an implementation strategy for one object instance per
thread. This is useful in replace of the ThreadLocal usage.
| Modifier and Type | Field and Description |
|---|---|
| private ThreadLocal | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public T | |
| public void | reset()
Implements org. |
| public void | setSingletonClassName(String
DOCUMENT ME! singletonClassName)Implements org. |
| perThreadCache | back to summary |
|---|---|
| private ThreadLocal<WeakReference<T>> perThreadCache | |
| singletonClassName | back to summary |
|---|---|
| private String singletonClassName | |
| PerThreadSingleton | back to summary |
|---|---|
| public PerThreadSingleton() | |
| instance | back to summary |
|---|---|
| public T instance() Implements org.
| |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Doc from org. reset the instance to a new instance for the implemented strategy | |
| setSingletonClassName | back to summary |
|---|---|
| public void setSingletonClassName(String singletonClassName) Implements org. Doc from org. set a singleton class name that will be used to create the singleton based on the strategy implementation of this interface. The default constructor of the class will be used and must be public.
| |