Package org.codehaus.plexus
Class DefaultPlexusContainer
- java.lang.Object
-
- org.codehaus.plexus.logging.AbstractLogEnabled
-
- org.codehaus.plexus.DefaultPlexusContainer
-
- All Implemented Interfaces:
LogEnabled
,MutablePlexusContainer
,PlexusContainer
public class DefaultPlexusContainer extends AbstractLogEnabled implements MutablePlexusContainer
Default implementation of PlexusContainer and MutablePlexusContainer.- Author:
- Jason van Zyl, Kenney Westerhof
-
-
Field Summary
Fields Modifier and Type Field Description protected org.codehaus.plexus.classworlds.ClassWorld
classWorld
protected ComponentDiscovererManager
componentDiscovererManager
Simple index (registry) of ComponentDiscovers and ComponentDiscoveryListener.protected ComponentFactoryManager
componentFactoryManager
Trivial class to look-up ComponentFactory instances in this container.protected PlexusConfiguration
configuration
protected Reader
configurationReader
protected ConfigurationSource
configurationSource
Converts a ComponentDescriptor into PlexusConfiguration.protected Context
containerContext
Arbitrary data associated with the container.protected org.codehaus.plexus.classworlds.realm.ClassRealm
containerRealm
protected static String
DEFAULT_CONTAINER_NAME
protected static String
DEFAULT_REALM_NAME
protected LoggerManager
loggerManager
Generic logger interface.-
Fields inherited from interface org.codehaus.plexus.PlexusContainer
ROLE
-
-
Constructor Summary
Constructors Constructor Description DefaultPlexusContainer()
DefaultPlexusContainer(ContainerConfiguration c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComponent(Object component, String role)
void
addComponent(Object component, String role, String roleHint)
<T> void
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 realm)
Discovers components in the given realm.List<ComponentDescriptor<?>>
discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm, Object data)
Discovers components in the given realm.void
dispose()
Disposes of this container, which in turn disposes all of it's components.org.codehaus.plexus.classworlds.ClassWorld
getClassWorld()
<T> ComponentDescriptor<T>
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.<T> List<ComponentDescriptor<T>>
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.<T> Map<String,ComponentDescriptor<T>>
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.ComponentDiscovererManager
getComponentDiscovererManager()
ComponentFactoryManager
getComponentFactoryManager()
org.codehaus.plexus.classworlds.realm.ClassRealm
getComponentRealm(String realmId)
ComponentRegistry
getComponentRegistry()
PlexusConfiguration
getConfiguration()
ConfigurationSource
getConfigurationSource()
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.protected Reader
getInterpolationConfigurationReader(Reader reader)
Logger
getLogger()
LoggerManager
getLoggerManager()
org.codehaus.plexus.classworlds.realm.ClassRealm
getLookupRealm()
Returns the lookup realm for this container, which is either the container realm or the realm set byPlexusContainer.setLookupRealm(ClassRealm)
.org.codehaus.plexus.classworlds.realm.ClassRealm
getLookupRealm(Object component)
Utility method to get a default lookup realm for a component.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.protected void
initialize(ContainerConfiguration containerConfiguration)
protected void
initializeConfiguration(ContainerConfiguration c)
protected void
initializePhases(ContainerConfiguration containerConfiguration)
<T> T
lookup(Class<T> type)
Looks up and returns a component object with the given unique key or role.<T> T
lookup(Class<T> type, String roleHint)
Looks up and returns a component object with the given unique role/role-hint combination.<T> T
lookup(Class<T> type, String role, String roleHint)
Looks up and returns a component object with the given unique role/role-hint combination.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.<T> T
lookup(ComponentDescriptor<T> componentDescriptor)
Looks up and returns a component object matching the given component descriptor.<T> List<T>
lookupList(Class<T> type)
Looks up and returns a List of component objects with the given role.<T> List<T>
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.<T> Map<String,T>
lookupMap(Class<T> type)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints.<T> Map<String,T>
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 realm)
Dissociate the realm with the specified id from the container.void
setClassWorld(org.codehaus.plexus.classworlds.ClassWorld classWorld)
void
setComponentDiscovererManager(ComponentDiscovererManager componentDiscovererManager)
void
setComponentFactoryManager(ComponentFactoryManager componentFactoryManager)
void
setComponentRegistry(ComponentRegistry componentRegistry)
void
setConfiguration(PlexusConfiguration configuration)
void
setConfigurationSource(ConfigurationSource configurationSource)
void
setContainerRealm(org.codehaus.plexus.classworlds.realm.ClassRealm containerRealm)
void
setLoggerManager(LoggerManager loggerManager)
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.protected void
start()
-
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
DEFAULT_CONTAINER_NAME
protected static final String DEFAULT_CONTAINER_NAME
- See Also:
- Constant Field Values
-
DEFAULT_REALM_NAME
protected static final String DEFAULT_REALM_NAME
- See Also:
- Constant Field Values
-
containerContext
protected Context containerContext
Arbitrary data associated with the container. Data in the container has highest precedence when configuring a component to create.
-
configuration
protected PlexusConfiguration configuration
-
configurationReader
protected Reader configurationReader
-
classWorld
protected org.codehaus.plexus.classworlds.ClassWorld classWorld
-
containerRealm
protected org.codehaus.plexus.classworlds.realm.ClassRealm containerRealm
-
componentDiscovererManager
protected ComponentDiscovererManager componentDiscovererManager
Simple index (registry) of ComponentDiscovers and ComponentDiscoveryListener.
-
componentFactoryManager
protected ComponentFactoryManager componentFactoryManager
Trivial class to look-up ComponentFactory instances in this container.
-
loggerManager
protected LoggerManager loggerManager
Generic logger interface.
-
configurationSource
protected ConfigurationSource configurationSource
Converts a ComponentDescriptor into PlexusConfiguration.
-
-
Constructor Detail
-
DefaultPlexusContainer
public DefaultPlexusContainer() throws PlexusContainerException
- Throws:
PlexusContainerException
-
DefaultPlexusContainer
public DefaultPlexusContainer(ContainerConfiguration c) throws PlexusContainerException
- Throws:
PlexusContainerException
-
-
Method Detail
-
addComponent
public void addComponent(Object component, String role)
- Specified by:
addComponent
in interfacePlexusContainer
-
addComponent
public <T> void addComponent(T component, Class<?> role, String roleHint)
Description copied from interface:PlexusContainer
Adds live component instance to this container. Component instance is not associated with any class realm and will be ignored during lookup is lookup realm is provided using thread context classloader.- Specified by:
addComponent
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
component
- The component.role
- The role.roleHint
- The hint.
-
setLookupRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm setLookupRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Description copied from interface:PlexusContainer
Sets the lookup realm to use for lookup calls that don't have a ClassRealm parameter.- Specified by:
setLookupRealm
in interfacePlexusContainer
- Parameters:
realm
- the new realm to use.- Returns:
- The previous lookup realm. It is advised to set it back once the old-style lookups have completed.
-
getLookupRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm()
Description copied from interface:PlexusContainer
Returns the lookup realm for this container, which is either the container realm or the realm set byPlexusContainer.setLookupRealm(ClassRealm)
.- Specified by:
getLookupRealm
in interfacePlexusContainer
- Returns:
ClassRealm
-
createChildRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm(String id)
- Specified by:
createChildRealm
in interfacePlexusContainer
-
lookup
public Object lookup(String role) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a component object with the given unique key or role.- Specified by:
lookup
in interfacePlexusContainer
- Parameters:
role
- a unique key for the desired component- Returns:
- a Plexus component object
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookup
public Object lookup(String role, String roleHint) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a component object with the given unique role/role-hint combination.- Specified by:
lookup
in interfacePlexusContainer
- Parameters:
role
- a non-unique key for the desired componentroleHint
- a hint for the desired component implementation- Returns:
- a Plexus component object
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookup
public <T> T lookup(Class<T> type) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a component object with the given unique key or role.- Specified by:
lookup
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
type
- the unique type of the component within the container- Returns:
- a Plexus component object
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookup
public <T> T lookup(Class<T> type, String roleHint) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a component object with the given unique role/role-hint combination.- Specified by:
lookup
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
type
- the non-unique type of the componentroleHint
- a hint for the desired component implementation- Returns:
- a Plexus component object
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookup
public <T> T lookup(Class<T> type, String role, String roleHint) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a component object with the given unique role/role-hint combination.- Specified by:
lookup
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
type
- the non-unique type of the componentrole
- a non-unique key for the desired componentroleHint
- a hint for the desired component implementation- Returns:
- a Plexus component object
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookup
public <T> T lookup(ComponentDescriptor<T> componentDescriptor) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a component object matching the given component descriptor.- Specified by:
lookup
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
componentDescriptor
- the descriptor of the component- Returns:
- a Plexus component object
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookupList
public List<Object> lookupList(String role) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a List of component objects with the given role.- Specified by:
lookupList
in interfacePlexusContainer
- Parameters:
role
- a non-unique key for the desired components- Returns:
- a List of component objects
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookupList
public List<Object> lookupList(String role, List<String> roleHints) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a List of component objects with the given role.- Specified by:
lookupList
in interfacePlexusContainer
- Parameters:
role
- a non-unique key for the desired componentsroleHints
- the list of hints.- Returns:
- a List of component objects
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookupList
public <T> List<T> lookupList(Class<T> type) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a List of component objects with the given role.- Specified by:
lookupList
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
type
- the non-unique type of the components- Returns:
- a List of component objects
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookupList
public <T> List<T> lookupList(Class<T> type, List<String> roleHints) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a List of component objects with the given role.- Specified by:
lookupList
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
type
- the non-unique type of the componentsroleHints
- the list of hints.- Returns:
- a List of component objects
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookupMap
public Map<String,Object> lookupMap(String role) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints.- Specified by:
lookupMap
in interfacePlexusContainer
- Parameters:
role
- a non-unique key for the desired components- Returns:
- a Map of component objects
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookupMap
public Map<String,Object> lookupMap(String role, List<String> roleHints) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints.- Specified by:
lookupMap
in interfacePlexusContainer
- Parameters:
role
- a non-unique key for the desired componentsroleHints
- the list of hints.- Returns:
- a Map of component objects
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookupMap
public <T> Map<String,T> lookupMap(Class<T> type) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints.- Specified by:
lookupMap
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
type
- the non-unique type of the components- Returns:
- a Map of component objects
- Throws:
ComponentLookupException
- in case of lookup error.
-
lookupMap
public <T> Map<String,T> lookupMap(Class<T> type, List<String> roleHints) throws ComponentLookupException
Description copied from interface:PlexusContainer
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints.- Specified by:
lookupMap
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
type
- the non-unique type of the componentsroleHints
- the list of hints.- Returns:
- a Map of component objects
- Throws:
ComponentLookupException
- in case of lookup error.
-
hasComponent
public boolean hasComponent(String role)
Description copied from interface:PlexusContainer
Returns true if this container has the keyed component.- Specified by:
hasComponent
in interfacePlexusContainer
- Parameters:
role
- a non-unique key for the desired component- Returns:
- true if this container has the keyed component
-
hasComponent
public boolean hasComponent(String role, String roleHint)
Description copied from interface:PlexusContainer
Returns true if this container has a component with the given role/role-hint.- Specified by:
hasComponent
in interfacePlexusContainer
- Parameters:
role
- a non-unique key for the desired componentroleHint
- a hint for the desired component implementation- Returns:
- true if this container has a component with the given role/role-hint
-
hasComponent
public boolean hasComponent(Class<?> type)
Description copied from interface:PlexusContainer
Returns true if this container has a component with the given role/role-hint.- Specified by:
hasComponent
in interfacePlexusContainer
- Parameters:
type
- the non-unique type of the component- Returns:
- true if this container has a component with the given role/role-hint
-
hasComponent
public boolean hasComponent(Class<?> type, String roleHint)
Description copied from interface:PlexusContainer
Returns true if this container has a component with the given role/role-hint.- Specified by:
hasComponent
in interfacePlexusContainer
- Parameters:
type
- the non-unique type of the componentroleHint
- a hint for the desired component implementation- Returns:
- true if this container has a component with the given role/role-hint
-
hasComponent
public boolean hasComponent(Class<?> type, String role, String roleHint)
Description copied from interface:PlexusContainer
Returns true if this container has a component with the given role/role-hint.- Specified by:
hasComponent
in interfacePlexusContainer
- Parameters:
type
- the non-unique type of the componentrole
- a non-unique key for the desired componentroleHint
- a hint for the desired component implementation- Returns:
- true if this container has a component with the given role/role-hint
-
getComponentDescriptor
public ComponentDescriptor<?> getComponentDescriptor(String role)
Description copied from interface:PlexusContainer
Returns the ComponentDescriptor with the given component role and the default role hint. Searches up the hierarchy until one is found, null if none is found.- Specified by:
getComponentDescriptor
in interfacePlexusContainer
- Parameters:
role
- a unique role for the desired component's descriptor- Returns:
- the ComponentDescriptor with the given component role
-
getComponentDescriptor
public ComponentDescriptor<?> getComponentDescriptor(String role, String roleHint)
Description copied from interface:PlexusContainer
Returns the ComponentDescriptor with the given component role and hint. Searches up the hierarchy until one is found, null if none is found.- Specified by:
getComponentDescriptor
in interfacePlexusContainer
- Parameters:
role
- a unique role for the desired component's descriptorroleHint
- a hint showing which implementation should be used- Returns:
- the ComponentDescriptor with the given component role
-
getComponentDescriptor
public <T> ComponentDescriptor<T> getComponentDescriptor(Class<T> type, String role, String roleHint)
Description copied from interface:PlexusContainer
Returns the ComponentDescriptor with the given component role and hint. Searches up the hierarchy until one is found, null if none is found.- Specified by:
getComponentDescriptor
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
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- Returns:
- the ComponentDescriptor with the given component role
-
getComponentDescriptorMap
public Map<String,ComponentDescriptor<?>> getComponentDescriptorMap(String role)
Description copied from interface:PlexusContainer
Returns a Map of ComponentDescriptors with the given role, keyed by role-hint. Searches up the hierarchy until all are found, an empty Map if none are found.- Specified by:
getComponentDescriptorMap
in interfacePlexusContainer
- Parameters:
role
- a non-unique key for the desired components- Returns:
- a Map of component descriptors keyed by role-hint
-
getComponentDescriptorMap
public <T> Map<String,ComponentDescriptor<T>> getComponentDescriptorMap(Class<T> type, String role)
Description copied from interface:PlexusContainer
Returns a Map of ComponentDescriptors with the given role, keyed by role-hint. Searches up the hierarchy until all are found, an empty Map if none are found.- Specified by:
getComponentDescriptorMap
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
type
- the Java type of the desired componentsrole
- a non-unique key for the desired components- Returns:
- a Map of component descriptors keyed by role-hint
-
getComponentDescriptorList
public List<ComponentDescriptor<?>> getComponentDescriptorList(String role)
Description copied from interface:PlexusContainer
Returns a List of ComponentDescriptors with the given role. Searches up the hierarchy until all are found, an empty List if none are found.- Specified by:
getComponentDescriptorList
in interfacePlexusContainer
- Parameters:
role
- a non-unique key for the desired components- Returns:
- a List of component descriptors
-
getComponentDescriptorList
public <T> List<ComponentDescriptor<T>> getComponentDescriptorList(Class<T> type, String role)
Description copied from interface:PlexusContainer
Returns a List of ComponentDescriptors with the given role. Searches up the hierarchy until all are found, an empty List if none are found.- Specified by:
getComponentDescriptorList
in interfacePlexusContainer
- Type Parameters:
T
- The type.- Parameters:
type
- the Java type of the desired componentsrole
- a non-unique key for the desired components- Returns:
- a List of component descriptors
-
addComponentDescriptor
public void addComponentDescriptor(ComponentDescriptor<?> componentDescriptor) throws CycleDetectedInComponentGraphException
Description copied from interface:PlexusContainer
Adds a component descriptor to this container. componentDescriptor should have realmId set.- Specified by:
addComponentDescriptor
in interfacePlexusContainer
- Parameters:
componentDescriptor
-ComponentDescriptor
- Throws:
CycleDetectedInComponentGraphException
- In case of an error.
-
release
public void release(Object component) throws ComponentLifecycleException
Description copied from interface:PlexusContainer
Releases the component from the container. This is dependent upon how the implementation manages the component, but usually enacts some standard lifecycle shutdown procedure on the component. In every case, the component is no longer accessible from the container (unless another is created).- Specified by:
release
in interfacePlexusContainer
- Parameters:
component
- the plexus component object to release- Throws:
ComponentLifecycleException
- in case of an error.
-
releaseAll
public void releaseAll(Map<String,?> components) throws ComponentLifecycleException
Description copied from interface:PlexusContainer
Releases all Mapped component values from the container.- Specified by:
releaseAll
in interfacePlexusContainer
- Parameters:
components
- Map of plexus component objects to release- Throws:
ComponentLifecycleException
- in case of an error.- See Also:
PlexusContainer.release( Object component )
-
releaseAll
public void releaseAll(List<?> components) throws ComponentLifecycleException
Description copied from interface:PlexusContainer
Releases all Listed components from the container.- Specified by:
releaseAll
in interfacePlexusContainer
- Parameters:
components
- List of plexus component objects to release- Throws:
ComponentLifecycleException
- in case of an error.- See Also:
PlexusContainer.release( Object component )
-
initialize
protected void initialize(ContainerConfiguration containerConfiguration) throws PlexusContainerException
- Throws:
PlexusContainerException
-
initializePhases
protected void initializePhases(ContainerConfiguration containerConfiguration) throws PlexusContainerException
- Throws:
PlexusContainerException
-
start
protected void start() throws PlexusContainerException
- Throws:
PlexusContainerException
-
dispose
public void dispose()
Description copied from interface:PlexusContainer
Disposes of this container, which in turn disposes all of it's components. This container should also remove itself from the container hierarchy.- Specified by:
dispose
in interfacePlexusContainer
-
addContextValue
public void addContextValue(Object key, Object value)
Description copied from interface:PlexusContainer
Add a key/value pair to this container's Context.- Specified by:
addContextValue
in interfacePlexusContainer
- Parameters:
key
- any unique object valid to the Context's implementationvalue
- any object valid to the Context's implementation
-
getClassWorld
public org.codehaus.plexus.classworlds.ClassWorld getClassWorld()
- Specified by:
getClassWorld
in interfaceMutablePlexusContainer
-
setClassWorld
public void setClassWorld(org.codehaus.plexus.classworlds.ClassWorld classWorld)
-
getContainerRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm getContainerRealm()
Description copied from interface:PlexusContainer
Returns the Classworld's ClassRealm of this Container, which acts as the default parent for all contained components.- Specified by:
getContainerRealm
in interfacePlexusContainer
- Returns:
- the ClassRealm of this Container
-
setContainerRealm
public void setContainerRealm(org.codehaus.plexus.classworlds.realm.ClassRealm containerRealm)
-
getContext
public Context getContext()
Description copied from interface:PlexusContainer
Returns this container's context. A Context is a simple data store used to hold values which may alter the execution of the Container.- Specified by:
getContext
in interfacePlexusContainer
- Returns:
- this container's context.
-
initializeConfiguration
protected void initializeConfiguration(ContainerConfiguration c) throws PlexusConfigurationException, ContextException, IOException
-
getInterpolationConfigurationReader
protected Reader getInterpolationConfigurationReader(Reader reader)
-
getLogger
public Logger getLogger()
- Specified by:
getLogger
in interfaceMutablePlexusContainer
- Overrides:
getLogger
in classAbstractLogEnabled
-
registerComponentDiscoveryListener
public void registerComponentDiscoveryListener(ComponentDiscoveryListener listener)
Description copied from interface:PlexusContainer
Adds the listener to this container. ComponentDiscoveryListeners have the ability to respond to various ComponentDiscoverer events.- Specified by:
registerComponentDiscoveryListener
in interfacePlexusContainer
- Parameters:
listener
- A listener which responds to different ComponentDiscoveryEvents
-
removeComponentDiscoveryListener
public void removeComponentDiscoveryListener(ComponentDiscoveryListener listener)
Description copied from interface:PlexusContainer
Removes the listener from this container.- Specified by:
removeComponentDiscoveryListener
in interfacePlexusContainer
- Parameters:
listener
- A listener to remove
-
getComponentRegistry
public ComponentRegistry getComponentRegistry()
- Specified by:
getComponentRegistry
in interfaceMutablePlexusContainer
-
setComponentRegistry
public void setComponentRegistry(ComponentRegistry componentRegistry)
- Specified by:
setComponentRegistry
in interfaceMutablePlexusContainer
-
getComponentDiscovererManager
public ComponentDiscovererManager getComponentDiscovererManager()
- Specified by:
getComponentDiscovererManager
in interfaceMutablePlexusContainer
-
setComponentDiscovererManager
public void setComponentDiscovererManager(ComponentDiscovererManager componentDiscovererManager)
- Specified by:
setComponentDiscovererManager
in interfaceMutablePlexusContainer
-
getComponentFactoryManager
public ComponentFactoryManager getComponentFactoryManager()
- Specified by:
getComponentFactoryManager
in interfaceMutablePlexusContainer
-
setComponentFactoryManager
public void setComponentFactoryManager(ComponentFactoryManager componentFactoryManager)
- Specified by:
setComponentFactoryManager
in interfaceMutablePlexusContainer
-
getConfiguration
public PlexusConfiguration getConfiguration()
- Specified by:
getConfiguration
in interfaceMutablePlexusContainer
-
setConfiguration
public void setConfiguration(PlexusConfiguration configuration)
- Specified by:
setConfiguration
in interfaceMutablePlexusContainer
-
getComponentRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm getComponentRealm(String realmId)
- Specified by:
getComponentRealm
in interfaceMutablePlexusContainer
- Specified by:
getComponentRealm
in interfacePlexusContainer
-
removeComponentRealm
public void removeComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws PlexusContainerException
Description copied from interface:PlexusContainer
Dissociate the realm with the specified id from the container. This will remove all components contained in the realm from the component repository.- Specified by:
removeComponentRealm
in interfacePlexusContainer
- Parameters:
realm
- Realm to remove from the container.- Throws:
PlexusContainerException
-PlexusContainerException
.
-
getLookupRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm(Object component)
Utility method to get a default lookup realm for a component.- Specified by:
getLookupRealm
in interfacePlexusContainer
- Parameters:
component
- The component.- Returns:
ClassRealm
-
setConfigurationSource
public void setConfigurationSource(ConfigurationSource configurationSource)
- Specified by:
setConfigurationSource
in interfaceMutablePlexusContainer
-
getConfigurationSource
public ConfigurationSource getConfigurationSource()
- Specified by:
getConfigurationSource
in interfaceMutablePlexusContainer
-
getLoggerManager
public LoggerManager getLoggerManager()
- Specified by:
getLoggerManager
in interfaceMutablePlexusContainer
-
setLoggerManager
public void setLoggerManager(LoggerManager loggerManager)
- Specified by:
setLoggerManager
in interfaceMutablePlexusContainer
-
discoverComponents
public List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws PlexusConfigurationException, CycleDetectedInComponentGraphException
Description copied from interface:PlexusContainer
Discovers components in the given realm.- Specified by:
discoverComponents
in interfacePlexusContainer
- Parameters:
realm
-ClassRealm
- Returns:
- list
ComponentDescriptor
- Throws:
PlexusConfigurationException
- in case of an error.CycleDetectedInComponentGraphException
- in case of an error.
-
discoverComponents
public List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm, Object data) throws PlexusConfigurationException, CycleDetectedInComponentGraphException
Description copied from interface:PlexusContainer
Discovers components in the given realm.- Specified by:
discoverComponents
in interfacePlexusContainer
- Parameters:
realm
- theClassRealm
.data
- The data.- Returns:
- list
ComponentDescriptor
- Throws:
PlexusConfigurationException
- in case of an error.CycleDetectedInComponentGraphException
- in case of an error.
-
-