|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Method Summary | |
void |
connect(String name,
ServerSocket socket,
RequestHandler handler)
Start accepting connections from a socket and passing connections to specified handler. |
void |
disconnect(String name)
This shuts down the named acceptor. |
boolean |
isConnected(String name)
Return true if acceptor with specified name exists. |
Method Detail |
public void connect(String name, ServerSocket socket, RequestHandler handler) throws Exception
name
- the name of connection. This serves as a key used to
shutdown acceptor.socket
- the ServerSocket from which connections are accepted
Exception
- if unable to initiate connection management. This could
be due to the key already being used for another acceptor,
the serversocket being closed, the handler being null etc.public void disconnect(String name)
name
- the name of connection
IllegalArgumentException
- if no connection with specified namepublic boolean isConnected(String name)
name
- the name
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |