|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLogEnabled | +--org.apache.james.util.connection.SimpleConnectionManager
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. |
Fields inherited from interface org.apache.avalon.cornerstone.services.connection.ConnectionManager |
ROLE |
Constructor Summary | |
SimpleConnectionManager()
|
Method Summary | |
void |
compose(ComponentManager componentManager)
|
void |
configure(Configuration configuration)
|
void |
connect(String name,
ServerSocket socket,
ConnectionHandlerFactory handlerFactory)
Start managing a connection. |
void |
connect(String name,
ServerSocket socket,
ConnectionHandlerFactory handlerFactory,
int maxOpenConnections)
Start managing a connection. |
void |
connect(String name,
ServerSocket socket,
ConnectionHandlerFactory handlerFactory,
org.apache.avalon.excalibur.thread.ThreadPool threadPool)
Start managing a connection. |
void |
connect(String name,
ServerSocket socket,
ConnectionHandlerFactory handlerFactory,
org.apache.avalon.excalibur.thread.ThreadPool threadPool,
int maxOpenConnections)
Start managing a connection. |
void |
disconnect(String name)
This shuts down all handlers and socket, waiting for each to gracefully shutdown. |
void |
disconnect(String name,
boolean tearDown)
This shuts down a connection. |
void |
dispose()
Disconnects all the underlying ServerConnections |
int |
getMaximumNumberOfOpenConnections()
Returns the default maximum number of open connections supported by this SimpleConnectionManager |
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 |
Field Detail |
protected int timeout
protected int maxOpenConn
Constructor Detail |
public SimpleConnectionManager()
Method Detail |
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
Configurable.configure(Configuration)
public void compose(ComponentManager componentManager) throws ComponentException
compose
in interface Composable
ComponentException
Composable.compose(ComponentManager)
public void dispose()
dispose
in interface Disposable
public void connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory, org.apache.avalon.excalibur.thread.ThreadPool threadPool, int maxOpenConnections) throws Exception
name
- the name of connectionsocket
- the ServerSocket from which tohandlerFactory
- the factory from which to acquire handlersthreadPool
- the thread pool to usemaxOpenConnections
- the maximum number of open connections allowed for this server socket.
Exception
- if an error occurspublic void connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory, org.apache.avalon.excalibur.thread.ThreadPool threadPool) throws Exception
connect
in interface ConnectionManager
name
- the name of connectionsocket
- the ServerSocket from which tohandlerFactory
- the factory from which to acquire handlersthreadPool
- the thread pool to use
Exception
- if an error occurspublic void connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory) throws Exception
connect
in interface ConnectionManager
name
- the name of connectionsocket
- the ServerSocket from which tohandlerFactory
- the factory from which to acquire handlers
Exception
- if an error occurspublic void connect(String name, ServerSocket socket, ConnectionHandlerFactory handlerFactory, int maxOpenConnections) throws Exception
name
- the name of connectionsocket
- the ServerSocket from which tohandlerFactory
- the factory from which to acquire handlersmaxOpenConnections
- the maximum number of open connections allowed for this server socket.
Exception
- if an error occurspublic void disconnect(String name) throws Exception
disconnect
in interface ConnectionManager
name
- the name of connection
Exception
- if an error occurspublic void disconnect(String name, boolean tearDown) throws Exception
disconnect
in interface ConnectionManager
name
- the name of connectiontearDown
- if true will forcefully tear down all handlers
Exception
- if an error occurspublic int getMaximumNumberOfOpenConnections()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |