java.lang.Object
org.glassfish.grizzly.nio.SelectorRunner
- All Implemented Interfaces:
Runnable
Class is responsible for processing certain (single)
SelectorHandler
- Author:
- Alexey Stashok
-
Method Summary
Modifier and TypeMethodDescriptionstatic SelectorRunner
create
(NIOTransport transport) protected boolean
doSelect()
This method handle the processing of all Selector's interest op (OP_ACCEPT,OP_READ,OP_WRITE,OP_CONNECT) by delegating to its Handler.int
Number ofSelectionKey
s, which were selected last time.getState()
void
postpone()
void
run()
void
start()
void
stop()
protected void
-
Method Details
-
create
- Throws:
IOException
-
getTransport
-
getSelector
-
getRunnerThread
-
getState
-
postpone
public void postpone() -
start
public void start() -
stop
public void stop() -
run
public void run() -
doSelect
protected boolean doSelect()This method handle the processing of all Selector's interest op (OP_ACCEPT,OP_READ,OP_WRITE,OP_CONNECT) by delegating to its Handler. By default, all java.nio.channels.Selector operations are implemented using SelectorHandler. All SelectionKey operations are implemented by SelectionKeyHandler. Finally, ProtocolChain creation/re-use are implemented by InstanceHandler. -
getPendingTasks
-
getPostponedTasks
-
obtainPostponedTasks
-
getLastSelectedKeysCount
public int getLastSelectedKeysCount()Number ofSelectionKey
s, which were selected last time. Operation is not thread-safe.- Returns:
- number of
SelectionKey
s, which were selected last time.
-
switchToNewSelector
- Throws:
IOException
-