|
||||||||||
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
public class 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.james.services.JamesConnectionManager |
---|
ROLE |
Constructor Summary | |
---|---|
SimpleConnectionManager()
|
Method Summary | |
---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
void |
connect(java.lang.String name,
java.net.ServerSocket socket,
org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory handlerFactory)
Start managing a connection. |
void |
connect(java.lang.String name,
java.net.ServerSocket socket,
org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory handlerFactory,
int maxOpenConnections)
Start managing a connection. |
void |
connect(java.lang.String name,
java.net.ServerSocket socket,
org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory handlerFactory,
org.apache.excalibur.thread.ThreadPool threadPool)
Start managing a connection. |
void |
connect(java.lang.String name,
java.net.ServerSocket socket,
org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory handlerFactory,
org.apache.excalibur.thread.ThreadPool threadPool,
int maxOpenConnections)
Start managing a connection. |
void |
disconnect(java.lang.String name)
This shuts down all handlers and socket, waiting for each to gracefully shutdown. |
void |
disconnect(java.lang.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 |
void |
service(org.apache.avalon.framework.service.ServiceManager componentManager)
|
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(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
Configurable.configure(Configuration)
public void service(org.apache.avalon.framework.service.ServiceManager componentManager) throws org.apache.avalon.framework.service.ServiceException
service
in interface org.apache.avalon.framework.service.Serviceable
org.apache.avalon.framework.service.ServiceException
Serviceable.service(ServiceManager)
public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
public void connect(java.lang.String name, java.net.ServerSocket socket, org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory handlerFactory, org.apache.excalibur.thread.ThreadPool threadPool, int maxOpenConnections) throws java.lang.Exception
connect
in interface JamesConnectionManager
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.
java.lang.Exception
- if an error occurspublic void connect(java.lang.String name, java.net.ServerSocket socket, org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory handlerFactory, org.apache.excalibur.thread.ThreadPool threadPool) throws java.lang.Exception
connect
in interface org.apache.avalon.cornerstone.services.connection.ConnectionManager
connect
in interface JamesConnectionManager
name
- the name of connectionsocket
- the ServerSocket from which tohandlerFactory
- the factory from which to acquire handlersthreadPool
- the thread pool to use
java.lang.Exception
- if an error occurspublic void connect(java.lang.String name, java.net.ServerSocket socket, org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory handlerFactory) throws java.lang.Exception
connect
in interface org.apache.avalon.cornerstone.services.connection.ConnectionManager
connect
in interface JamesConnectionManager
name
- the name of connectionsocket
- the ServerSocket from which tohandlerFactory
- the factory from which to acquire handlers
java.lang.Exception
- if an error occurspublic void connect(java.lang.String name, java.net.ServerSocket socket, org.apache.avalon.cornerstone.services.connection.ConnectionHandlerFactory handlerFactory, int maxOpenConnections) throws java.lang.Exception
connect
in interface JamesConnectionManager
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.
java.lang.Exception
- if an error occurspublic void disconnect(java.lang.String name) throws java.lang.Exception
disconnect
in interface org.apache.avalon.cornerstone.services.connection.ConnectionManager
name
- the name of connection
java.lang.Exception
- if an error occurspublic void disconnect(java.lang.String name, boolean tearDown) throws java.lang.Exception
disconnect
in interface org.apache.avalon.cornerstone.services.connection.ConnectionManager
name
- the name of connectiontearDown
- if true will forcefully tear down all handlers
java.lang.Exception
- if an error occurspublic int getMaximumNumberOfOpenConnections()
getMaximumNumberOfOpenConnections
in interface JamesConnectionManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |