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)
          Pass the Configuration to the Configurable class.
 void contextualize(Context context)
          Pass the Context to the component.
 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)
          Pass the ServiceManager to the Serviceable.
 
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)
Description copied from interface: Contextualizable
Pass the Context to the component. This method is called after the LogEnabled.enableLogging( Logger ) (if present) method and before any other method.

Specified by:
contextualize in interface Contextualizable
Parameters:
context - the context. Must not be null.

service

public void service(ServiceManager serviceManager)
             throws ServiceException
Description copied from interface: Serviceable
Pass the ServiceManager to the Serviceable. The Serviceable implementation should use the specified ServiceManager to acquire the components it needs for execution.

Specified by:
service in interface Serviceable
Parameters:
serviceManager - The ServiceManager which this Serviceable uses. Must not be null.
Throws:
ServiceException - if an error occurs

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Description copied from interface: Configurable
Pass the Configuration to the Configurable class.

Specified by:
configure in interface Configurable
Parameters:
configuration - the class configurations. Must not be null.
Throws:
ConfigurationException - if an error occurs

createConnectionHandler

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

Specified by:
createConnectionHandler in interface ConnectionHandlerFactory
Returns:
the new ConnectionHandler
Throws:
java.lang.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 java.lang.Exception
Overide this method to create actual instance of connection handler.

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


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