| org.codehaus.spice.netserve.connection.SocketAcceptorManager
All known Subclasses: org.codehaus.spice.netserve.connection.impl.DefaultAcceptorManager,
SocketAcceptorManager | public interface SocketAcceptorManager (Code) | | This service is used to manage network acceptors.
The service takes a ServerSocket and RequestHandler and
anytime a new connection is accepted the handler is called
with the new socket connection.
author: Peter Donald version: $Revision: 1.2 $ $Date: 2004/03/21 23:43:00 $ |
Method Summary | |
void | connect(String name, ServerSocket socket, RequestHandler handler) Start accepting connections from a socket and passing connections
to specified handler.
Parameters: name - the name of connection. | void | disconnect(String name) This shuts down the named acceptor. | boolean | isConnected(String name) Return true if acceptor with specified name exists. |
connect | void connect(String name, ServerSocket socket, RequestHandler handler) throws Exception(Code) | | Start accepting connections from a socket and passing connections
to specified handler.
Parameters: name - the name of connection. This serves as a key used toshutdown acceptor. Parameters: socket - the ServerSocket from which connections are accepted throws: java.lang.Exception - if unable to initiate connection management. This couldbe due to the key already being used for another acceptor,the serversocket being closed, the handler being null etc. |
disconnect | void disconnect(String name)(Code) | | This shuts down the named acceptor.
NOTE: It is the responsibility of the caller to make
sure that the ServerSocket has been closed.
Parameters: name - the name of connection throws: java.lang.IllegalArgumentException - if no connection with specified name |
isConnected | boolean isConnected(String name)(Code) | | Return true if acceptor with specified name exists.
Parameters: name - the name true if acceptor with specified name exists. |
|
|