org.apache.james.util.connection
Class ServerConnection

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLogEnabled
        |
        +--org.apache.james.util.connection.ServerConnection
All Implemented Interfaces:
Component, Initializable, LogEnabled, Runnable

public class ServerConnection
extends AbstractLogEnabled
implements Component, Initializable, 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.

Author:
Andrei Ivanov, Peter M. Goldstein

Constructor Summary
ServerConnection(ServerSocket serverSocket, ConnectionHandlerFactory handlerFactory, org.apache.avalon.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(ServerSocket serverSocket,
                        ConnectionHandlerFactory handlerFactory,
                        org.apache.avalon.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 Exception
Specified by:
initialize in interface Initializable
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 Runnable


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."