|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.tools.SingletonFactory<T>
public class SingletonFactory<T>
Maintains a map of singletons of various classes, instantiating new ones as needed.
| Constructor Summary | |
|---|---|
SingletonFactory(Class<T> klass)
|
|
| Method Summary | |
|---|---|
T |
getInstance(HierarchicalProperties properties,
String propertyName,
Class relativeTo)
Returns an instance of a class based on a required property name from a properties collection. |
T |
getInstance(String className)
Returns a singleton instance of a class. |
T |
getInstance(String className,
String identifier)
Returns a singleton with a particular identifier, or creates one with a particular class if none exists. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SingletonFactory(Class<T> klass)
| Method Detail |
|---|
public T getInstance(String className,
String identifier)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
className - the name of the class a singleton has to be obtained
foridentifier - an identifier to differentiate several singletons for
the same class
ClassNotFoundException
InstantiationException
IllegalAccessException
public T getInstance(String className)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
className - the name of the class a singleton has to be obtained
for
ClassNotFoundException
InstantiationException
IllegalAccessException
public T getInstance(HierarchicalProperties properties,
String propertyName,
Class relativeTo)
throws MandatoryPropertyMissingException,
ClassNotFoundException,
InstantiationException,
IllegalAccessException
properties - The properties where the class name has to be obtained frompropertyName - Which property contains the class namerelativeTo - Class whose package should be used if no package is
specified in the property
MandatoryPropertyMissingException
ClassNotFoundException
InstantiationException
IllegalAccessException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||