|
||||||||||
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 Controller
s in a round robin fashion.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.sun.grizzly.TCPSelectorHandler |
---|
TCPSelectorHandler.ConnectChannelOperation, TCPSelectorHandler.RegisterChannelOperation, TCPSelectorHandler.RegisterKeyOperation, TCPSelectorHandler.RunnableOperation, TCPSelectorHandler.SelectionKeyCancelOperation |
Field Summary |
---|
Fields inherited from class com.sun.grizzly.TCPSelectorHandler |
---|
asyncQueueReader, asyncQueueWriter, attributes, connectorInstanceHandler, inet, instanceHandler, isKeepAlive, isShutDown, linger, logger, portRange, postponedTasks, receiveBufferSize, reuseAddress, role, selectionKeyHandler, selector, selectorHandlerTasks, 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)
Copies current object content to copy object |
ReadController |
nextController()
Return next aux. |
boolean |
onAcceptInterest(SelectionKey key,
Context context)
Handle OP_ACCEPT. |
void |
shutdown()
Shutdown 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)
Copyable
copyTo
in interface Copyable
copyTo
in class TCPSelectorHandler
copy
- represents target object, where current object's content will be copiedpublic boolean onAcceptInterest(SelectionKey key, Context context) throws IOException
TCPSelectorHandler
onAcceptInterest
in interface SelectorHandler
onAcceptInterest
in class TCPSelectorHandler
key
- SelectionKey
context
- Context
IOException
public void addProtocolSupport(Controller.Protocol customProtocol)
customProtocol
- custom Controller.Protocol
public boolean supportsProtocol(Controller.Protocol protocol)
supportsProtocol
in interface ComplexSelectorHandler
protocol
- Network protocol name
public boolean supportsClient(SelectorHandler selectorHandler)
SelectorHandler
is supported on client-side by RoundRobinSelectorHandler
supportsClient
in interface ComplexSelectorHandler
selectorHandler
- SelectorHandler
selectorHandler
is supported, false otherwisepublic ReadController nextController()
nextController
in interface ComplexSelectorHandler
ReadController
public void shutdown()
TCPSelectorHandler
shutdown
in interface SelectorHandler
shutdown
in class TCPSelectorHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |