|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.upb.swtpra05.group03.shuttle.ModuleContainer
This is the main class of the service / dependency mapping system of
Modules, it's the container for objects to map them with
their class, super classes and all interfaces so they can be used to fulfill
service dependencies of Modules at their initialization to
avoid circular dependencies. For each mapping key (class / interface) there
is a list of all objects that are instances of them, the list is ordered by
adding order.
| Field Summary | |
private static java.util.logging.Logger |
log
Logger for debugging |
private java.util.Map |
modules
map of modules with their class, super classes and interfaces as key |
| Constructor Summary | |
ModuleContainer()
Constructor |
|
| Method Summary | |
protected void |
add(java.lang.Class c,
java.lang.Object obj)
For internal use only: Adds an object with an class as key. |
void |
add(java.lang.Object obj)
Adds an object with its class, super classes and interfaces as key. |
java.lang.Object |
get(java.lang.Class aClass)
Returns the instance of given class / interface or -- if more than one instance is present and a interface is given -- returns a java.lang.reflect.Proxy instance of given interface which
delegates any method calls to all instances of given interface with
the return value of the first instance. |
java.util.List |
getAll(java.lang.Class aClass)
Returns all instances of given class / interface. |
java.lang.Object |
getFirst(java.lang.Class aClass)
Returns the first instance of given class / interface. |
void |
init()
Initializes all contained the Modules. |
protected void |
put(java.lang.Class c,
java.lang.Object obj)
For internal use only: Puts the object with the class as key in the internal map of modules. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final java.util.logging.Logger log
private final java.util.Map modules
| Constructor Detail |
public ModuleContainer()
| Method Detail |
public void init()
Modules.
public void add(java.lang.Object obj)
obj -
protected void add(java.lang.Class c,
java.lang.Object obj)
c - class as key of the objectobj - object to add
protected void put(java.lang.Class c,
java.lang.Object obj)
c - class as key of the objectobj - object to addpublic java.lang.Object get(java.lang.Class aClass)
ModuleContainerInterfacejava.lang.reflect.Proxy instance of given interface which
delegates any method calls to all instances of given interface with
the return value of the first instance.
get in interface ModuleContainerInterfaceaClass - class / interface of instance to return
public java.lang.Object getFirst(java.lang.Class aClass)
ModuleContainerInterface
getFirst in interface ModuleContainerInterfaceaClass - class / interface of instance to return
public java.util.List getAll(java.lang.Class aClass)
ModuleContainerInterface
getAll in interface ModuleContainerInterfaceaClass - class / interface of instances to return
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||