| java.lang.Object com.uwyn.rife.tools.SingletonFactory
SingletonFactory | public class SingletonFactory (Code) | | Maintains a map of singletons of various classes, instantiating new
ones as needed.
author: Steven Grimm (koreth[remove] at midwinter dot com) version: $Revision: $ since: 1.6 |
Method Summary | |
public synchronized T | getInstance(String className, String identifier) Returns a singleton with a particular identifier, or creates one with
a particular class if none exists. | public T | getInstance(String className) Returns a singleton instance of a class. | public T | getInstance(HierarchicalProperties properties, String propertyName, Class relativeTo) Returns an instance of a class based on a required property name from a
properties collection. |
SingletonFactory | public SingletonFactory(Class<T> klass)(Code) | | |
getInstance | public synchronized T getInstance(String className, String identifier) throws ClassNotFoundException, InstantiationException, IllegalAccessException(Code) | | Returns a singleton with a particular identifier, or creates one with
a particular class if none exists.
Parameters: className - the name of the class a singleton has to be obtainedfor Parameters: identifier - an identifier to differentiate several singletons forthe same class the requested singleton instance since: 1.6 |
|
|