SingletonStrategy
public class PerThreadSingleton extends java.lang.Object implements SingletonStrategy
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.
Constructor | Description |
---|---|
PerThreadSingleton() |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
instance() |
return a singleton instance of the class specified in setSingletonClass
|
void |
reset() |
reset the instance to a new instance for the implemented strategy
|
void |
setSingletonClassName(java.lang.String singletonClassName) |
set a singleton class name that will be used to create the singleton
based on the strategy implementation of this interface.
|
public void reset()
SingletonStrategy
reset
in interface SingletonStrategy
public java.lang.Object instance()
SingletonStrategy
instance
in interface SingletonStrategy
public void setSingletonClassName(java.lang.String singletonClassName)
SingletonStrategy
setSingletonClassName
in interface SingletonStrategy
Copyright ? 2005 MetaStuff Ltd. All Rights Reserved. Hosted by