|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@ComponentRole public interface ComponentManager
Provide way to access and modify components repository.
| Method Summary | ||
|---|---|---|
|
getComponentDescriptor(java.lang.Class<T> role,
java.lang.String roleHint)
|
|
|
getComponentDescriptorList(java.lang.Class<T> role)
|
|
ComponentEventManager |
getComponentEventManager()
|
|
ComponentManager |
getParent()
|
|
|
hasComponent(java.lang.Class<T> role)
|
|
|
hasComponent(java.lang.Class<T> role,
java.lang.String roleHint)
|
|
|
lookup(java.lang.Class<T> role)
Find a component instance that implements that passed interface class. |
|
|
lookup(java.lang.Class<T> role,
java.lang.String roleHint)
Find a component instance that implements that passed interface class. |
|
|
lookupList(java.lang.Class<T> role)
|
|
|
lookupMap(java.lang.Class<T> role)
|
|
|
registerComponent(ComponentDescriptor<T> componentDescriptor)
Add a component in the component repository dynamically. |
|
|
registerComponent(ComponentDescriptor<T> componentDescriptor,
T componentInstance)
Add a component in the component repository dynamically. |
|
|
release(T component)
Remove a component from the list of available components. |
|
void |
setComponentEventManager(ComponentEventManager eventManager)
|
|
void |
setParent(ComponentManager parentComponentManager)
|
|
void |
unregisterComponent(java.lang.Class<?> role,
java.lang.String roleHint)
Remove a component from the component repository dynamically. |
|
| Method Detail |
|---|
<T> boolean hasComponent(java.lang.Class<T> role)
T - the component role typerole - the class (aka role) that the component implements
<T> boolean hasComponent(java.lang.Class<T> role,
java.lang.String roleHint)
T - the component role typerole - the class (aka role) that the component implementsroleHint - the hint that differentiates a component implementation from another one (each component is
registered with a hint; the "default" hint being the default)
<T> T lookup(java.lang.Class<T> role)
throws ComponentLookupException
T - the component role typerole - the class (aka role) that the component implements
ComponentLookupException - in case the component cannot be found
<T> T lookup(java.lang.Class<T> role,
java.lang.String roleHint)
throws ComponentLookupException
T - the component role typerole - the class (aka role) that the component implementsroleHint - the hint that differentiates a component implementation from another one (each component is
registered with a hint; the "default" hint being the default)
ComponentLookupException - in case the component cannot be found
<T> void release(T component)
throws ComponentLifecycleException
T - the component role typecomponent - the component to release passed as a component instance. The component definition matching the
passed instance is removed
ComponentLifecycleException - if the component's ending lifecycle raises an error
<T> java.util.Map<java.lang.String,T> lookupMap(java.lang.Class<T> role)
throws ComponentLookupException
ComponentLookupException
<T> java.util.List<T> lookupList(java.lang.Class<T> role)
throws ComponentLookupException
ComponentLookupException
<T> void registerComponent(ComponentDescriptor<T> componentDescriptor)
throws ComponentRepositoryException
If a component with the same role and role hint already exists it will be replaced by this provided one when lookup.
T - the component role typecomponentDescriptor - the descriptor of the component to register.
ComponentRepositoryException - error when registering component descriptor.
<T> void registerComponent(ComponentDescriptor<T> componentDescriptor,
T componentInstance)
throws ComponentRepositoryException
ComponentManager instead of letting it created it from descriptor.
If a component with the same role and role hint already exists it will be replaced by this provided one when lookup.
T - the component role typecomponentDescriptor - the descriptor of the component to register.componentInstance - the initial component instance
ComponentRepositoryException - error when registering component descriptor.
void unregisterComponent(java.lang.Class<?> role,
java.lang.String roleHint)
role - the role identifying the componentroleHint - the hint identifying the component
<T> ComponentDescriptor<T> getComponentDescriptor(java.lang.Class<T> role,
java.lang.String roleHint)
T - the component role typerole - the role identifying the componentroleHint - the hint identifying the component
<T> java.util.List<ComponentDescriptor<T>> getComponentDescriptorList(java.lang.Class<T> role)
T - the role class for which to return all component implementationsrole - the role class for which to return all component implementations
ComponentEventManager getComponentEventManager()
void setComponentEventManager(ComponentEventManager eventManager)
eventManager - the manager to use to send events when a component descriptor is registeredComponentManager getParent()
void setParent(ComponentManager parentComponentManager)
parentComponentManager - see getParent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||