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.ClassWorldclassWorldprotected ComponentDiscovererManagercomponentDiscovererManagerSimple index (registry) of ComponentDiscovers and ComponentDiscoveryListener.protected ComponentFactoryManagercomponentFactoryManagerTrivial class to look-up ComponentFactory instances in this container.protected PlexusConfigurationconfigurationprotected ReaderconfigurationReaderprotected ConfigurationSourceconfigurationSourceConverts a ComponentDescriptor into PlexusConfiguration.protected ContextcontainerContextArbitrary data associated with the container.protected org.codehaus.plexus.classworlds.realm.ClassRealmcontainerRealmprotected static StringDEFAULT_CONTAINER_NAMEprotected static StringDEFAULT_REALM_NAMEprotected LoggerManagerloggerManagerGeneric 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 voidaddComponent(Object component, String role)voidaddComponent(Object component, String role, String roleHint)<T> voidaddComponent(T component, Class<?> role, String roleHint)Adds live component instance to this container.voidaddComponentDescriptor(ComponentDescriptor<?> componentDescriptor)Adds a component descriptor to this container.voidaddContextValue(Object key, Object value)Add a key/value pair to this container's Context.org.codehaus.plexus.classworlds.realm.ClassRealmcreateChildRealm(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.voiddispose()Disposes of this container, which in turn disposes all of it's components.org.codehaus.plexus.classworlds.ClassWorldgetClassWorld()<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.ComponentDiscovererManagergetComponentDiscovererManager()ComponentFactoryManagergetComponentFactoryManager()org.codehaus.plexus.classworlds.realm.ClassRealmgetComponentRealm(String realmId)ComponentRegistrygetComponentRegistry()PlexusConfigurationgetConfiguration()ConfigurationSourcegetConfigurationSource()org.codehaus.plexus.classworlds.realm.ClassRealmgetContainerRealm()Returns the Classworld's ClassRealm of this Container, which acts as the default parent for all contained components.ContextgetContext()Returns this container's context.protected ReadergetInterpolationConfigurationReader(Reader reader)LoggergetLogger()LoggerManagergetLoggerManager()org.codehaus.plexus.classworlds.realm.ClassRealmgetLookupRealm()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.ClassRealmgetLookupRealm(Object component)Utility method to get a default lookup realm for a component.booleanhasComponent(Class<?> type)Returns true if this container has a component with the given role/role-hint.booleanhasComponent(Class<?> type, String roleHint)Returns true if this container has a component with the given role/role-hint.booleanhasComponent(Class<?> type, String role, String roleHint)Returns true if this container has a component with the given role/role-hint.booleanhasComponent(String role)Returns true if this container has the keyed component.booleanhasComponent(String role, String roleHint)Returns true if this container has a component with the given role/role-hint.protected voidinitialize(ContainerConfiguration containerConfiguration)protected voidinitializeConfiguration(ContainerConfiguration c)protected voidinitializePhases(ContainerConfiguration containerConfiguration)<T> Tlookup(Class<T> type)Looks up and returns a component object with the given unique key or role.<T> Tlookup(Class<T> type, String roleHint)Looks up and returns a component object with the given unique role/role-hint combination.<T> Tlookup(Class<T> type, String role, String roleHint)Looks up and returns a component object with the given unique role/role-hint combination.Objectlookup(String role)Looks up and returns a component object with the given unique key or role.Objectlookup(String role, String roleHint)Looks up and returns a component object with the given unique role/role-hint combination.<T> Tlookup(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.voidregisterComponentDiscoveryListener(ComponentDiscoveryListener listener)Adds the listener to this container.voidrelease(Object component)Releases the component from the container.voidreleaseAll(List<?> components)Releases all Listed components from the container.voidreleaseAll(Map<String,?> components)Releases all Mapped component values from the container.voidremoveComponentDiscoveryListener(ComponentDiscoveryListener listener)Removes the listener from this container.voidremoveComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)Dissociate the realm with the specified id from the container.voidsetClassWorld(org.codehaus.plexus.classworlds.ClassWorld classWorld)voidsetComponentDiscovererManager(ComponentDiscovererManager componentDiscovererManager)voidsetComponentFactoryManager(ComponentFactoryManager componentFactoryManager)voidsetComponentRegistry(ComponentRegistry componentRegistry)voidsetConfiguration(PlexusConfiguration configuration)voidsetConfigurationSource(ConfigurationSource configurationSource)voidsetContainerRealm(org.codehaus.plexus.classworlds.realm.ClassRealm containerRealm)voidsetLoggerManager(LoggerManager loggerManager)org.codehaus.plexus.classworlds.realm.ClassRealmsetLookupRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)Sets the lookup realm to use for lookup calls that don't have a ClassRealm parameter.protected voidstart()-
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:
addComponentin interfacePlexusContainer
-
addComponent
public <T> void addComponent(T component, Class<?> role, String roleHint)Description copied from interface:PlexusContainerAdds 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:
addComponentin 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:PlexusContainerSets the lookup realm to use for lookup calls that don't have a ClassRealm parameter.- Specified by:
setLookupRealmin 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:PlexusContainerReturns the lookup realm for this container, which is either the container realm or the realm set byPlexusContainer.setLookupRealm(ClassRealm).- Specified by:
getLookupRealmin interfacePlexusContainer- Returns:
ClassRealm
-
createChildRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm(String id)
- Specified by:
createChildRealmin interfacePlexusContainer
-
lookup
public Object lookup(String role) throws ComponentLookupException
Description copied from interface:PlexusContainerLooks up and returns a component object with the given unique key or role.- Specified by:
lookupin 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:PlexusContainerLooks up and returns a component object with the given unique role/role-hint combination.- Specified by:
lookupin 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:PlexusContainerLooks up and returns a component object with the given unique key or role.- Specified by:
lookupin 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:PlexusContainerLooks up and returns a component object with the given unique role/role-hint combination.- Specified by:
lookupin 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:PlexusContainerLooks up and returns a component object with the given unique role/role-hint combination.- Specified by:
lookupin 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:PlexusContainerLooks up and returns a component object matching the given component descriptor.- Specified by:
lookupin 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:PlexusContainerLooks up and returns a List of component objects with the given role.- Specified by:
lookupListin 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:PlexusContainerLooks up and returns a List of component objects with the given role.- Specified by:
lookupListin 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:PlexusContainerLooks up and returns a List of component objects with the given role.- Specified by:
lookupListin 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:PlexusContainerLooks up and returns a List of component objects with the given role.- Specified by:
lookupListin 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:PlexusContainerLooks up and returns a Map of component objects with the given role, keyed by all available role-hints.- Specified by:
lookupMapin 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:PlexusContainerLooks up and returns a Map of component objects with the given role, keyed by all available role-hints.- Specified by:
lookupMapin 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:PlexusContainerLooks up and returns a Map of component objects with the given role, keyed by all available role-hints.- Specified by:
lookupMapin 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:PlexusContainerLooks up and returns a Map of component objects with the given role, keyed by all available role-hints.- Specified by:
lookupMapin 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:PlexusContainerReturns true if this container has the keyed component.- Specified by:
hasComponentin 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:PlexusContainerReturns true if this container has a component with the given role/role-hint.- Specified by:
hasComponentin 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:PlexusContainerReturns true if this container has a component with the given role/role-hint.- Specified by:
hasComponentin 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:PlexusContainerReturns true if this container has a component with the given role/role-hint.- Specified by:
hasComponentin 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:PlexusContainerReturns true if this container has a component with the given role/role-hint.- Specified by:
hasComponentin 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:PlexusContainerReturns 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:
getComponentDescriptorin 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:PlexusContainerReturns the ComponentDescriptor with the given component role and hint. Searches up the hierarchy until one is found, null if none is found.- Specified by:
getComponentDescriptorin 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:PlexusContainerReturns the ComponentDescriptor with the given component role and hint. Searches up the hierarchy until one is found, null if none is found.- Specified by:
getComponentDescriptorin 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:PlexusContainerReturns 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:
getComponentDescriptorMapin 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:PlexusContainerReturns 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:
getComponentDescriptorMapin 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:PlexusContainerReturns 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:
getComponentDescriptorListin 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:PlexusContainerReturns 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:
getComponentDescriptorListin 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:PlexusContainerAdds a component descriptor to this container. componentDescriptor should have realmId set.- Specified by:
addComponentDescriptorin interfacePlexusContainer- Parameters:
componentDescriptor-ComponentDescriptor- Throws:
CycleDetectedInComponentGraphException- In case of an error.
-
release
public void release(Object component) throws ComponentLifecycleException
Description copied from interface:PlexusContainerReleases 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:
releasein 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:PlexusContainerReleases all Mapped component values from the container.- Specified by:
releaseAllin 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:PlexusContainerReleases all Listed components from the container.- Specified by:
releaseAllin 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:PlexusContainerDisposes of this container, which in turn disposes all of it's components. This container should also remove itself from the container hierarchy.- Specified by:
disposein interfacePlexusContainer
-
addContextValue
public void addContextValue(Object key, Object value)
Description copied from interface:PlexusContainerAdd a key/value pair to this container's Context.- Specified by:
addContextValuein 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:
getClassWorldin interfaceMutablePlexusContainer
-
setClassWorld
public void setClassWorld(org.codehaus.plexus.classworlds.ClassWorld classWorld)
-
getContainerRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm getContainerRealm()
Description copied from interface:PlexusContainerReturns the Classworld's ClassRealm of this Container, which acts as the default parent for all contained components.- Specified by:
getContainerRealmin 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:PlexusContainerReturns 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:
getContextin 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:
getLoggerin interfaceMutablePlexusContainer- Overrides:
getLoggerin classAbstractLogEnabled
-
registerComponentDiscoveryListener
public void registerComponentDiscoveryListener(ComponentDiscoveryListener listener)
Description copied from interface:PlexusContainerAdds the listener to this container. ComponentDiscoveryListeners have the ability to respond to various ComponentDiscoverer events.- Specified by:
registerComponentDiscoveryListenerin interfacePlexusContainer- Parameters:
listener- A listener which responds to different ComponentDiscoveryEvents
-
removeComponentDiscoveryListener
public void removeComponentDiscoveryListener(ComponentDiscoveryListener listener)
Description copied from interface:PlexusContainerRemoves the listener from this container.- Specified by:
removeComponentDiscoveryListenerin interfacePlexusContainer- Parameters:
listener- A listener to remove
-
getComponentRegistry
public ComponentRegistry getComponentRegistry()
- Specified by:
getComponentRegistryin interfaceMutablePlexusContainer
-
setComponentRegistry
public void setComponentRegistry(ComponentRegistry componentRegistry)
- Specified by:
setComponentRegistryin interfaceMutablePlexusContainer
-
getComponentDiscovererManager
public ComponentDiscovererManager getComponentDiscovererManager()
- Specified by:
getComponentDiscovererManagerin interfaceMutablePlexusContainer
-
setComponentDiscovererManager
public void setComponentDiscovererManager(ComponentDiscovererManager componentDiscovererManager)
- Specified by:
setComponentDiscovererManagerin interfaceMutablePlexusContainer
-
getComponentFactoryManager
public ComponentFactoryManager getComponentFactoryManager()
- Specified by:
getComponentFactoryManagerin interfaceMutablePlexusContainer
-
setComponentFactoryManager
public void setComponentFactoryManager(ComponentFactoryManager componentFactoryManager)
- Specified by:
setComponentFactoryManagerin interfaceMutablePlexusContainer
-
getConfiguration
public PlexusConfiguration getConfiguration()
- Specified by:
getConfigurationin interfaceMutablePlexusContainer
-
setConfiguration
public void setConfiguration(PlexusConfiguration configuration)
- Specified by:
setConfigurationin interfaceMutablePlexusContainer
-
getComponentRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm getComponentRealm(String realmId)
- Specified by:
getComponentRealmin interfaceMutablePlexusContainer- Specified by:
getComponentRealmin interfacePlexusContainer
-
removeComponentRealm
public void removeComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws PlexusContainerExceptionDescription copied from interface:PlexusContainerDissociate the realm with the specified id from the container. This will remove all components contained in the realm from the component repository.- Specified by:
removeComponentRealmin 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:
getLookupRealmin interfacePlexusContainer- Parameters:
component- The component.- Returns:
ClassRealm
-
setConfigurationSource
public void setConfigurationSource(ConfigurationSource configurationSource)
- Specified by:
setConfigurationSourcein interfaceMutablePlexusContainer
-
getConfigurationSource
public ConfigurationSource getConfigurationSource()
- Specified by:
getConfigurationSourcein interfaceMutablePlexusContainer
-
getLoggerManager
public LoggerManager getLoggerManager()
- Specified by:
getLoggerManagerin interfaceMutablePlexusContainer
-
setLoggerManager
public void setLoggerManager(LoggerManager loggerManager)
- Specified by:
setLoggerManagerin interfaceMutablePlexusContainer
-
discoverComponents
public List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws PlexusConfigurationException, CycleDetectedInComponentGraphException
Description copied from interface:PlexusContainerDiscovers components in the given realm.- Specified by:
discoverComponentsin 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:PlexusContainerDiscovers components in the given realm.- Specified by:
discoverComponentsin interfacePlexusContainer- Parameters:
realm- theClassRealm.data- The data.- Returns:
- list
ComponentDescriptor - Throws:
PlexusConfigurationException- in case of an error.CycleDetectedInComponentGraphException- in case of an error.
-
-