| org.apache.james.util.connection.SimpleConnectionManager
SimpleConnectionManager | public class SimpleConnectionManager extends AbstractLogEnabled implements JamesConnectionManager,Serviceable,Configurable,Disposable(Code) | | An implementation of ConnectionManager that supports configurable
idle timeouts and a configurable value for the maximum number of
client connections to a particular port.
|
Field Summary | |
protected int | maxOpenConn The maximum number of client connections allowed per server connection. | protected int | timeout The idle timeout for the individual sockets spawed from the server socket. |
Method Summary | |
public void | configure(Configuration configuration) | public void | connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory, ThreadPool threadPool, int maxOpenConnections) Start managing a connection. | public void | connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory, ThreadPool threadPool) Start managing a connection. | public void | connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory) Start managing a connection. | public void | connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory, int maxOpenConnections) Start managing a connection. | public void | disconnect(String name) This shuts down all handlers and socket, waiting for each to gracefully shutdown. | public void | disconnect(String name, boolean tearDown) This shuts down a connection.
If tearDown is true then it will forcefully the connection and try
to return as soon as possible. | public void | dispose() | public int | getMaximumNumberOfOpenConnections() | public void | service(ServiceManager componentManager) |
maxOpenConn | protected int maxOpenConn(Code) | | The maximum number of client connections allowed per server connection.
|
timeout | protected int timeout(Code) | | The idle timeout for the individual sockets spawed from the server socket.
|
configure | public void configure(Configuration configuration) throws ConfigurationException(Code) | | See Also: org.apache.avalon.framework.configuration.Configurable.configure(Configuration) |
connect | public void connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory, ThreadPool threadPool, int maxOpenConnections) throws Exception(Code) | | Start managing a connection.
Management involves accepting connections and farming them out to threads
from pool to be handled.
Parameters: name - the name of connection Parameters: socket - the ServerSocket from which to Parameters: handlerFactory - the factory from which to acquire handlers Parameters: threadPool - the thread pool to use Parameters: maxOpenConnections - the maximum number of open connections allowed for this server socket. exception: Exception - if an error occurs |
connect | public void connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory, ThreadPool threadPool) throws Exception(Code) | | Start managing a connection.
Management involves accepting connections and farming them out to threads
from pool to be handled.
Parameters: name - the name of connection Parameters: socket - the ServerSocket from which to Parameters: handlerFactory - the factory from which to acquire handlers Parameters: threadPool - the thread pool to use exception: Exception - if an error occurs |
connect | public void connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory) throws Exception(Code) | | Start managing a connection.
This is similar to other connect method except that it uses default thread pool.
Parameters: name - the name of connection Parameters: socket - the ServerSocket from which to Parameters: handlerFactory - the factory from which to acquire handlers exception: Exception - if an error occurs |
connect | public void connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory, int maxOpenConnections) throws Exception(Code) | | Start managing a connection.
This is similar to other connect method except that it uses default thread pool.
Parameters: name - the name of connection Parameters: socket - the ServerSocket from which to Parameters: handlerFactory - the factory from which to acquire handlers Parameters: maxOpenConnections - the maximum number of open connections allowed for this server socket. exception: Exception - if an error occurs |
disconnect | public void disconnect(String name) throws Exception(Code) | | This shuts down all handlers and socket, waiting for each to gracefully shutdown.
Parameters: name - the name of connection exception: Exception - if an error occurs |
disconnect | public void disconnect(String name, boolean tearDown) throws Exception(Code) | | This shuts down a connection.
If tearDown is true then it will forcefully the connection and try
to return as soon as possible. Otherwise it will behave the same as
void disconnect( String name );
Parameters: name - the name of connection Parameters: tearDown - if true will forcefully tear down all handlers exception: Exception - if an error occurs |
dispose | public void dispose()(Code) | | Disconnects all the underlying ServerConnections
|
getMaximumNumberOfOpenConnections | public int getMaximumNumberOfOpenConnections()(Code) | | Returns the default maximum number of open connections supported by this
SimpleConnectionManager
the maximum number of connections |
service | public void service(ServiceManager componentManager) throws ServiceException(Code) | | See Also: org.apache.avalon.framework.service.Serviceable.service(ServiceManager) |
|
|