|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PlexusContainer
PlexusContainer is the entry-point for loading and accessing other components.
Field Summary | |
---|---|
static java.lang.String |
ROLE
|
Method Summary | |
---|---|
void |
addComponent(java.lang.Object component,
java.lang.String role)
|
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. |
void |
addJarRepository(java.io.File repository)
Adds a directory of jar resources. |
void |
addJarResource(java.io.File resource)
Adds a jar to this container's ClassRealm - whose components are then discovered (via the various registered ComponentDiscoverer's). |
org.codehaus.plexus.classworlds.realm.ClassRealm |
createChildRealm(java.lang.String id)
|
java.util.List<ComponentDescriptor> |
discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm childRealm,
boolean override)
Discovers components in the given realm. |
void |
dispose()
Disposes of this container, which in turn disposes all of it's components. |
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,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
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. |
ComponentDescriptor |
getComponentDescriptor(java.lang.String role,
java.lang.String roleHint,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Returns the ComponentDescriptor with the given component role and hint. |
java.util.List<ComponentDescriptor> |
getComponentDescriptorList(java.lang.String role)
Returns a List of ComponentDescriptors with the given role. |
java.util.List<ComponentDescriptor> |
getComponentDescriptorList(java.lang.String role,
org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
Returns a List of ComponentDescriptors with the given role. |
java.util.List<ComponentDescriptor> |
getComponentDescriptorList(java.lang.String role,
java.util.List<java.lang.String> roleHints,
org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
Returns a List of ComponentDescriptors with the given role in a requested order driven by roleHints list. |
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. |
java.util.Map<java.lang.String,ComponentDescriptor> |
getComponentDescriptorMap(java.lang.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(java.lang.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. |
java.util.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(java.lang.Object component)
XXX ideally i'd like to place this in a plexus container specific utility class. |
java.lang.String |
getName()
Returns the unique name of this container. |
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. |
java.lang.Object |
lookup(java.lang.Class role)
Looks up and returns a component object with the given unique key or role. |
java.lang.Object |
lookup(java.lang.Class role,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a component object with the given unique key or role. |
java.lang.Object |
lookup(java.lang.Class role,
java.lang.String roleHint)
Looks up and returns a component object with the given unique role/role-hint combination. |
java.lang.Object |
lookup(java.lang.Class role,
java.lang.String roleHint,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a component object with the given unique role/role-hint combination. |
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,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
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. |
java.lang.Object |
lookup(java.lang.String role,
java.lang.String roleHint,
org.codehaus.plexus.classworlds.realm.ClassRealm realm)
Looks up and returns a component object with the given unique role/role-hint combination. |
java.util.List<java.lang.Object> |
lookupList(java.lang.Class role)
Looks up and returns a List of component objects with the given role. |
java.util.List<java.lang.Object> |
lookupList(java.lang.Class role,
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. |
java.util.Map<java.lang.String,java.lang.Object> |
lookupMap(java.lang.Class 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.Class 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. |
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<java.lang.Object> components)
Releases all Listed components from the container. |
void |
releaseAll(java.util.Map<java.lang.String,java.lang.Object> components)
Releases all Mapped component values from the container. |
void |
removeComponentDiscoveryListener(ComponentDiscoveryListener listener)
Removes the listener from this container. |
void |
removeComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
Dissociate the realm with the specified id from the container. |
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(java.lang.String name)
|
Field Detail |
---|
static final java.lang.String ROLE
Method Detail |
---|
java.lang.String getName()
java.util.Date getCreationDate()
java.lang.Object lookup(java.lang.String role) throws ComponentLookupException
role
- a unique key for the desired component
ComponentLookupException
java.lang.Object lookup(java.lang.String role, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a unique key for the desired component
ComponentLookupException
java.lang.Object lookup(java.lang.String role, java.lang.String roleHint) throws ComponentLookupException
role
- a non-unique key for the desired componentroleHint
- a hint for the desired component implementation
ComponentLookupException
java.lang.Object lookup(java.lang.String role, java.lang.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
java.lang.Object lookup(java.lang.Class role) throws ComponentLookupException
role
- a unique key for the desired component
ComponentLookupException
java.lang.Object lookup(java.lang.Class role, org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLookupException
role
- a unique key for the desired component
ComponentLookupException
java.lang.Object lookup(java.lang.Class role, java.lang.String roleHint) throws ComponentLookupException
role
- a non-unique class key for the desired componentroleHint
- a hint for the desired component implementation
ComponentLookupException
java.lang.Object lookup(java.lang.Class role, java.lang.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
java.util.List<java.lang.Object> lookupList(java.lang.String role) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
java.util.List<java.lang.Object> lookupList(java.lang.String role, java.util.List<java.lang.String> roleHints) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
java.util.List<java.lang.Object> lookupList(java.lang.Class role) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
java.util.List<java.lang.Object> lookupList(java.lang.Class role, java.util.List<java.lang.String> roleHints) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
java.util.Map<java.lang.String,java.lang.Object> lookupMap(java.lang.String role) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
java.util.Map<java.lang.String,java.lang.Object> lookupMap(java.lang.String role, java.util.List<java.lang.String> roleHints) throws ComponentLookupException
role
- a non-unique key for the desired components
ComponentLookupException
java.util.Map<java.lang.String,java.lang.Object> lookupMap(java.lang.Class role) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
java.util.Map<java.lang.String,java.lang.Object> lookupMap(java.lang.Class role, java.util.List<java.lang.String> roleHints) throws ComponentLookupException
role
- a non-unique class key for the desired components
ComponentLookupException
ComponentDescriptor getComponentDescriptor(java.lang.String role)
role
- a unique role for the desired component's descriptor
ComponentDescriptor getComponentDescriptor(java.lang.String role, java.lang.String roleHint)
role
- a unique role for the desired component's descriptorroleHint
- a hint showing which implementation should be used
ComponentDescriptor getComponentDescriptor(java.lang.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(java.lang.String role, java.lang.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
java.util.Map<java.lang.String,ComponentDescriptor> getComponentDescriptorMap(java.lang.String role)
role
- a non-unique key for the desired components
java.util.Map<java.lang.String,ComponentDescriptor> getComponentDescriptorMap(java.lang.String role, org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
role
- a non-unique key for the desired components
java.util.List<ComponentDescriptor> getComponentDescriptorList(java.lang.String role)
role
- a non-unique key for the desired components
java.util.List<ComponentDescriptor> getComponentDescriptorList(java.lang.String role, org.codehaus.plexus.classworlds.realm.ClassRealm componentRealm)
role
- a non-unique key for the desired components
java.util.List<ComponentDescriptor> getComponentDescriptorList(java.lang.String role, java.util.List<java.lang.String> roleHints, 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(java.lang.Object component) throws ComponentLifecycleException
component
- the plexus component object to release
ComponentLifecycleException
void releaseAll(java.util.Map<java.lang.String,java.lang.Object> components) throws ComponentLifecycleException
components
- Map of plexus component objects to release
ComponentLifecycleException
release( Object component )
void releaseAll(java.util.List<java.lang.Object> components) throws ComponentLifecycleException
components
- List of plexus component objects to release
ComponentLifecycleException
release( Object component )
boolean hasComponent(java.lang.String role)
role
-
boolean hasComponent(java.lang.String role, java.lang.String roleHint)
role
- roleHint
-
void dispose()
void addContextValue(java.lang.Object key, java.lang.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 removejava.util.List<ComponentDescriptor> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm childRealm, boolean override) throws PlexusConfigurationException, ComponentRepositoryException
childRealm
- override
- wheter to override/merge any conflicting components, where the new component takes precedence.
PlexusConfigurationException
ComponentRepositoryException
void addJarRepository(java.io.File repository)
repository
- a directory containing JAR filesaddJarResource(File)
void addJarResource(java.io.File resource) throws PlexusContainerException
resource
- a JAR file
PlexusContainerException
void setLoggerManager(LoggerManager loggerManager)
LoggerManager getLoggerManager()
Logger getLogger()
void setName(java.lang.String name)
org.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm(java.lang.String id)
org.codehaus.plexus.classworlds.realm.ClassRealm getComponentRealm(java.lang.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(java.lang.Object component)
component
-
void addComponent(java.lang.Object component, java.lang.String role) throws ComponentRepositoryException
ComponentRepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |