Class PerThreadSingleton<T>
java.lang.Object
org.dom4j.util.PerThreadSingleton<T>
- All Implemented Interfaces:
SingletonStrategy<T>
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.
- Version:
- $Revision: 1.3 $
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninstance()
void
reset()
reset the instance to a new instance for the implemented strategyvoid
setSingletonClassName
(String singletonClassName) set a singleton class name that will be used to create the singleton based on the strategy implementation of this interface.
-
Field Details
-
singletonClassName
-
perThreadCache
-
-
Constructor Details
-
PerThreadSingleton
public PerThreadSingleton()
-
-
Method Details
-
reset
public void reset()Description copied from interface:SingletonStrategy
reset the instance to a new instance for the implemented strategy- Specified by:
reset
in interfaceSingletonStrategy<T>
-
instance
- Specified by:
instance
in interfaceSingletonStrategy<T>
- Returns:
- a singleton instance of the class specified in setSingletonClass
-
setSingletonClassName
Description copied from interface:SingletonStrategy
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.- Specified by:
setSingletonClassName
in interfaceSingletonStrategy<T>
- Parameters:
singletonClassName
- DOCUMENT ME!
-