|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PlexusContainer
PlexusContainer is the entry-point for loading and accessing other components.
| Field Summary | |
|---|---|
static String |
ROLE
|
| Method Summary | ||
|---|---|---|
void |
addComponent(Object component,
String role)
|
|
|
addComponent(T component,
Class<?> role,
String roleHint)
Adds live component instance to this container. |
|
void |
addComponentDescriptor(ComponentDescriptor<?> componentDescriptor)
Adds a component descriptor to this container. |
|
void |
addContextValue(Object key,
Object value)
Add a key/value pair to this container's Context. |
|
org.codehaus.plexus.classworlds.realm.ClassRealm |
createChildRealm(String id)
|
|
List<ComponentDescriptor<?>> |
discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm childRealm)
Discovers components in the given realm. |
|
List<ComponentDescriptor<?>> |
discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm,
Object data)
|
|
void |
dispose()
Disposes of this container, which in turn disposes all of it's components. |
|
|
getComponentDescriptor(Class<T> type,
String role,
String roleHint)
Returns the ComponentDescriptor with the given component role and hint. |
|
ComponentDescriptor<?> |
getComponentDescriptor(String role)
Returns the ComponentDescriptor with the given component role and the default role hint. |
|
ComponentDescriptor<?> |
getComponentDescriptor(String role,
String roleHint)
Returns the ComponentDescriptor with the given component role and hint. |
|
|
getComponentDescriptorList(Class<T> type,
String role)
Returns a List of ComponentDescriptors with the given role. |
|
List<ComponentDescriptor<?>> |
getComponentDescriptorList(String role)
Returns a List of ComponentDescriptors with the given role. |
|
|
getComponentDescriptorMap(Class<T> type,
String role)
Returns a Map of ComponentDescriptors with the given role, keyed by role-hint. |
|
Map<String,ComponentDescriptor<?>> |
getComponentDescriptorMap(String role)
Returns a Map of ComponentDescriptors with the given role, keyed by role-hint. |
|
org.codehaus.plexus.classworlds.realm.ClassRealm |
getComponentRealm(String realmId)
|
|
org.codehaus.plexus.classworlds.realm.ClassRealm |
getContainerRealm()
Returns the Classworld's ClassRealm of this Container, which acts as the default parent for all contained components. |
|
Context |
getContext()
Returns this container's context. |
|
org.codehaus.plexus.classworlds.realm.ClassRealm |
getLookupRealm()
Returns the lookup realm for this container, which is either the container realm or the realm set by setLookupRealm(ClassRealm). |
|
org.codehaus.plexus.classworlds.realm.ClassRealm |
getLookupRealm(Object component)
XXX ideally i'd like to place this in a plexus container specific utility class. |
|
boolean |
hasComponent(Class<?> type)
Returns true if this container has a component with the given role/role-hint. |
|
boolean |
hasComponent(Class<?> type,
String roleHint)
Returns true if this container has a component with the given role/role-hint. |
|
boolean |
hasComponent(Class<?> type,
String role,
String roleHint)
Returns true if this container has a component with the given role/role-hint. |
|
boolean |
hasComponent(String role)
Returns true if this container has the keyed component. |
|
boolean |
hasComponent(String role,
String roleHint)
Returns true if this container has a component with the given role/role-hint. |
|
|
lookup(Class<T> type)
Looks up and returns a component object with the given unique key or role. |
|
|
lookup(Class<T> type,
String roleHint)
Looks up and returns a component object with the given unique role/role-hint combination. |
|
|
lookup(Class<T> type,
String role,
String roleHint)
Looks up and returns a component object with the given unique role/role-hint combination. |
|
|
lookup(ComponentDescriptor<T> componentDescriptor)
Looks up and returns a component object matching the given component descriptor. |
|
Object |
lookup(String role)
Looks up and returns a component object with the given unique key or role. |
|
Object |
lookup(String role,
String roleHint)
Looks up and returns a component object with the given unique role/role-hint combination. |
|
|
lookupList(Class<T> type)
Looks up and returns a List of component objects with the given role. |
|
|
lookupList(Class<T> type,
List<String> roleHints)
Looks up and returns a List of component objects with the given role. |
|
List<Object> |
lookupList(String role)
Looks up and returns a List of component objects with the given role. |
|
List<Object> |
lookupList(String role,
List<String> roleHints)
Looks up and returns a List of component objects with the given role. |
|
|
lookupMap(Class<T> type)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
|
|
lookupMap(Class<T> type,
List<String> roleHints)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
|
Map<String,Object> |
lookupMap(String role)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
|
Map<String,Object> |
lookupMap(String role,
List<String> roleHints)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
|
void |
registerComponentDiscoveryListener(ComponentDiscoveryListener listener)
Adds the listener to this container. |
|
void |
release(Object component)
Releases the component from the container. |
|
void |
releaseAll(List<?> components)
Releases all Listed components from the container. |
|
void |
releaseAll(Map<String,?> components)
Releases all Mapped component values from the container. |
|
void |
removeComponentDiscoveryListener(ComponentDiscoveryListener listener)
Removes the listener from this container. |
|
void |
removeComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
Dissociate the realm with the specified id from the container. |
|
org.codehaus.plexus.classworlds.realm.ClassRealm |
setLookupRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Sets the lookup realm to use for lookup calls that don't have a ClassRealm parameter. |
|
| Field Detail |
|---|
static final String ROLE
| Method Detail |
|---|
Object lookup(String role)
throws ComponentLookupException
role - a unique key for the desired component
ComponentLookupException
Object lookup(String role,
String roleHint)
throws ComponentLookupException
role - a non-unique key for the desired componentroleHint - a hint for the desired component implementation
ComponentLookupException
<T> T lookup(Class<T> type)
throws ComponentLookupException
type - the unique type of the component within the container
ComponentLookupException
<T> T lookup(Class<T> type,
String roleHint)
throws ComponentLookupException
type - the non-unique type of the componentroleHint - a hint for the desired component implementation
ComponentLookupException
<T> T lookup(Class<T> type,
String role,
String roleHint)
throws ComponentLookupException
type - the non-unique type of the componentrole - a non-unique key for the desired componentroleHint - a hint for the desired component implementation
ComponentLookupException
<T> T lookup(ComponentDescriptor<T> componentDescriptor)
throws ComponentLookupException
componentDescriptor - the descriptor of the component
ComponentLookupException
List<Object> lookupList(String role)
throws ComponentLookupException
role - a non-unique key for the desired components
ComponentLookupException
List<Object> lookupList(String role,
List<String> roleHints)
throws ComponentLookupException
role - a non-unique key for the desired components
ComponentLookupException
<T> List<T> lookupList(Class<T> type)
throws ComponentLookupException
type - the non-unique type of the components
ComponentLookupException
<T> List<T> lookupList(Class<T> type,
List<String> roleHints)
throws ComponentLookupException
type - the non-unique type of the components
ComponentLookupException
Map<String,Object> lookupMap(String role)
throws ComponentLookupException
role - a non-unique key for the desired components
ComponentLookupException
Map<String,Object> lookupMap(String role,
List<String> roleHints)
throws ComponentLookupException
role - a non-unique key for the desired components
ComponentLookupException
<T> Map<String,T> lookupMap(Class<T> type)
throws ComponentLookupException
type - the non-unique type of the components
ComponentLookupException
<T> Map<String,T> lookupMap(Class<T> type,
List<String> roleHints)
throws ComponentLookupException
type - the non-unique type of the components
ComponentLookupExceptionComponentDescriptor<?> getComponentDescriptor(String role)
role - a unique role for the desired component's descriptor
ComponentDescriptor<?> getComponentDescriptor(String role,
String roleHint)
role - a unique role for the desired component's descriptorroleHint - a hint showing which implementation should be used
<T> ComponentDescriptor<T> getComponentDescriptor(Class<T> type,
String role,
String roleHint)
type - the Java type of the desired componentrole - a unique role for the desired component's descriptorroleHint - a hint showing which implementation should be used
Map<String,ComponentDescriptor<?>> getComponentDescriptorMap(String role)
role - a non-unique key for the desired components
<T> Map<String,ComponentDescriptor<T>> getComponentDescriptorMap(Class<T> type,
String role)
type - the Java type of the desired componentsrole - a non-unique key for the desired components
List<ComponentDescriptor<?>> getComponentDescriptorList(String role)
role - a non-unique key for the desired components
<T> List<ComponentDescriptor<T>> getComponentDescriptorList(Class<T> type,
String role)
type - the Java type of the desired componentsrole - a non-unique key for the desired components
void addComponentDescriptor(ComponentDescriptor<?> componentDescriptor)
throws CycleDetectedInComponentGraphException
componentDescriptor -
ComponentRepositoryException
CycleDetectedInComponentGraphException
void release(Object component)
throws ComponentLifecycleException
component - the plexus component object to release
ComponentLifecycleException
void releaseAll(Map<String,?> components)
throws ComponentLifecycleException
components - Map of plexus component objects to release
ComponentLifecycleExceptionrelease( Object component )
void releaseAll(List<?> components)
throws ComponentLifecycleException
components - List of plexus component objects to release
ComponentLifecycleExceptionrelease( Object component )boolean hasComponent(String role)
role - a non-unique key for the desired component
boolean hasComponent(String role,
String roleHint)
role - a non-unique key for the desired componentroleHint - a hint for the desired component implementation
boolean hasComponent(Class<?> type)
type - the non-unique type of the component
boolean hasComponent(Class<?> type,
String roleHint)
type - the non-unique type of the componentroleHint - a hint for the desired component implementation
boolean hasComponent(Class<?> type,
String role,
String roleHint)
type - the non-unique type of the componentrole - a non-unique key for the desired componentroleHint - a hint for the desired component implementation
void dispose()
void addContextValue(Object key,
Object value)
key - any unique object valid to the Context's implementationvalue - any object valid to the Context's implementationContext getContext()
org.codehaus.plexus.classworlds.realm.ClassRealm getContainerRealm()
void registerComponentDiscoveryListener(ComponentDiscoveryListener listener)
listener - A listener which responds to different ComponentDiscoveryEventsvoid removeComponentDiscoveryListener(ComponentDiscoveryListener listener)
listener - A listener to remove
List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm childRealm)
throws PlexusConfigurationException,
CycleDetectedInComponentGraphException
childRealm - override - whether to override/merge any conflicting components, where the new component takes precedence.
PlexusConfigurationException
ComponentRepositoryException
CycleDetectedInComponentGraphException
List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm,
Object data)
throws PlexusConfigurationException,
CycleDetectedInComponentGraphException
PlexusConfigurationException
CycleDetectedInComponentGraphExceptionorg.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm(String id)
org.codehaus.plexus.classworlds.realm.ClassRealm getComponentRealm(String realmId)
void removeComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
throws PlexusContainerException
componentRealm - Realm to remove from the container.
PlexusContainerExceptionorg.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm()
setLookupRealm(ClassRealm).
org.codehaus.plexus.classworlds.realm.ClassRealm setLookupRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
realm - the new realm to use.
org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm(Object component)
component -
void addComponent(Object component,
String role)
throws CycleDetectedInComponentGraphException
CycleDetectedInComponentGraphException
<T> void addComponent(T component,
Class<?> role,
String roleHint)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||