Save This Page
Home » dom4j-1.6.1 » org.dom4j.util » [javadoc | source]
org.dom4j.util
public interface: SingletonStrategy [javadoc | source]

All Known Implementing Classes:
    PerThreadSingleton, 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.

Method from org.dom4j.util.SingletonStrategy Summary:
instance,   reset,   setSingletonClassName
Method from org.dom4j.util.SingletonStrategy Detail:
 public Object instance()
    return a singleton instance of the class specified in setSingletonClass
 public  void reset()
    reset the instance to a new instance for the implemented strategy
 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.