Top Description Methods
org.dom4j.util

public Interface SingletonStrategy<T>

Known Direct Implementers
org.dom4j.util.PerThreadSingleton, org.dom4j.util.SimpleSingleton

SingletonStrategy is an interface used to provide common factory access for the same object based on an implementation strategy for singleton. Right now there are two that accompany this interface: SimpleSingleton and PerThreadSingleton. This will replace previous usage of ThreadLocal to allow for alternate strategies.
Author
David Lucas
Version
$Revision: 1.2 $

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

a singleton instance of the class specified in setSingletonClass
instance
()

public void
reset()

reset the instance to a new instance for the implemented strategy

public void
setSingletonClassName(String
DOCUMENT ME!
singletonClassName
)

set a singleton class name that will be used to create the singleton based on the strategy implementation of this interface.

Method Detail

instanceback to summary
public T instance()
Returns:T

a singleton instance of the class specified in setSingletonClass

resetback to summary
public void reset()

reset the instance to a new instance for the implemented strategy

setSingletonClassNameback to summary
public void setSingletonClassName(String singletonClassName)

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.

Parameters
singletonClassName:String

DOCUMENT ME!