org.apache.avalon.excalibur.system
Class AbstractContainer

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLogEnabled
        |
        +--org.apache.avalon.excalibur.system.AbstractContainer
All Implemented Interfaces:
org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.LogEnabled

public abstract class AbstractContainer
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.activity.Disposable

The Container is an interface used to mark the Containers in your system. It exposes a protected getComponentManager() method so that the Container's Manager can expose that to the instantiating class.

Version:
CVS $Revision: 1.4 $ $Date: 2002/01/30 15:44:06 $
Author:
Berin Loritsch

Inner Class Summary
protected static class AbstractContainer.ContainerComponentManager
          This is the Default ComponentManager for the Container.
protected static class AbstractContainer.ContainerComponentSelector
          This is the Default ComponentSelector for the Container.
 
Constructor Summary
AbstractContainer()
           
 
Method Summary
protected  void assignHandler(ComponentHandler handler, org.apache.avalon.framework.configuration.Configuration config, java.util.Map managerMap)
          Adds the ComponentHandler and Configuration to the system.
protected  void assignSelector(java.lang.String role, org.apache.avalon.framework.component.ComponentSelector selector, java.util.Map managerMap)
          Adds the ComponentHandler and Configuration to the system.
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
          Root ComponentManager.
 void configure(org.apache.avalon.framework.configuration.Configuration configElement)
          Process the configuration and set up the components and their mappings.
 void contextualize(org.apache.avalon.framework.context.Context containerContext)
          Pull the manager items from the context so we can use them to set up the system.
 void dispose()
          Disposes of all components and frees resources that they consume.
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
          Wrap this so that ComponentStateValidator functions properly.
protected  ComponentHandler getHandler(java.lang.Class handlerKlass, java.lang.Class klass, org.apache.avalon.framework.configuration.Configuration configuration)
          Get a ComponentHandler with the standard HANDLER_CONSTRUCTOR for the component class passed in.
protected  void handleConfiguration(org.apache.avalon.framework.configuration.Configuration configItem, java.util.Map managerMap)
          Handles when a configuration name is used that is not "component", so it makes it easier to handle ComponentSelector hierarchies.
 void initialize()
          Initializes all components so that the system is ready to be used.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractContainer

public AbstractContainer()
Method Detail

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Wrap this so that ComponentStateValidator functions properly.
Overrides:
enableLogging in class org.apache.avalon.framework.logger.AbstractLogEnabled

contextualize

public void contextualize(org.apache.avalon.framework.context.Context containerContext)
                   throws org.apache.avalon.framework.context.ContextException
Pull the manager items from the context so we can use them to set up the system.
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configElement)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Process the configuration and set up the components and their mappings. At this point, all components are prepared and all mappings are made. However, nothing is initialized.
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable

handleConfiguration

protected void handleConfiguration(org.apache.avalon.framework.configuration.Configuration configItem,
                                   java.util.Map managerMap)
                            throws org.apache.avalon.framework.configuration.ConfigurationException
Handles when a configuration name is used that is not "component", so it makes it easier to handle ComponentSelector hierarchies. It is meant to either return a ComponentHandler or a ComponentSelector

assignHandler

protected void assignHandler(ComponentHandler handler,
                             org.apache.avalon.framework.configuration.Configuration config,
                             java.util.Map managerMap)
                      throws org.apache.avalon.framework.configuration.ConfigurationException
Adds the ComponentHandler and Configuration to the system.

assignSelector

protected void assignSelector(java.lang.String role,
                              org.apache.avalon.framework.component.ComponentSelector selector,
                              java.util.Map managerMap)
                       throws org.apache.avalon.framework.configuration.ConfigurationException
Adds the ComponentHandler and Configuration to the system.

getHandler

protected ComponentHandler getHandler(java.lang.Class handlerKlass,
                                      java.lang.Class klass,
                                      org.apache.avalon.framework.configuration.Configuration configuration)
Get a ComponentHandler with the standard HANDLER_CONSTRUCTOR for the component class passed in.

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
             throws org.apache.avalon.framework.component.ComponentException
Root ComponentManager. The Container may choose to have it's ComponentManager delegate to the root manager, or it may choose to be entirely self contained.
Specified by:
compose in interface org.apache.avalon.framework.component.Composable

initialize

public void initialize()
                throws java.lang.Exception
Initializes all components so that the system is ready to be used.
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable

dispose

public void dispose()
Disposes of all components and frees resources that they consume.
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.