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:
- 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 |
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 ServerConnectionhandlerFactory
- the factory that generates ConnectionHandlers for the client
connections spawned off this ServerConnectionthreadPool
- the ThreadPool used to obtain handler threadstimeout
- the client idle timeout for this ServerConnection's client connectionsmaxOpenConn
- the maximum number of open client connections allowed for this
ServerConnection
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-2007 The Apache Software Foundation. All Rights Reserved.