org.apache.cocoon.portal.pluto.services.factory
Class FactoryManagerServiceImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.portal.pluto.services.factory.FactoryManagerServiceImpl
All Implemented Interfaces:
Disposable, Initializable, Contextualizable, LogEnabled, Serviceable, org.apache.pluto.services.ContainerService, org.apache.pluto.services.factory.FactoryManagerService

public class FactoryManagerServiceImpl
extends AbstractLogEnabled
implements org.apache.pluto.services.factory.FactoryManagerService, Initializable, Contextualizable, Serviceable, Disposable

Manages the life-time of factories registered during container startup. A service has to derive from Factory and implement the init() and destroy() methods as appropriate. TODO This is a very lazy implementation, we need to improve it

Version:
CVS $Id: FactoryManagerServiceImpl.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler
See Also:
Factory

Field Summary
protected  Context context
          The avalon context
protected  ServiceManager manager
          The service manager
protected  ServletConfig servletConfig
          The servlet configuration
 
Constructor Summary
FactoryManagerServiceImpl()
           
 
Method Summary
 void contextualize(Context context)
           
 void dispose()
           
 org.apache.pluto.factory.Factory getFactory(Class theClass)
          Returns the service implementation for the given service class, or null if no such service is registered.
 void initialize()
           
 void service(ServiceManager manager)
           
 
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

servletConfig

protected ServletConfig servletConfig
The servlet configuration


context

protected Context context
The avalon context


manager

protected ServiceManager manager
The service manager

Constructor Detail

FactoryManagerServiceImpl

public FactoryManagerServiceImpl()
Method Detail

contextualize

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

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

initialize

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

dispose

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

getFactory

public org.apache.pluto.factory.Factory getFactory(Class theClass)
Returns the service implementation for the given service class, or null if no such service is registered.

Specified by:
getFactory in interface org.apache.pluto.services.factory.FactoryManagerService
Parameters:
theClass - the service class
Returns:
the service implementation


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.