org.codehaus.plexus
Class DefaultPlexusContainer

java.lang.Object
  extended byorg.codehaus.plexus.logging.AbstractLogEnabled
      extended byorg.codehaus.plexus.DefaultPlexusContainer
All Implemented Interfaces:
LogEnabled, PlexusContainer

public class DefaultPlexusContainer
extends AbstractLogEnabled
implements PlexusContainer


Field Summary
private  XmlPullConfigurationBuilder builder
           
private  java.lang.ClassLoader classLoader
           
private  org.codehaus.classworlds.ClassWorld classWorld
           
private  ComponentComposer componentComposer
           
private  ComponentConfigurator componentConfigurator
           
private  ComponentManagerManager componentManagerManager
           
private  java.util.Map componentManagers
           
private  java.util.Map componentManagersByComponentClass
           
private  ComponentRepository componentRepository
           
private  PlexusConfiguration configuration
           
private  java.io.Reader configurationReader
           
private  DefaultContext context
           
private  PlexusConfiguration defaultConfiguration
           
private  LifecycleHandlerManager lifecycleHandlerManager
           
private  LoggerManager loggerManager
           
static java.lang.String LOGGING_TAG
           
private  PlexusConfiguration mergedConfiguration
           
private  DefaultResourceManager resourceManager
           
 
Fields inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
 
Fields inherited from interface org.codehaus.plexus.PlexusContainer
ROLE
 
Constructor Summary
DefaultPlexusContainer()
           
 
Method Summary
 void addContextValue(java.lang.Object key, java.lang.Object value)
           
 void dispose()
           
protected  void disposeAllComponents()
           
protected  ComponentManager findComponentManager(java.lang.Object component)
           
 java.lang.ClassLoader getClassLoader()
           
private  org.codehaus.classworlds.ClassWorld getClassWorld()
           
 ComponentDescriptor getComponentDescriptor(java.lang.String role)
           
 java.util.Map getComponentDescriptorMap(java.lang.String role)
           
(package private)  ComponentManager getComponentManager(java.lang.String componentKey)
           
(package private)  java.util.Map getComponentManagers()
           
private  PlexusConfiguration getConfiguration()
           
private  java.io.Reader getConfigurationReader()
           
private  DefaultContext getContext()
           
private  PlexusConfiguration getDefaultConfiguration()
           
private  java.io.Reader getInterpolationConfigurationReader(java.io.Reader reader)
           
private  LoggerManager getLoggerManager()
           
private  PlexusConfiguration getMergedConfiguration()
           
 boolean hasComponent(java.lang.String componentKey)
           
 boolean hasComponent(java.lang.String role, java.lang.String id)
           
 void initialize()
           
private  void initializeClassLoader()
           
private  void initializeComponentComposer()
           
private  void initializeComponentConfigurator()
           
private  void initializeComponentManagerManager()
           
private  void initializeComponentRepository()
           
private  void initializeConfiguration()
           
private  void initializeContext()
           
private  void initializeDefaultConfiguration()
           
private  void initializeLifecycleHandlerManager()
           
private  void initializeLoggerManager()
           
private  void initializeResourceManager()
           
private  void initializeSystemProperties()
          Initialize system properties.
 ComponentManager instantiateComponentManager(ComponentDescriptor descriptor)
           
protected  void loadOnStart()
          Load specifies roles during server startup.
 java.lang.Object lookup(java.lang.String componentKey)
           
 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)
           
private  void processConfigurationsDirectory()
          Process any additional component configuration files that have been specified.
 void release(java.lang.Object component)
           
 void releaseAll(java.util.List components)
           
 void releaseAll(java.util.Map components)
           
 void resume(java.lang.Object component)
           
 void setClassLoader(java.lang.ClassLoader classLoader)
           
 void setClassWorld(org.codehaus.classworlds.ClassWorld classWorld)
           
private  void setComponentRepository(ComponentRepository componentRepository)
           
private  void setConfiguration(PlexusConfiguration configuration)
           
 void setConfigurationResource(java.io.Reader configuration)
           
private  void setDefaultConfiguration(PlexusConfiguration defaultConfiguration)
           
private  void setLoggerManager(LoggerManager loggerManager)
           
private  void setResourceManager(DefaultResourceManager resourceManager)
           
 void start()
           
 void suspend(java.lang.Object component)
           
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loggerManager

private LoggerManager loggerManager

context

private DefaultContext context

componentRepository

private ComponentRepository componentRepository

configuration

private PlexusConfiguration configuration

defaultConfiguration

private PlexusConfiguration defaultConfiguration

mergedConfiguration

private PlexusConfiguration mergedConfiguration

configurationReader

private java.io.Reader configurationReader

classWorld

private org.codehaus.classworlds.ClassWorld classWorld

classLoader

private java.lang.ClassLoader classLoader

resourceManager

private DefaultResourceManager resourceManager

builder

private XmlPullConfigurationBuilder builder

LOGGING_TAG

public static final java.lang.String LOGGING_TAG
See Also:
Constant Field Values

componentConfigurator

private ComponentConfigurator componentConfigurator

componentComposer

private ComponentComposer componentComposer

componentManagerManager

private ComponentManagerManager componentManagerManager

componentManagers

private java.util.Map componentManagers

componentManagersByComponentClass

private java.util.Map componentManagersByComponentClass

lifecycleHandlerManager

private LifecycleHandlerManager lifecycleHandlerManager
Constructor Detail

DefaultPlexusContainer

public DefaultPlexusContainer()
Method Detail

lookup

public java.lang.Object lookup(java.lang.String componentKey)
                        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

lookup

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

getComponentDescriptorMap

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

getComponentDescriptor

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

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

hasComponent

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

hasComponent

public boolean hasComponent(java.lang.String role,
                            java.lang.String id)
Specified by:
hasComponent 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

release

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

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

dispose

public void dispose()
Specified by:
dispose in interface PlexusContainer

disposeAllComponents

protected void disposeAllComponents()

addContextValue

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

setClassLoader

public void setClassLoader(java.lang.ClassLoader classLoader)

setClassWorld

public void setClassWorld(org.codehaus.classworlds.ClassWorld classWorld)

setConfigurationResource

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

getClassLoader

public java.lang.ClassLoader getClassLoader()

loadOnStart

protected void loadOnStart()
                    throws java.lang.Exception
Load specifies roles during server startup.

Throws:
java.lang.Exception

initializeClassLoader

private void initializeClassLoader()
                            throws java.lang.Exception
Throws:
java.lang.Exception

initializeContext

private void initializeContext()

initializeDefaultConfiguration

private void initializeDefaultConfiguration()
                                     throws java.lang.Exception
Throws:
java.lang.Exception

initializeConfiguration

private void initializeConfiguration()
                              throws java.lang.Exception
Throws:
java.lang.Exception

getInterpolationConfigurationReader

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

processConfigurationsDirectory

private void processConfigurationsDirectory()
                                     throws java.lang.Exception
Process any additional component configuration files that have been specified. The specified directory is scanned recursively so configurations can be within nested directories to help with component organization.

Throws:
java.lang.Exception

getMergedConfiguration

private PlexusConfiguration getMergedConfiguration()
                                            throws java.lang.Exception
Throws:
java.lang.Exception

initializeLoggerManager

private void initializeLoggerManager()
                              throws java.lang.Exception
Throws:
java.lang.Exception

initializeComponentRepository

private void initializeComponentRepository()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

initializeResourceManager

private void initializeResourceManager()
                                throws java.lang.Exception
Throws:
java.lang.Exception

initializeSystemProperties

private void initializeSystemProperties()
                                 throws java.lang.Exception
Initialize system properties. If the application needs to setup any system properties than they will be initialized here.

Throws:
java.lang.Exception

setLoggerManager

private void setLoggerManager(LoggerManager loggerManager)

getLoggerManager

private LoggerManager getLoggerManager()

getConfiguration

private PlexusConfiguration getConfiguration()

setConfiguration

private void setConfiguration(PlexusConfiguration configuration)

getConfigurationReader

private java.io.Reader getConfigurationReader()

setResourceManager

private void setResourceManager(DefaultResourceManager resourceManager)

getContext

private DefaultContext getContext()

setComponentRepository

private void setComponentRepository(ComponentRepository componentRepository)

getDefaultConfiguration

private PlexusConfiguration getDefaultConfiguration()

setDefaultConfiguration

private void setDefaultConfiguration(PlexusConfiguration defaultConfiguration)

getClassWorld

private org.codehaus.classworlds.ClassWorld getClassWorld()

initializeComponentConfigurator

private void initializeComponentConfigurator()
                                      throws java.lang.Exception
Throws:
java.lang.Exception

initializeComponentComposer

private void initializeComponentComposer()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

initializeComponentManagerManager

private void initializeComponentManagerManager()
                                        throws java.lang.Exception
Throws:
java.lang.Exception

instantiateComponentManager

public ComponentManager instantiateComponentManager(ComponentDescriptor descriptor)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

getComponentManagers

java.util.Map getComponentManagers()

getComponentManager

ComponentManager getComponentManager(java.lang.String componentKey)

findComponentManager

protected ComponentManager findComponentManager(java.lang.Object component)

initializeLifecycleHandlerManager

private void initializeLifecycleHandlerManager()
                                        throws java.lang.Exception
Throws:
java.lang.Exception