|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.soton.ecs.iam.grid.utils.ImplementationFactory
public final class ImplementationFactory
Returns the configured class for a given use. The implementationfactory.properties file contains a list of keys (usually interface names) and their corresponding classes. This factory instantiates a new instance of the given class when presented with the given key, or returns an existing instance if one has already been created.
| Method Summary | ||
|---|---|---|
static
|
getSingletonInstance(Class<T> iface)
Get the singleton instance of the class for this key (interface). |
|
static
|
getSingletonInstance(Class<T> iface,
String argument)
Get the configured class for the given key. |
|
static
|
instantiateObject(Class<T> ifaceClass,
Object[] arguments,
Class[] types)
Create a new instance of the configured implementation of 'iface'. |
|
static
|
registerFactory(Class<T> iface,
Class factoryClass,
String factoryMethod)
Add an additional interface-to-implementation mappings. |
|
static
|
registerImplementation(Class<T> iface,
Class<? extends T> impl)
Add an additional interface-to-implementation mappings. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> T getSingletonInstance(Class<T> iface)
throws CantCreateImplementation
CantCreateImplementation
public static <T> T instantiateObject(Class<T> ifaceClass,
Object[] arguments,
Class[] types)
throws CantCreateImplementation
ifaceClass - the class whose name is a key in implementationfactory.properties to be looked uparguments - arguments to pass to constructor, or null for {}types - the parameter types to match (may be superclasses of the actual types); pass
null to use the types of the parameters
CantCreateImplementation - on error
public static <T> T getSingletonInstance(Class<T> iface,
String argument)
throws CantCreateImplementation
iface - the interface which the class implementsargument - a value to be passed to the constructor. If null, no
arguments are passed. The factory returns a single instance for
each (iface, argument) pair.
CantCreateImplementation
public static <T> void registerImplementation(Class<T> iface,
Class<? extends T> impl)
GridClientPluginProvider
public static <T> void registerFactory(Class<T> iface,
Class factoryClass,
String factoryMethod)
iface - the key which will later be usedfactoryClass - a class containing a factory functionfactoryMethod - the method in the class that creates the implementationsGridClientPluginProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||