|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.registry.MappingRegistry
public class MappingRegistry
Common registry. This class implements an internal registry that holds instances of core sevices. It implements the service locator pattern, that - given an interface - returns the implementation of the service.
| Constructor Summary | |
|---|---|
MappingRegistry()
The constructor. |
|
| Method Summary | |
|---|---|
void |
addExtender(MappingRegistryExtender extender)
Adds an extender. |
java.util.Iterator |
getExtenders()
Gets the extender list. |
java.lang.Object |
lookup(java.lang.Class cls)
Retrieves an object by its class or interface name. |
java.lang.Object |
lookup(java.lang.String key)
Retrieves the object that has been registered for the passed key or null if none could be found. |
java.lang.Object |
lookupMandatory(java.lang.Class cls)
Retrieves a mandatory object by its class or interface name. |
void |
register(java.lang.Object object)
Registers the passed object by its class names (see below). |
void |
register(java.lang.String key,
java.lang.Object object)
Registers the passed object for the given key. |
void |
registerByClass(java.lang.Class cls,
java.lang.Object object)
Registers the passed object by its class names and (recursively) by the names of it super classes and implemented interfaces. |
void |
unregister(java.lang.Object object)
Unregisters the passed object by its class names (see below). |
void |
unregisterAll()
Unregisters all objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MappingRegistry()
| Method Detail |
|---|
public java.lang.Object lookup(java.lang.String key)
key - The key to lookup the object for
public void register(java.lang.String key,
java.lang.Object object)
key - The key to register the object forobject - The object to be registeredpublic java.lang.Object lookup(java.lang.Class cls)
cls - The interface to lookup the implementation for
public java.lang.Object lookupMandatory(java.lang.Class cls)
cls - The interface to lookup the implementation for
java.lang.RuntimeException - If such an object could not be foundpublic void register(java.lang.Object object)
object - The object to be registered
public void registerByClass(java.lang.Class cls,
java.lang.Object object)
cls - The class to use as keyobject - The object to be registeredpublic void unregister(java.lang.Object object)
object - The object to be registeredpublic void unregisterAll()
public java.util.Iterator getExtenders()
MappingRegistryExtender objectspublic void addExtender(MappingRegistryExtender extender)
extender - The extender to add
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||