Top Description Fields Constructors Methods
org.dom4j.util

public Class SimpleSingleton<T>

extends Object
implements SingletonStrategy<T>
Class Inheritance
All Implemented Interfaces
org.dom4j.util.SingletonStrategy

SimpleSingleton is an implementation of the SingletonStrategy interface used to provide common factory access for the same object instance. This implementation will create a new instance from the class specified and will not create a new one unless it is reset.

Author
David Lucas
Version
$Revision: 1.3 $

Field Summary

Modifier and TypeField and Description
private String
private T

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public T
public void
reset()

Implements org.dom4j.util.SingletonStrategy.reset.

reset the instance to a new instance for the implemented strategy
public void
setSingletonClassName(String
DOCUMENT ME!
singletonClassName
)

Implements org.dom4j.util.SingletonStrategy.setSingletonClassName.

set a singleton class name that will be used to create the singleton based on the strategy implementation of this interface.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

singletonClassNameback to summary
private String singletonClassName
singletonInstanceback to summary
private T singletonInstance

Constructor Detail

SimpleSingletonback to summary
public SimpleSingleton()

Method Detail

instanceback to summary
public T instance()

Implements org.dom4j.util.SingletonStrategy.instance.

Returns:T

Doc from org.dom4j.util.SingletonStrategy.instance.

a singleton instance of the class specified in setSingletonClass

resetback to summary
public void reset()

Implements org.dom4j.util.SingletonStrategy.reset.

Doc from org.dom4j.util.SingletonStrategy.reset.

reset the instance to a new instance for the implemented strategy

setSingletonClassNameback to summary
public void setSingletonClassName(String singletonClassName)

Implements org.dom4j.util.SingletonStrategy.setSingletonClassName.

Doc from org.dom4j.util.SingletonStrategy.setSingletonClassName.

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!