|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ocltf.common.ComponentContainer
This handles all registration and retrieval of components within the framework.
Constructor Summary | |
protected |
ComponentContainer()
Constructs an instance of ComponentContainer. |
Method Summary | |
java.lang.Object |
findComponent(java.lang.Class key)
Finds the component with the specified key . |
java.lang.Object |
findComponent(java.lang.Object key)
Finds the component with the specified key . |
java.lang.Object |
findComponent(java.lang.String key,
java.lang.Class type)
Attempts to find the component with the specified unique key , if it can't be found,
the default of the specified type is
returned, if no default is set, null is returned. |
java.util.Collection |
findComponentsOfType(java.lang.Class type)
Finds all components having the given type . |
static ComponentContainer |
instance()
Gets the shared instance of this ComponentContainer. |
java.lang.Object |
registerComponent(java.lang.String key,
java.lang.Object component)
Registers the component in this container with a unique (within this container) key . |
java.lang.Object |
registerComponentType(java.lang.Class type)
Registers the component of the specified type . |
java.lang.Object |
registerComponentType(java.lang.String type)
Registers the components of the specified type . |
java.lang.Object |
registerDefaultComponent(java.lang.Class componentInterface,
java.lang.Class defaultType)
Registers the "default" for the specified componentInterface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected ComponentContainer()
Method Detail |
public static ComponentContainer instance()
public java.lang.Object findComponent(java.lang.Object key)
key
.
key
- the unique key of the component as an Object.
public java.lang.Object findComponent(java.lang.Class key)
key
.
key
- the unique key as a Class.
public java.lang.Object findComponent(java.lang.String key, java.lang.Class type)
key
, if it can't be found,
the default of the specified type
is
returned, if no default is set, null is returned.
key
- the unique key of the component.
public java.util.Collection findComponentsOfType(java.lang.Class type)
type
.
type
- the component type.
public java.lang.Object registerComponent(java.lang.String key, java.lang.Object component)
key
.
key
- the unique key.
public java.lang.Object registerDefaultComponent(java.lang.Class componentInterface, java.lang.Class defaultType)
componentInterface
- the interface for the component.defaultType
- the "default" implementation to use for the
componentInterface.
public java.lang.Object registerComponentType(java.lang.Class type)
type
.
type
- the type Class.
public java.lang.Object registerComponentType(java.lang.String type)
type
.
type
- the name of a type (must have be able
to be instantiated into a Class instance)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |