org.apache.avalon.cornerstone.services.connection
Class AbstractHandlerFactory

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.cornerstone.services.connection.AbstractHandlerFactory
All Implemented Interfaces:
Configurable, ConnectionHandlerFactory, Contextualizable, LogEnabled, Serviceable
Direct Known Subclasses:
DefaultHandlerFactory

public abstract class AbstractHandlerFactory
extends AbstractLogEnabled
implements Contextualizable, Serviceable, Configurable, ConnectionHandlerFactory

Helper class to extend to create handler factorys.

Author:
Avalon Development Team

Constructor Summary
AbstractHandlerFactory()
           
 
Method Summary
 void configure(Configuration configuration)
           
 void contextualize(Context context)
           
 ConnectionHandler createConnectionHandler()
          Construct an appropriate ConnectionHandler.
protected abstract  ConnectionHandler newHandler()
          Overide this method to create actual instance of connection handler.
 void releaseConnectionHandler(ConnectionHandler connectionHandler)
          Release a previously created ConnectionHandler.
 void service(ServiceManager serviceManager)
           
 
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

AbstractHandlerFactory

public AbstractHandlerFactory()
Method Detail

contextualize

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

service

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

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException

createConnectionHandler

public ConnectionHandler createConnectionHandler()
                                          throws Exception
Construct an appropriate ConnectionHandler.

Specified by:
createConnectionHandler in interface ConnectionHandlerFactory
Returns:
the new ConnectionHandler
Throws:
Exception - if an error occurs

releaseConnectionHandler

public void releaseConnectionHandler(ConnectionHandler connectionHandler)
Description copied from interface: ConnectionHandlerFactory
Release a previously created ConnectionHandler. e.g. for spooling.

Specified by:
releaseConnectionHandler in interface ConnectionHandlerFactory

newHandler

protected abstract ConnectionHandler newHandler()
                                         throws Exception
Overide this method to create actual instance of connection handler.

Returns:
the new ConnectionHandler
Throws:
Exception - if an error occurs


Copyright © Apache Software Foundation. All Rights Reserved.