|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.io.SocketAcceptor
class SocketAcceptor
This is an implementation of an Acceptor that uses a MINA
IoAcceptor to accept incoming connections.
Its constructor is package-private, so use
ServerEndpoint.createAcceptor() to create an instance.
This implementation is thread-safe.
| Nested Class Summary | |
|---|---|
(package private) static class |
SocketAcceptor.AcceptHandler
Internal adaptor class to handle events from the acceptor itself. |
| Constructor Summary | |
|---|---|
SocketAcceptor(ServerSocketEndpoint endpoint,
org.apache.mina.common.IoAcceptor acceptor)
Constructs a SocketAcceptor with the given MINA
IoAcceptor. |
|
| Method Summary | |
|---|---|
ServerSocketEndpoint |
getBoundEndpoint()
Returns the ServerEndpoint on which this Acceptor
is listening. |
ServerSocketEndpoint |
getEndpoint()
Returns the ServerEndpoint this Acceptor was
created with. |
void |
listen(AcceptorListener listener)
Passively accepts incoming connections on the associated ServerEndpoint. |
void |
shutdown()
Shuts down this Acceptor, releasing any resources in use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
SocketAcceptor(ServerSocketEndpoint endpoint,
org.apache.mina.common.IoAcceptor acceptor)
SocketAcceptor with the given MINA
IoAcceptor.
endpoint - the local address to which to listenacceptor - the MINA IoAcceptor to use for the underlying
IO processing| Method Detail |
|---|
public void listen(AcceptorListener listener)
throws IOException
ServerEndpoint. This call may block until listening
succeeds, but does not block to wait for incoming connections.
Each accepted connection will result in an asynchronous call to
newConnection on the given
listener.
This implementation ensures that only complete messages are delivered on the connections that it accepts.
listen in interface Acceptor<SocketAddress>listener - the listener that will be notified of new connections
IOException - if there was a problem listening on the
ServerEndpointpublic ServerSocketEndpoint getEndpoint()
ServerEndpoint this Acceptor was
created with.
getEndpoint in interface Acceptor<SocketAddress>ServerEndpoint this Acceptor was
created withpublic ServerSocketEndpoint getBoundEndpoint()
ServerEndpoint on which this Acceptor
is listening.
getBoundEndpoint in interface Acceptor<SocketAddress>ServerEndpoint on which this Acceptor
is listeningpublic void shutdown()
Acceptor, releasing any resources in use.
Once shutdown, an Acceptor cannot be restarted.
shutdown in interface Acceptor<SocketAddress>
|
Project Darkstar, Version 0.9.8.6 2013-07-29 20:32:23 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||