org.codehaus.plexus
Class DefaultPlexusContainer

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by 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
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  java.io.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 java.lang.String DEFAULT_CONTAINER_NAME
           
protected static java.lang.String DEFAULT_REALM_NAME
           
protected  LoggerManager loggerManager
          Generic logger interface.
 
Fields inherited from interface org.codehaus.plexus.PlexusContainer
ROLE
 
Constructor Summary
DefaultPlexusContainer()
           
DefaultPlexusContainer(ContainerConfiguration c)
           
 
Method Summary
 void addComponent(java.lang.Object component, java.lang.String role)
           
 void addComponent(java.lang.Object component, java.lang.String role, java.lang.String roleHint)
           
<T> void
addComponent(T component, java.lang.Class<?> role, java.lang.String roleHint)
          Adds live component instance to this container.
 void addComponentDescriptor(ComponentDescriptor<?> componentDescriptor)
          Adds a component descriptor to this container.
 void addContextValue(java.lang.Object key, java.lang.Object value)
          Add a key/value pair to this container's Context.
 org.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm(java.lang.String id)
           
 java.util.List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
          Discovers components in the given realm.
 java.util.List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm, java.lang.Object data)
           
 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(java.lang.Class<T> type, java.lang.String role, java.lang.String roleHint)
          Returns the ComponentDescriptor with the given component role and hint.
 ComponentDescriptor<?> getComponentDescriptor(java.lang.String role)
          Returns the ComponentDescriptor with the given component role and the default role hint.
 ComponentDescriptor<?> getComponentDescriptor(java.lang.String role, java.lang.String roleHint)
          Returns the ComponentDescriptor with the given component role and hint.
<T> java.util.List<ComponentDescriptor<T>>
getComponentDescriptorList(java.lang.Class<T> type, java.lang.String role)
          Returns a List of ComponentDescriptors with the given role.
 java.util.List<ComponentDescriptor<?>> getComponentDescriptorList(java.lang.String role)
          Returns a List of ComponentDescriptors with the given role.
<T> java.util.Map<java.lang.String,ComponentDescriptor<T>>
getComponentDescriptorMap(java.lang.Class<T> type, java.lang.String role)
          Returns a Map of ComponentDescriptors with the given role, keyed by role-hint.
 java.util.Map<java.lang.String,ComponentDescriptor<?>> getComponentDescriptorMap(java.lang.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(java.lang.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  java.io.Reader getInterpolationConfigurationReader(java.io.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 by PlexusContainer.setLookupRealm(ClassRealm).
 org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm(java.lang.Object component)
          Utility method to get a default lookup realm for a component.
 boolean hasComponent(java.lang.Class<?> type)
          Returns true if this container has a component with the given role/role-hint.
 boolean hasComponent(java.lang.Class<?> type, java.lang.String roleHint)
          Returns true if this container has a component with the given role/role-hint.
 boolean hasComponent(java.lang.Class<?> type, java.lang.String role, java.lang.String roleHint)
          Returns true if this container has a component with the given role/role-hint.
 boolean hasComponent(java.lang.String role)
          Returns true if this container has the keyed component.
 boolean hasComponent(java.lang.String role, java.lang.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(java.lang.Class<T> type)
          Looks up and returns a component object with the given unique key or role.
<T> T
lookup(java.lang.Class<T> type, java.lang.String roleHint)
          Looks up and returns a component object with the given unique role/role-hint combination.
<T> T
lookup(java.lang.Class<T> type, java.lang.String role, java.lang.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.
 java.lang.Object lookup(java.lang.String role)
          Looks up and returns a component object with the given unique key or role.
 java.lang.Object lookup(java.lang.String role, java.lang.String roleHint)
          Looks up and returns a component object with the given unique role/role-hint combination.
<T> java.util.List<T>
lookupList(java.lang.Class<T> type)
          Looks up and returns a List of component objects with the given role.
<T> java.util.List<T>
lookupList(java.lang.Class<T> type, java.util.List<java.lang.String> roleHints)
          Looks up and returns a List of component objects with the given role.
 java.util.List<java.lang.Object> lookupList(java.lang.String role)
          Looks up and returns a List of component objects with the given role.
 java.util.List<java.lang.Object> lookupList(java.lang.String role, java.util.List<java.lang.String> roleHints)
          Looks up and returns a List of component objects with the given role.
<T> java.util.Map<java.lang.String,T>
lookupMap(java.lang.Class<T> type)
          Looks up and returns a Map of component objects with the given role, keyed by all available role-hints.
<T> java.util.Map<java.lang.String,T>
lookupMap(java.lang.Class<T> type, java.util.List<java.lang.String> roleHints)
          Looks up and returns a Map of component objects with the given role, keyed by all available role-hints.
 java.util.Map<java.lang.String,java.lang.Object> lookupMap(java.lang.String role)
          Looks up and returns a Map of component objects with the given role, keyed by all available role-hints.
 java.util.Map<java.lang.String,java.lang.Object> lookupMap(java.lang.String role, java.util.List<java.lang.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(java.lang.Object component)
          Releases the component from the container.
 void releaseAll(java.util.List<?> components)
          Releases all Listed components from the container.
 void releaseAll(java.util.Map<java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONTAINER_NAME

protected static final java.lang.String DEFAULT_CONTAINER_NAME
See Also:
Constant Field Values

DEFAULT_REALM_NAME

protected static final java.lang.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 java.io.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(java.lang.Object component,
                         java.lang.String role)
Specified by:
addComponent in interface PlexusContainer

addComponent

public <T> void addComponent(T component,
                             java.lang.Class<?> role,
                             java.lang.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 interface PlexusContainer

addComponent

public void addComponent(java.lang.Object component,
                         java.lang.String role,
                         java.lang.String roleHint)

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 interface PlexusContainer
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 by PlexusContainer.setLookupRealm(ClassRealm).

Specified by:
getLookupRealm in interface PlexusContainer

createChildRealm

public org.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm(java.lang.String id)
Specified by:
createChildRealm in interface PlexusContainer

lookup

public java.lang.Object lookup(java.lang.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 interface PlexusContainer
Parameters:
role - a unique key for the desired component
Returns:
a Plexus component object
Throws:
ComponentLookupException

lookup

public java.lang.Object lookup(java.lang.String role,
                               java.lang.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 interface PlexusContainer
Parameters:
role - a non-unique key for the desired component
roleHint - a hint for the desired component implementation
Returns:
a Plexus component object
Throws:
ComponentLookupException

lookup

public <T> T lookup(java.lang.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 interface PlexusContainer
Parameters:
type - the unique type of the component within the container
Returns:
a Plexus component object
Throws:
ComponentLookupException

lookup

public <T> T lookup(java.lang.Class<T> type,
                    java.lang.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 interface PlexusContainer
Parameters:
type - the non-unique type of the component
roleHint - a hint for the desired component implementation
Returns:
a Plexus component object
Throws:
ComponentLookupException

lookup

public <T> T lookup(java.lang.Class<T> type,
                    java.lang.String role,
                    java.lang.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 interface PlexusContainer
Parameters:
type - the non-unique type of the component
role - a non-unique key for the desired component
roleHint - a hint for the desired component implementation
Returns:
a Plexus component object
Throws:
ComponentLookupException

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 interface PlexusContainer
Parameters:
componentDescriptor - the descriptor of the component
Returns:
a Plexus component object
Throws:
ComponentLookupException

lookupList

public java.util.List<java.lang.Object> lookupList(java.lang.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 interface PlexusContainer
Parameters:
role - a non-unique key for the desired components
Returns:
a List of component objects
Throws:
ComponentLookupException

lookupList

public java.util.List<java.lang.Object> lookupList(java.lang.String role,
                                                   java.util.List<java.lang.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 interface PlexusContainer
Parameters:
role - a non-unique key for the desired components
Returns:
a List of component objects
Throws:
ComponentLookupException

lookupList

public <T> java.util.List<T> lookupList(java.lang.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 interface PlexusContainer
Parameters:
type - the non-unique type of the components
Returns:
a List of component objects
Throws:
ComponentLookupException

lookupList

public <T> java.util.List<T> lookupList(java.lang.Class<T> type,
                                        java.util.List<java.lang.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 interface PlexusContainer
Parameters:
type - the non-unique type of the components
Returns:
a List of component objects
Throws:
ComponentLookupException

lookupMap

public java.util.Map<java.lang.String,java.lang.Object> lookupMap(java.lang.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 interface PlexusContainer
Parameters:
role - a non-unique key for the desired components
Returns:
a Map of component objects
Throws:
ComponentLookupException

lookupMap

public java.util.Map<java.lang.String,java.lang.Object> lookupMap(java.lang.String role,
                                                                  java.util.List<java.lang.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 interface PlexusContainer
Parameters:
role - a non-unique key for the desired components
Returns:
a Map of component objects
Throws:
ComponentLookupException

lookupMap

public <T> java.util.Map<java.lang.String,T> lookupMap(java.lang.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 interface PlexusContainer
Parameters:
type - the non-unique type of the components
Returns:
a Map of component objects
Throws:
ComponentLookupException

lookupMap

public <T> java.util.Map<java.lang.String,T> lookupMap(java.lang.Class<T> type,
                                                       java.util.List<java.lang.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 interface PlexusContainer
Parameters:
type - the non-unique type of the components
Returns:
a Map of component objects
Throws:
ComponentLookupException

hasComponent

public boolean hasComponent(java.lang.String role)
Description copied from interface: PlexusContainer
Returns true if this container has the keyed component.

Specified by:
hasComponent in interface PlexusContainer
Parameters:
role - a non-unique key for the desired component
Returns:
true if this container has the keyed component

hasComponent

public boolean hasComponent(java.lang.String role,
                            java.lang.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 interface PlexusContainer
Parameters:
role - a non-unique key for the desired component
roleHint - 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(java.lang.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 interface PlexusContainer
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(java.lang.Class<?> type,
                            java.lang.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 interface PlexusContainer
Parameters:
type - the non-unique type of the component
roleHint - 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(java.lang.Class<?> type,
                            java.lang.String role,
                            java.lang.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 interface PlexusContainer
Parameters:
type - the non-unique type of the component
role - a non-unique key for the desired component
roleHint - 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(java.lang.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 interface PlexusContainer
Parameters:
role - a unique role for the desired component's descriptor
Returns:
the ComponentDescriptor with the given component role

getComponentDescriptor

public ComponentDescriptor<?> getComponentDescriptor(java.lang.String role,
                                                     java.lang.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 interface PlexusContainer
Parameters:
role - a unique role for the desired component's descriptor
roleHint - a hint showing which implementation should be used
Returns:
the ComponentDescriptor with the given component role

getComponentDescriptor

public <T> ComponentDescriptor<T> getComponentDescriptor(java.lang.Class<T> type,
                                                         java.lang.String role,
                                                         java.lang.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 interface PlexusContainer
Parameters:
type - the Java type of the desired component
role - a unique role for the desired component's descriptor
roleHint - a hint showing which implementation should be used
Returns:
the ComponentDescriptor with the given component role

getComponentDescriptorMap

public java.util.Map<java.lang.String,ComponentDescriptor<?>> getComponentDescriptorMap(java.lang.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 interface PlexusContainer
Parameters:
role - a non-unique key for the desired components
Returns:
a Map of component descriptors keyed by role-hint

getComponentDescriptorMap

public <T> java.util.Map<java.lang.String,ComponentDescriptor<T>> getComponentDescriptorMap(java.lang.Class<T> type,
                                                                                            java.lang.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 interface PlexusContainer
Parameters:
type - the Java type of the desired components
role - a non-unique key for the desired components
Returns:
a Map of component descriptors keyed by role-hint

getComponentDescriptorList

public java.util.List<ComponentDescriptor<?>> getComponentDescriptorList(java.lang.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 interface PlexusContainer
Parameters:
role - a non-unique key for the desired components
Returns:
a List of component descriptors

getComponentDescriptorList

public <T> java.util.List<ComponentDescriptor<T>> getComponentDescriptorList(java.lang.Class<T> type,
                                                                             java.lang.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 interface PlexusContainer
Parameters:
type - the Java type of the desired components
role - 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 interface PlexusContainer
Throws:
CycleDetectedInComponentGraphException

release

public void release(java.lang.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 interface PlexusContainer
Parameters:
component - the plexus component object to release
Throws:
ComponentLifecycleException

releaseAll

public void releaseAll(java.util.Map<java.lang.String,?> components)
                throws ComponentLifecycleException
Description copied from interface: PlexusContainer
Releases all Mapped component values from the container.

Specified by:
releaseAll in interface PlexusContainer
Parameters:
components - Map of plexus component objects to release
Throws:
ComponentLifecycleException
See Also:
PlexusContainer.release( Object component )

releaseAll

public void releaseAll(java.util.List<?> components)
                throws ComponentLifecycleException
Description copied from interface: PlexusContainer
Releases all Listed components from the container.

Specified by:
releaseAll in interface PlexusContainer
Parameters:
components - List of plexus component objects to release
Throws:
ComponentLifecycleException
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 interface PlexusContainer

addContextValue

public void addContextValue(java.lang.Object key,
                            java.lang.Object value)
Description copied from interface: PlexusContainer
Add a key/value pair to this container's Context.

Specified by:
addContextValue in interface PlexusContainer
Parameters:
key - any unique object valid to the Context's implementation
value - any object valid to the Context's implementation

getClassWorld

public org.codehaus.plexus.classworlds.ClassWorld getClassWorld()
Specified by:
getClassWorld in interface MutablePlexusContainer

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 interface PlexusContainer
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 interface PlexusContainer
Returns:
this container's context.

initializeConfiguration

protected void initializeConfiguration(ContainerConfiguration c)
                                throws PlexusConfigurationException,
                                       ContextException,
                                       java.io.IOException
Throws:
PlexusConfigurationException
ContextException
java.io.IOException

getInterpolationConfigurationReader

protected java.io.Reader getInterpolationConfigurationReader(java.io.Reader reader)

getLogger

public Logger getLogger()
Specified by:
getLogger in interface MutablePlexusContainer
Overrides:
getLogger in class AbstractLogEnabled

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 interface PlexusContainer
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 interface PlexusContainer
Parameters:
listener - A listener to remove

getComponentRegistry

public ComponentRegistry getComponentRegistry()
Specified by:
getComponentRegistry in interface MutablePlexusContainer

setComponentRegistry

public void setComponentRegistry(ComponentRegistry componentRegistry)
Specified by:
setComponentRegistry in interface MutablePlexusContainer

getComponentDiscovererManager

public ComponentDiscovererManager getComponentDiscovererManager()
Specified by:
getComponentDiscovererManager in interface MutablePlexusContainer

setComponentDiscovererManager

public void setComponentDiscovererManager(ComponentDiscovererManager componentDiscovererManager)
Specified by:
setComponentDiscovererManager in interface MutablePlexusContainer

getComponentFactoryManager

public ComponentFactoryManager getComponentFactoryManager()
Specified by:
getComponentFactoryManager in interface MutablePlexusContainer

setComponentFactoryManager

public void setComponentFactoryManager(ComponentFactoryManager componentFactoryManager)
Specified by:
setComponentFactoryManager in interface MutablePlexusContainer

getConfiguration

public PlexusConfiguration getConfiguration()
Specified by:
getConfiguration in interface MutablePlexusContainer

setConfiguration

public void setConfiguration(PlexusConfiguration configuration)
Specified by:
setConfiguration in interface MutablePlexusContainer

getComponentRealm

public org.codehaus.plexus.classworlds.realm.ClassRealm getComponentRealm(java.lang.String realmId)
Specified by:
getComponentRealm in interface MutablePlexusContainer
Specified by:
getComponentRealm in interface PlexusContainer

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 interface PlexusContainer
Parameters:
realm - Realm to remove from the container.
Throws:
PlexusContainerException

getLookupRealm

public org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm(java.lang.Object component)
Utility method to get a default lookup realm for a component.

Specified by:
getLookupRealm in interface PlexusContainer
Returns:

setConfigurationSource

public void setConfigurationSource(ConfigurationSource configurationSource)
Specified by:
setConfigurationSource in interface MutablePlexusContainer

getConfigurationSource

public ConfigurationSource getConfigurationSource()
Specified by:
getConfigurationSource in interface MutablePlexusContainer

getLoggerManager

public LoggerManager getLoggerManager()
Specified by:
getLoggerManager in interface MutablePlexusContainer

setLoggerManager

public void setLoggerManager(LoggerManager loggerManager)
Specified by:
setLoggerManager in interface MutablePlexusContainer

discoverComponents

public java.util.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 interface PlexusContainer
Returns:
Throws:
PlexusConfigurationException
CycleDetectedInComponentGraphException

discoverComponents

public java.util.List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm,
                                                                 java.lang.Object data)
                                                          throws PlexusConfigurationException,
                                                                 CycleDetectedInComponentGraphException
Specified by:
discoverComponents in interface PlexusContainer
Throws:
PlexusConfigurationException
CycleDetectedInComponentGraphException


Copyright © 2001-2009 Codehaus. All Rights Reserved.