public class SimpleSingleton extends Object implements 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.
构造器和说明 |
---|
SimpleSingleton() |
限定符和类型 | 方法和说明 |
---|---|
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(String singletonClassName)
set a singleton class name that will be used to create the singleton
based on the strategy implementation of this interface.
|
public Object instance()
SingletonStrategy
instance
在接口中 SingletonStrategy
public void reset()
SingletonStrategy
reset
在接口中 SingletonStrategy
public void setSingletonClassName(String singletonClassName)
SingletonStrategy
setSingletonClassName
在接口中 SingletonStrategy
Copyright © 2005 MetaStuff Ltd. All Rights Reserved. Hosted by