|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.grizzly.TCPSelectorHandler
com.sun.grizzly.RoundRobinSelectorHandler
public class RoundRobinSelectorHandler
A SelectorHandler handles all java.nio.channels.Selector operations.
One or more instance of a Selector are handled by SelectorHandler.
The logic for processing of SelectionKey interest (OP_ACCEPT,OP_READ, etc.)
is usually defined using an instance of SelectorHandler.
This class represents a TCP implementation of a SelectorHandler,
which handles "accept" events by registering newly accepted connections
to auxiliary Controllers in a round robin fashion.
| Field Summary |
|---|
| Fields inherited from class com.sun.grizzly.TCPSelectorHandler |
|---|
asyncQueueReader, asyncQueueWriter, attributes, connectorInstanceHandler, inet, instanceHandler, isShutDown, linger, logger, opToRegister, port, receiveBufferSize, reuseAddress, role, selectionKeyHandler, selector, selectTimeout, sendBufferSize, serverSocket, serverSocketChannel, serverTimeout, socketTimeout, ssBackLog, stateHolder, tcpNoDelay, threadPool |
| Constructor Summary | |
|---|---|
RoundRobinSelectorHandler()
|
|
RoundRobinSelectorHandler(ReadController[] rrControllers)
|
|
| Method Summary | |
|---|---|
void |
addProtocolSupport(Controller.Protocol customProtocol)
Add custom protocol support |
void |
copyTo(Copyable copy)
|
ReadController |
nextController()
Return next aux. |
boolean |
onAcceptInterest(SelectionKey key,
Context context)
Handle OP_ACCEPT. |
void |
shutdown()
Shuntdown this instance by closing its Selector and associated channels. |
boolean |
supportsClient(SelectorHandler selectorHandler)
Checks if given SelectorHandler is supported on client-side by RoundRobinSelectorHandler |
boolean |
supportsProtocol(Controller.Protocol protocol)
Checks if protocol is supported by RoundRobinSelectorHandler |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.grizzly.util.AttributeHolder |
|---|
getAttribute, getAttributes, removeAttribute, setAttribute, setAttributes |
| Methods inherited from interface com.sun.grizzly.util.SupportStateHolder |
|---|
getStateHolder |
| Methods inherited from interface com.sun.grizzly.tcp.PendingIOhandler |
|---|
addPendingIO, addPendingKeyCancel |
| Constructor Detail |
|---|
public RoundRobinSelectorHandler()
public RoundRobinSelectorHandler(ReadController[] rrControllers)
| Method Detail |
|---|
public void copyTo(Copyable copy)
copyTo in interface CopyablecopyTo in class TCPSelectorHandler
public boolean onAcceptInterest(SelectionKey key,
Context context)
throws IOException
TCPSelectorHandler
onAcceptInterest in interface SelectorHandleronAcceptInterest in class TCPSelectorHandlerkey - SelectionKeycontext - Context
IOExceptionpublic void addProtocolSupport(Controller.Protocol customProtocol)
customProtocol - custom Controller.Protocolpublic boolean supportsProtocol(Controller.Protocol protocol)
supportsProtocol in interface ComplexSelectorHandlerprotocol - Network protocol name
public boolean supportsClient(SelectorHandler selectorHandler)
SelectorHandler is supported on client-side by RoundRobinSelectorHandler
supportsClient in interface ComplexSelectorHandlerselectorHandler - SelectorHandler
selectorHandler is supported, false otherwisepublic ReadController nextController()
nextController in interface ComplexSelectorHandlerReadControllerpublic void shutdown()
TCPSelectorHandler
shutdown in interface SelectorHandlershutdown in class TCPSelectorHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||