org.codehaus.plexus
Class ComponentPlexusContainer

java.lang.Object
  extended byorg.codehaus.plexus.ComponentPlexusContainer
All Implemented Interfaces:
PlexusContainer

public final class ComponentPlexusContainer
extends java.lang.Object
implements PlexusContainer

Implementation of the PlexusContainer interface that can be used as a component inside another container instance. Currently uses the Avalon lifecycle methods.

Version:
$Revision: 1.14 $
Author:
Mark Wilkinson

Field Summary
private  java.lang.String configurationName
           
static java.lang.String CONTEXT_VALUE
          Configuration element name: Plexus context setting.
static java.lang.String CONTEXT_VALUE_NAME
          Configuration element name: Plexus context setting name.
static java.lang.String CONTEXT_VALUE_VALUE
          Configuration element name: Plexus context setting value.
private  DefaultPlexusContainer myPlexus
          Our own PlexusContainer.
private  PlexusContainer parentPlexus
          Parent PlexusContainer.
static java.lang.String PLEXUS_CONFIG
          Configuration element name: Plexus configuration resource.
 
Fields inherited from interface org.codehaus.plexus.PlexusContainer
ROLE
 
Constructor Summary
ComponentPlexusContainer()
           
 
Method Summary
 void addContextValue(java.lang.Object key, java.lang.Object value)
           
 void configure(PlexusConfiguration configuration)
           
 void contextualize(Context context)
           
 void dispose()
           
 java.lang.ClassLoader getClassLoader()
           
 ComponentDescriptor getComponentDescriptor(java.lang.String s)
           
 java.util.Map getComponentDescriptorMap(java.lang.String s)
           
 boolean hasComponent(java.lang.String role)
           
 boolean hasComponent(java.lang.String role, java.lang.String id)
           
 void initialize()
           
 java.lang.Object lookup(java.lang.String role)
           
 java.lang.Object lookup(java.lang.String role, java.lang.String id)
           
 java.util.List lookupList(java.lang.String role)
           
 java.util.Map lookupMap(java.lang.String role)
           
 void release(java.lang.Object service)
           
 void releaseAll(java.util.List components)
           
 void releaseAll(java.util.Map components)
           
 void resume(java.lang.Object component)
           
 void setConfigurationResource(java.io.Reader configuration)
           
 void start()
           
 void stop()
           
 void suspend(java.lang.Object component)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLEXUS_CONFIG

public static final java.lang.String PLEXUS_CONFIG
Configuration element name: Plexus configuration resource.

See Also:
Constant Field Values

CONTEXT_VALUE

public static final java.lang.String CONTEXT_VALUE
Configuration element name: Plexus context setting.

See Also:
Constant Field Values

CONTEXT_VALUE_NAME

public static final java.lang.String CONTEXT_VALUE_NAME
Configuration element name: Plexus context setting name.

See Also:
Constant Field Values

CONTEXT_VALUE_VALUE

public static final java.lang.String CONTEXT_VALUE_VALUE
Configuration element name: Plexus context setting value.

See Also:
Constant Field Values

parentPlexus

private PlexusContainer parentPlexus
Parent PlexusContainer. That is, the PlexusContainer that this component is in.


myPlexus

private DefaultPlexusContainer myPlexus
Our own PlexusContainer.


configurationName

private java.lang.String configurationName
Constructor Detail

ComponentPlexusContainer

public ComponentPlexusContainer()
Method Detail

getComponentDescriptorMap

public java.util.Map getComponentDescriptorMap(java.lang.String s)
Specified by:
getComponentDescriptorMap in interface PlexusContainer

getComponentDescriptor

public ComponentDescriptor getComponentDescriptor(java.lang.String s)
Specified by:
getComponentDescriptor in interface PlexusContainer

lookup

public java.lang.Object lookup(java.lang.String role)
                        throws ComponentLookupException
Specified by:
lookup in interface PlexusContainer
Throws:
ComponentLookupException

lookupMap

public java.util.Map lookupMap(java.lang.String role)
                        throws ComponentLookupException
Specified by:
lookupMap in interface PlexusContainer
Throws:
ComponentLookupException

lookupList

public java.util.List lookupList(java.lang.String role)
                          throws ComponentLookupException
Specified by:
lookupList in interface PlexusContainer
Throws:
ComponentLookupException

releaseAll

public void releaseAll(java.util.Map components)
Specified by:
releaseAll in interface PlexusContainer

releaseAll

public void releaseAll(java.util.List components)
Specified by:
releaseAll in interface PlexusContainer

lookup

public java.lang.Object lookup(java.lang.String role,
                               java.lang.String id)
                        throws ComponentLookupException
Specified by:
lookup in interface PlexusContainer
Throws:
ComponentLookupException

hasComponent

public boolean hasComponent(java.lang.String role)
Specified by:
hasComponent in interface PlexusContainer

hasComponent

public boolean hasComponent(java.lang.String role,
                            java.lang.String id)
Specified by:
hasComponent in interface PlexusContainer

release

public void release(java.lang.Object service)
Specified by:
release in interface PlexusContainer

suspend

public void suspend(java.lang.Object component)
Specified by:
suspend in interface PlexusContainer

resume

public void resume(java.lang.Object component)
Specified by:
resume in interface PlexusContainer

addContextValue

public void addContextValue(java.lang.Object key,
                            java.lang.Object value)
Specified by:
addContextValue in interface PlexusContainer

setConfigurationResource

public void setConfigurationResource(java.io.Reader configuration)
                              throws PlexusConfigurationResourceException
Specified by:
setConfigurationResource in interface PlexusContainer
Throws:
PlexusConfigurationResourceException

getClassLoader

public java.lang.ClassLoader getClassLoader()

contextualize

public void contextualize(Context context)
                   throws ContextException
Throws:
ContextException

configure

public void configure(PlexusConfiguration configuration)
               throws PlexusConfigurationException
Throws:
PlexusConfigurationException

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface PlexusContainer
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface PlexusContainer
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Throws:
java.lang.Exception

dispose

public void dispose()
             throws java.lang.Exception
Specified by:
dispose in interface PlexusContainer
Throws:
java.lang.Exception