org.apache.avalon.fortress.impl
Class DefaultContainer

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.fortress.impl.AbstractContainer
          extended byorg.apache.avalon.fortress.impl.DefaultContainer
All Implemented Interfaces:
Configurable, Container, Contextualizable, Disposable, Initializable, LogEnabled, Serviceable
Direct Known Subclasses:
ComponentViewer, DefaultECMContainer, ExtendedContainer, FortressAdapter, ServletContainer, SwingContainer

public class DefaultContainer
extends AbstractContainer
implements Configurable

This is the default implementation of Container, adding configuration markup semantics to the AbstractContainer.

Version:
CVS $Revision: 1.17 $ $Date: 2004/02/28 15:16:24 $
Author:
The Avalon Team

Field Summary
 
Fields inherited from class org.apache.avalon.fortress.impl.AbstractContainer
DEFAULT_ENTRY, m_classLoader, m_commandSink, m_componentContext, m_components, m_context, m_extManager, m_instrumentManager, m_loggerManager, m_mapper, m_metaManager, m_poolManager, m_serviceManager, m_shutDownOrder, SELECTOR_ENTRY
 
Fields inherited from interface org.apache.avalon.fortress.Container
ROLE
 
Constructor Summary
DefaultContainer()
           
 
Method Summary
 void configure(Configuration config)
          Process the configuration and set up the components and their mappings.
 ServiceManager getServiceManager()
          Return the ServiceManager that exposes all the services in impl.
protected  void interpretProxy(java.lang.String proxyType)
          Interpret the ProxyManager type from the configuration element.
 
Methods inherited from class org.apache.avalon.fortress.impl.AbstractContainer
addComponent, contextualize, createHintMap, createObjectFactory, dispose, get, getProxyManager, getRoleKey, has, initialize, provideComponentContext, provideServiceManager, service, setProxyManager
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultContainer

public DefaultContainer()
Method Detail

configure

public void configure(Configuration config)
               throws 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.

The configuration format follows a specific convention:

Please note: each configuration element must have a unique id. If a configuration element does not have a unique id, it will not be treated as a component. This id is used later as a hint when there is more than one implementation of a role.

The first component encourted which implements a specific role becomes the default implemenation of that role. This can be changed by the default attribute in this configuration.

   <my-config>
     <component id="default-connection"
                   class="org.apache.avalon.excalibur.datasource.JdbcDataSourceComponent">

       <!-- Component specific configuration -->

     </component>
 
     <jdbc-data-source id="another-connection">

         <!-- Component specific configuration -->

     </jdbc-data-source>
   </my-config>
 

Specified by:
configure in interface Configurable
Parameters:
config - The configuration element to translate into the list of components this impl managers.
Throws:
ConfigurationException - if the configuration is not valid

interpretProxy

protected void interpretProxy(java.lang.String proxyType)
                       throws ConfigurationException
Interpret the ProxyManager type from the configuration element.

Parameters:
proxyType -
Throws:
ConfigurationException

getServiceManager

public ServiceManager getServiceManager()
Return the ServiceManager that exposes all the services in impl.

Overrides:
getServiceManager in class AbstractContainer
Returns:
the ServiceManager that exposes all the services in impl.


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.