|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Role public interface ComponentManager
Provide way to access and modify components repository.
| Method Summary | ||
|---|---|---|
|
getComponentDescriptor(Class<T> role,
String hint)
Deprecated. since 4.0M1 use getComponentDescriptor(Type, String) instead |
|
|
getComponentDescriptor(Type role,
String hint)
|
|
|
getComponentDescriptorList(Class<T> role)
Deprecated. since 4.0M1 use getComponentDescriptorList(Type) instead |
|
|
getComponentDescriptorList(Type role)
|
|
ComponentEventManager |
getComponentEventManager()
|
|
|
getInstance(Type roleType)
Find a component instance that implements that passed type. |
|
|
getInstance(Type roleType,
String roleHint)
Find a component instance that implements that passed interface class. |
|
|
getInstanceList(Type role)
Find all the components implementing the provided role. |
|
|
getInstanceMap(Type role)
Find all the components implementing the provided role and organize then in a Map with role hint as key. |
|
ComponentManager |
getParent()
|
|
|
hasComponent(Class<T> role)
Deprecated. since 4.0M1 use hasComponent(Type) instead |
|
|
hasComponent(Class<T> role,
String hint)
Deprecated. since 4.0M1 use hasComponent(Type, String) instead |
|
boolean |
hasComponent(Type role)
|
|
boolean |
hasComponent(Type role,
String hint)
|
|
|
lookup(Class<T> role)
Deprecated. since 4.0M1 use getInstance(Type) instead |
|
|
lookup(Class<T> role,
String hint)
Deprecated. since 4.0M1 use getInstance(Type, String) instead |
|
|
lookupList(Class<T> role)
Deprecated. since 4.0M1 use getInstanceList(Type) instead |
|
|
lookupMap(Class<T> role)
Deprecated. since 4.0M1 use getInstanceMap(Type) instead |
|
|
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. |
|
void |
release(Object componentInstance)
Release the provided singleton instance but don't unregister the component descriptor. |
|
void |
setComponentEventManager(ComponentEventManager eventManager)
|
|
void |
setParent(ComponentManager parentComponentManager)
|
|
|
unregisterComponent(Class<T> role,
String hint)
Deprecated. since 4.0M1 use unregisterComponent(Type, String) instead |
|
void |
unregisterComponent(ComponentDescriptor<?> componentDescriptor)
Remove a component from the component repository dynamically. |
|
void |
unregisterComponent(Type role,
String hint)
Remove a component from the component repository dynamically. |
|
| Method Detail |
|---|
boolean hasComponent(Type role)
role - the class (aka role) that the component implements
boolean hasComponent(Type role,
String hint)
role - the class (aka role) that the component implementshint - 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 getInstance(Type roleType)
throws ComponentLookupException
T - the component role typeroleType - the class (aka role) that the component implements
ComponentLookupException - in case the component cannot be found
<T> T getInstance(Type roleType,
String roleHint)
throws ComponentLookupException
T - the component role typeroleType - 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
void release(Object componentInstance)
throws ComponentLifecycleException
componentInstance - the component to release passed as a component instance.
ComponentLifecycleException - if the component's ending lifecycle raises an error
<T> List<T> getInstanceList(Type role)
throws ComponentLookupException
T - the type of the components rolerole - the type of the components role
ComponentLookupException - if any error happen during component search
<T> Map<String,T> getInstanceMap(Type role)
throws ComponentLookupException
Map with role hint as key.
T - the type of the components rolerole - the type of the components role
ComponentLookupException - if any error happen during component search
<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(Type role,
String hint)
role - the role identifying the componenthint - the hint identifying the componentvoid unregisterComponent(ComponentDescriptor<?> componentDescriptor)
componentDescriptor - the component descriptor
<T> ComponentDescriptor<T> getComponentDescriptor(Type role,
String hint)
T - the component role typerole - the role identifying the componenthint - the hint identifying the component
<T> List<ComponentDescriptor<T>> getComponentDescriptorList(Type 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()@Deprecated <T> boolean hasComponent(Class<T> role)
hasComponent(Type) instead
T - the component role typerole - the class (aka role) that the component implements
@Deprecated
<T> boolean hasComponent(Class<T> role,
String hint)
hasComponent(Type, String) instead
T - the component role typerole - the class (aka role) that the component implementshint - the hint that differentiates a component implementation from another one (each component is
registered with a hint; the "default" hint being the default)
@Deprecated
<T> T lookup(Class<T> role)
throws ComponentLookupException
getInstance(Type) instead
T - the component role typerole - the class (aka role) that the component implements
ComponentLookupException - in case the component cannot be found
@Deprecated
<T> T lookup(Class<T> role,
String hint)
throws ComponentLookupException
getInstance(Type, String) instead
T - the component role typerole - the class (aka role) that the component implementshint - 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
@Deprecated
<T> List<T> lookupList(Class<T> role)
throws ComponentLookupException
getInstanceList(Type) instead
T - the type of the components rolerole - the class of the components role
ComponentLookupException - if any error happen during component search
@Deprecated
<T> Map<String,T> lookupMap(Class<T> role)
throws ComponentLookupException
getInstanceMap(Type) instead
Map with role hint as key.
T - the type of the components rolerole - the class of the components role
ComponentLookupException - if any error happen during component search
@Deprecated
<T> void unregisterComponent(Class<T> role,
String hint)
unregisterComponent(Type, String) instead
T - the component role typerole - the role identifying the componenthint - the hint identifying the component
@Deprecated
<T> ComponentDescriptor<T> getComponentDescriptor(Class<T> role,
String hint)
getComponentDescriptor(Type, String) instead
T - the component role typerole - the role identifying the componenthint - the hint identifying the component
@Deprecated <T> List<ComponentDescriptor<T>> getComponentDescriptorList(Class<T> role)
getComponentDescriptorList(Type) instead
T - the role class for which to return all component implementationsrole - the role class for which to return all component implementations
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||