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

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.cornerstone.services.connection.AbstractService
All Implemented Interfaces:
Configurable, Contextualizable, Disposable, Initializable, LogEnabled, Serviceable

public abstract class AbstractService
extends AbstractLogEnabled
implements Contextualizable, Serviceable, Configurable, Initializable, Disposable

Helper class to create protocol services.

Author:
Avalon Development Team

Field Summary
protected  java.net.InetAddress m_bindTo
           
protected  ConnectionManager m_connectionManager
           
protected  java.lang.String m_connectionName
           
protected  ConnectionHandlerFactory m_factory
           
protected  int m_port
           
protected  java.net.ServerSocket m_serverSocket
           
protected  java.lang.String m_serverSocketType
           
protected  SocketManager m_socketManager
           
protected  ThreadManager m_threadManager
           
protected  ThreadPool m_threadPool
           
 
Constructor Summary
AbstractService()
           
 
Method Summary
 void configure(Configuration configuration)
          Pass the Configuration to the Configurable class.
 void contextualize(Context context)
          Pass the Context to the component.
protected abstract  ConnectionHandlerFactory createFactory()
           
 void dispose()
          The dispose operation is called at the end of a components lifecycle.
 void enableLogging(Logger logger)
          Set the components logger.
protected  java.lang.String getThreadPoolName()
           
 void initialize()
          Initialize the component.
 void service(ServiceManager serviceManager)
          Pass the ServiceManager to the Serviceable.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_connectionManager

protected ConnectionManager m_connectionManager

m_socketManager

protected SocketManager m_socketManager

m_factory

protected ConnectionHandlerFactory m_factory

m_threadManager

protected ThreadManager m_threadManager

m_threadPool

protected ThreadPool m_threadPool

m_serverSocketType

protected java.lang.String m_serverSocketType

m_port

protected int m_port

m_bindTo

protected java.net.InetAddress m_bindTo

m_serverSocket

protected java.net.ServerSocket m_serverSocket

m_connectionName

protected java.lang.String m_connectionName
Constructor Detail

AbstractService

public AbstractService()
Method Detail

getThreadPoolName

protected java.lang.String getThreadPoolName()

createFactory

protected abstract ConnectionHandlerFactory createFactory()

enableLogging

public void enableLogging(Logger logger)
Description copied from class: AbstractLogEnabled
Set the components logger.

Specified by:
enableLogging in interface LogEnabled
Overrides:
enableLogging in class AbstractLogEnabled
Parameters:
logger - the logger

contextualize

public void contextualize(Context context)
                   throws ContextException
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.
Throws:
ContextException - if context is invalid

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

initialize

public void initialize()
                throws java.lang.Exception
Description copied from interface: Initializable
Initialize the component. Initialization includes allocating any resources required throughout the component's lifecycle.

Specified by:
initialize in interface Initializable
Throws:
java.lang.Exception - if an error occurs

dispose

public void dispose()
Description copied from interface: Disposable
The dispose operation is called at the end of a components lifecycle. This method will be called after Startable.stop() method (if implemented by component). Components use this method to release and destroy any resources that the Component owns.

Specified by:
dispose in interface Disposable


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