|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PlexusContainer
The core component of Plexus. This is the entry-point for loading and accessing other components, as well as an element in a hierarchy of containers. A Plexus Container can also itself be a component, however, the hierarchy must be bootstrapped by a PlexusContainer implementation.
Field Summary | |
---|---|
static String |
ROLE
|
Method Summary | |
---|---|
void |
addComponent(Object component,
String role)
|
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. |
void |
addJarRepository(File repository)
Adds a directory of jar resources. |
void |
addJarResource(File resource)
Adds a jar to this container's ClassRealm - whose components are then discovered (via the various registered ComponentDiscoverer's). |
PlexusContainer |
createChildContainer(String name,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
|
PlexusContainer |
createChildContainer(String name,
Set urls)
|
org.codehaus.plexus.classworlds.realm.ClassRealm |
createComponentRealm(String id,
List jars)
Creates and returns a new class realm under this container's realm for the given list of jars. |
void |
dispose()
Disposes of this container, which in turn disposes all of it's components. |
PlexusContainer |
getChildContainer(String name)
Returns a child container with the unique name. |
ComponentDescriptor |
getComponentDescriptor(String role)
Returns the ComponentDescriptor with the given component role and the default role hint. |
ComponentDescriptor |
getComponentDescriptor(String role,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
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. |
ComponentDescriptor |
getComponentDescriptor(String role,
String roleHint,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Returns the ComponentDescriptor with the given component role and hint. |
List |
getComponentDescriptorList(String role)
Returns a List of ComponentDescriptors with the given role. |
List |
getComponentDescriptorList(String role,
org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
Returns a List of ComponentDescriptors with the given role. |
Map |
getComponentDescriptorMap(String role)
Returns a Map of ComponentDescriptors with the given role, keyed by role-hint. |
Map |
getComponentDescriptorMap(String role,
org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
Returns a Map of ComponentDescriptors with the given role, keyed by role-hint. |
org.codehaus.plexus.classworlds.realm.ClassRealm |
getComponentRealm(String realmId)
|
org.codehaus.plexus.classworlds.realm.ClassRealm |
getContainerRealm()
Returns the Classworld's ClassRealm of this Container, which acts as the default parent for all contained components. |
Context |
getContext()
Returns this container's context. |
Date |
getCreationDate()
Returns the date this container was created. |
Logger |
getLogger()
Deprecated. |
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 setLookupRealm(ClassRealm) . |
org.codehaus.plexus.classworlds.realm.ClassRealm |
getLookupRealm(Object component)
XXX ideally i'd like to place this in a plexus container specific utility class. |
String |
getName()
Returns the unique name of this container in the container hierarchy. |
boolean |
hasChildContainer(String name)
Returns true if this container has a child with the given name. |
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. |
boolean |
isReloadingEnabled()
Returns true if a component's metadata may be reloaded, otherwise, it may be loaded only once. |
Object |
lookup(Class componentClass)
Looks up and returns a component object with the given unique key or role. |
Object |
lookup(Class componentClass,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a component object with the given unique key or role. |
Object |
lookup(Class role,
String roleHint)
Looks up and returns a component object with the given unique role/role-hint combination. |
Object |
lookup(Class role,
String roleHint,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a component object with the given unique role/role-hint combination. |
Object |
lookup(String componentKey)
Looks up and returns a component object with the given unique key or role. |
Object |
lookup(String componentKey,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
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. |
Object |
lookup(String role,
String roleHint,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a component object with the given unique role/role-hint combination. |
List |
lookupList(Class role)
Looks up and returns a List of component objects with the given role. |
List |
lookupList(Class role,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a List of component objects with the given role. |
List |
lookupList(Class role,
List roles)
Looks up and returns a List of component objects with the given role. |
List |
lookupList(Class role,
List roles,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a List of component objects with the given role. |
List |
lookupList(String role)
Looks up and returns a List of component objects with the given role. |
List |
lookupList(String role,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a List of component objects with the given role. |
List |
lookupList(String role,
List roles)
Looks up and returns a List of component objects with the given role. |
List |
lookupList(String role,
List roles,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a List of component objects with the given role. |
Map |
lookupMap(Class role)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
Map |
lookupMap(Class role,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
Map |
lookupMap(Class role,
List roles)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
Map |
lookupMap(Class role,
List roles,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
Map |
lookupMap(String role)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
Map |
lookupMap(String role,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
Map |
lookupMap(String role,
List roles)
Looks up and returns a Map of component objects with the given role, keyed by all available role-hints. |
Map |
lookupMap(String role,
List roles,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
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 components)
Releases all Mapped component values from the container. |
void |
removeChildContainer(String name)
Removes the keyed child from this container. |
void |
removeComponentDiscoveryListener(ComponentDiscoveryListener listener)
Removes the listener from this container. |
void |
removeComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
Dissociate the realm with the specified id from the container. |
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. |
void |
setName(String name)
|
void |
setParentPlexusContainer(PlexusContainer container)
Sets the parent of this container. |
void |
setReloadingEnabled(boolean reloadingEnabled)
Sets the ability to reload a component's metadata multiple times. |
Field Detail |
---|
static final String ROLE
Method Detail |
---|
String getName()
Date getCreationDate()
boolean hasChildContainer(String name)
name
- a key unique amongst this container's children
void removeChildContainer(String name)
name
- a key unique amongst this container's childrenPlexusContainer getChildContainer(String name)
name
- a key unique amongst this container's children
Object lookup(String componentKey) throws ComponentLookupException
componentKey
- a unique key for the desired component
ComponentLookupException
Object lookup(String componentKey, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
componentKey
- a unique key for the desired component
ComponentLookupException
Object lookup(String role, String roleHint) throws ComponentLookupException
role
- a non-unique key for the desired componentroleHint
- a hint for the desired component implementation
ComponentLookupException
Object lookup(String role, String roleHint, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a non-unique key for the desired componentroleHint
- a hint for the desired component implementation
ComponentLookupException
Object lookup(Class componentClass) throws ComponentLookupException
componentClass
- a unique key for the desired component
ComponentLookupException
Object lookup(Class componentClass, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
componentClass
- a unique key for the desired component
ComponentLookupException
Object lookup(Class role, String roleHint) throws ComponentLookupException
role
- a non-unique class key for the desired componentroleHint
- a hint for the desired component implementation
ComponentLookupException
Object lookup(Class role, String roleHint, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a non-unique class key for the desired componentroleHint
- a hint for the desired component implementation
ComponentLookupException
List lookupList(String role) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
List lookupList(String role, List roles) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
List lookupList(String role, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
List lookupList(String role, List roles, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
List lookupList(Class role, List roles) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
List lookupList(Class role) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
List lookupList(Class role, List roles, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
List lookupList(Class role, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
Map lookupMap(String role, List roles) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
Map lookupMap(String role) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
Map lookupMap(String role, List roles, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
Map lookupMap(String role, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
Map lookupMap(Class role, List roles) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
Map lookupMap(Class role) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
Map lookupMap(Class role, List roles, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
Map lookupMap(Class role, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
ComponentDescriptor getComponentDescriptor(String role)
role
- a unique role for the desired component's descriptor
ComponentDescriptor getComponentDescriptor(String role, String roleHint)
role
- a unique role for the desired component's descriptorroleHint
- a hint showing which implementation should be used
ComponentDescriptor getComponentDescriptor(String role, org.codehaus.plexus.classworlds.realm.ClassRealm realm)
role
- a unique role for the desired component's descriptorrealm
- The class realm to search
ComponentDescriptor getComponentDescriptor(String role, String roleHint, org.codehaus.plexus.classworlds.realm.ClassRealm realm)
role
- a unique role for the desired component's descriptorroleHint
- a hint showing which implementation should be usedrealm
- The class realm to search
Map getComponentDescriptorMap(String role)
role
- a non-unique key for the desired components
Map getComponentDescriptorMap(String role, org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
role
- a non-unique key for the desired components
List getComponentDescriptorList(String role)
role
- a non-unique key for the desired components
List getComponentDescriptorList(String role, org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
role
- a non-unique key for the desired components
void addComponentDescriptor(ComponentDescriptor componentDescriptor) throws ComponentRepositoryException
componentDescriptor
-
ComponentRepositoryException
void release(Object component) throws ComponentLifecycleException
component
- the plexus component object to release
ComponentLifecycleException
void releaseAll(Map components) throws ComponentLifecycleException
components
- Map of plexus component objects to release
ComponentLifecycleException
release( Object component )
void releaseAll(List components) throws ComponentLifecycleException
components
- List of plexus component objects to release
ComponentLifecycleException
release( Object component )
boolean hasComponent(String role)
role
-
boolean hasComponent(String role, String roleHint)
role
- roleHint
-
void dispose()
void addContextValue(Object key, Object value)
key
- any unique object valid to the Context's implementationvalue
- any object valid to the Context's implementationContext getContext()
org.codehaus.plexus.classworlds.realm.ClassRealm getContainerRealm()
void registerComponentDiscoveryListener(ComponentDiscoveryListener listener)
listener
- A listener which responds to differnet ComponentDiscoveryEventsvoid removeComponentDiscoveryListener(ComponentDiscoveryListener listener)
listener
- A listener to removevoid addJarRepository(File repository)
repository
- a directory containing JAR filesaddJarResource(File)
void addJarResource(File resource) throws PlexusContainerException
resource
- a JAR file
PlexusContainerException
void setReloadingEnabled(boolean reloadingEnabled)
reloadingEnabled
- true is a component may be reloadedboolean isReloadingEnabled()
void setLoggerManager(LoggerManager loggerManager)
LoggerManager getLoggerManager()
Logger getLogger()
void setName(String name)
void setParentPlexusContainer(PlexusContainer container)
container
- the parent of this container, null if nonePlexusContainer createChildContainer(String name, Set urls) throws PlexusContainerException
PlexusContainerException
PlexusContainer createChildContainer(String name, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws PlexusContainerException
PlexusContainerException
org.codehaus.plexus.classworlds.realm.ClassRealm createComponentRealm(String id, List jars) throws PlexusContainerException
id
- unique key for the ClassRealmjars
- list of JARs to place in the realm.
PlexusContainerException
addJarResource(File)
org.codehaus.plexus.classworlds.realm.ClassRealm getComponentRealm(String realmId)
void removeComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm) throws PlexusContainerException
componentRealm
- Realm to remove from the container.
PlexusContainerException
org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm()
setLookupRealm(ClassRealm)
.
org.codehaus.plexus.classworlds.realm.ClassRealm setLookupRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
realm
- the new realm to use.
org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm(Object component)
component
-
void addComponent(Object component, String role) throws ComponentRepositoryException
ComponentRepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |