420359 - Support 0 acceptors for ServerConnector

improved javadoc
This commit is contained in:
Greg Wilkins 2013-11-04 17:13:19 +11:00
parent 55fafc4c3a
commit 17bf8ccee0
1 changed files with 14 additions and 3 deletions

View File

@ -165,9 +165,12 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
} }
/** /**
* <p>Registers a channel to select accept operations</p> * <p>Registers a channel to select accept operations.
* * When a {@link SocketChannel} is accepted from this {@link ServerSocketChannel}
* @param channel the channel to register * then the {@link #accepted(SocketChannel)} method is called, which must be
* overridden by a derivation of this class to handle the accepted channel
*
* @param channel the server channel to register
*/ */
public void acceptor(final ServerSocketChannel server) public void acceptor(final ServerSocketChannel server)
{ {
@ -175,6 +178,14 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
selector.submit(selector.new Acceptor(server)); selector.submit(selector.new Acceptor(server));
} }
/**
* Callback method when a channel is accepted from the {@link ServerSocketChannel}
* passed in {@link #acceptor(ServerSocketChannel)}.
* The default impl throws an {@link UnsupportedOperationException}, so it must
* be overridden if selected acceptor is to be used.
* @param channel
* @throws IOException
*/
protected void accepted(SocketChannel channel) throws IOException protected void accepted(SocketChannel channel) throws IOException
{ {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();