org.apache.james.util.connection
Class ServerConnection

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.james.util.connection.ServerConnection
All Implemented Interfaces:
java.lang.Runnable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.LogEnabled

public class ServerConnection
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.avalon.framework.activity.Initializable, java.lang.Runnable

Represents a single server socket managed by a connection manager. The connection manager will spawn a single ServerConnection for each server socket that the connection manager is managing.


Constructor Summary
ServerConnection(java.net.ServerSocket serverSocket, org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory handlerFactory, org.apache.excalibur.thread.ThreadPool threadPool, int timeout, int maxOpenConn)
          The sole constructor for a ServerConnection.
 
Method Summary
 void dispose()
          The dispose operation is called by the owning ConnectionManager at the end of its lifecycle.
 void initialize()
           
 void run()
          Provides the body for the thread of execution for a ServerConnection.
 
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

ServerConnection

public ServerConnection(java.net.ServerSocket serverSocket,
                        org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory handlerFactory,
                        org.apache.excalibur.thread.ThreadPool threadPool,
                        int timeout,
                        int maxOpenConn)
The sole constructor for a ServerConnection.

Parameters:
serverSocket - the ServerSocket associated with this ServerConnection
handlerFactory - the factory that generates ConnectionHandlers for the client connections spawned off this ServerConnection
threadPool - the ThreadPool used to obtain handler threads
timeout - the client idle timeout for this ServerConnection's client connections
maxOpenConn - the maximum number of open client connections allowed for this ServerConnection
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception
See Also:
Initializable.initialize()

dispose

public void dispose()
The dispose operation is called by the owning ConnectionManager at the end of its lifecycle. Cleans up the server connection, forcing everything to finish.


run

public void run()
Provides the body for the thread of execution for a ServerConnection. Connections made to the server socket are passed to an appropriate, newly created, ClientConnectionRunner

Specified by:
run in interface java.lang.Runnable


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.