Package org.dom4j.util
Class PerThreadSingleton<T>
- java.lang.Object
 - 
- org.dom4j.util.PerThreadSingleton<T>
 
 
- 
- All Implemented Interfaces:
 SingletonStrategy<T>
public class PerThreadSingleton<T> extends Object implements SingletonStrategy<T>
PerThreadSingletonis 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. 
- 
- 
Constructor Summary
Constructors Constructor Description PerThreadSingleton() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tinstance()voidreset()reset the instance to a new instance for the implemented strategyvoidsetSingletonClassName(String singletonClassName)set a singleton class name that will be used to create the singleton based on the strategy implementation of this interface. 
 - 
 
- 
- 
Method Detail
- 
reset
public void reset()
Description copied from interface:SingletonStrategyreset the instance to a new instance for the implemented strategy- Specified by:
 resetin interfaceSingletonStrategy<T>
 
- 
instance
public T instance()
- Specified by:
 instancein interfaceSingletonStrategy<T>- Returns:
 - a singleton instance of the class specified in setSingletonClass
 
 
- 
setSingletonClassName
public void setSingletonClassName(String singletonClassName)
Description copied from interface:SingletonStrategyset 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:
 setSingletonClassNamein interfaceSingletonStrategy<T>- Parameters:
 singletonClassName- DOCUMENT ME!
 
 - 
 
 -