org.apache.cocoon.core.container
Class AbstractServiceManager

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.core.container.AbstractServiceManager
All Implemented Interfaces:
Contextualizable, Disposable, Initializable, LogEnabled, ThreadSafe
Direct Known Subclasses:
StandaloneServiceSelector

public abstract class AbstractServiceManager
extends AbstractLogEnabled
implements Contextualizable, ThreadSafe, Disposable, Initializable

Base class for all service managers: ServiceManager and ServiceSelector

Since:
2.2
Version:
$Id: AbstractServiceManager.java 312637 2005-10-10 13:00:42Z cziegeler $

Field Summary
protected  ComponentEnvironment componentEnv
           
protected  Map componentHandlers
          Used to map roles to ComponentHandlers.
protected  Map componentMapping
          Static component mapping handlers.
protected  Context context
          The application context for components
protected  boolean disposed
          Is the Manager disposed or not?
protected  boolean initialized
          Is the Manager initialized?
protected  LoggerManager loggerManager
          LoggerManager.
protected  RoleManager roleManager
          RoleInfos.
 
Constructor Summary
AbstractServiceManager()
           
 
Method Summary
protected abstract  void addComponent(String role, Class clazz, Configuration config, ComponentInfo info)
           
protected  void addComponent(String className, String role, Configuration configuration, ComponentInfo info)
           
 void contextualize(Context context)
           
 void dispose()
           
protected  ComponentHandler getComponentHandler(String role, Class componentClass, Configuration configuration, ServiceManager serviceManager, ComponentInfo baseInfo)
          Obtain a new ComponentHandler for the specified component.
 void initialize()
           
 void setLoggerManager(LoggerManager manager)
          Configure the LoggerManager.
 void setRoleManager(RoleManager roles)
           
 
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
 

Field Detail

context

protected Context context
The application context for components


componentMapping

protected final Map componentMapping
Static component mapping handlers.


componentHandlers

protected final Map componentHandlers
Used to map roles to ComponentHandlers.


disposed

protected boolean disposed
Is the Manager disposed or not?


initialized

protected boolean initialized
Is the Manager initialized?


roleManager

protected RoleManager roleManager
RoleInfos.


loggerManager

protected LoggerManager loggerManager
LoggerManager.


componentEnv

protected ComponentEnvironment componentEnv
Constructor Detail

AbstractServiceManager

public AbstractServiceManager()
Method Detail

contextualize

public void contextualize(Context context)
Specified by:
contextualize in interface Contextualizable

setRoleManager

public void setRoleManager(RoleManager roles)

setLoggerManager

public void setLoggerManager(LoggerManager manager)
Configure the LoggerManager.


getComponentHandler

protected ComponentHandler getComponentHandler(String role,
                                               Class componentClass,
                                               Configuration configuration,
                                               ServiceManager serviceManager,
                                               ComponentInfo baseInfo)
                                        throws Exception
Obtain a new ComponentHandler for the specified component.

Parameters:
role - the component's role.
componentClass - Class of the component for which the handle is being requested.
configuration - The configuration for this component.
serviceManager - The service manager which will be managing the Component.
Throws:
Exception - If there were any problems obtaining a ComponentHandler

addComponent

protected void addComponent(String className,
                            String role,
                            Configuration configuration,
                            ComponentInfo info)
                     throws ConfigurationException
Throws:
ConfigurationException

addComponent

protected abstract void addComponent(String role,
                                     Class clazz,
                                     Configuration config,
                                     ComponentInfo info)
                              throws ServiceException
Throws:
ServiceException

dispose

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

initialize

public void initialize()
                throws Exception
Specified by:
initialize in interface Initializable
Throws:
Exception


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.