com.sun.grizzly
Class SelectorHandlerRunner

java.lang.Object
  extended by com.sun.grizzly.SelectorHandlerRunner
All Implemented Interfaces:
Runnable

public class SelectorHandlerRunner
extends Object
implements Runnable

Class is responsible for processing certain (single) SelectorHandler

Author:
Alexey Stashok

Field Summary
protected static Logger logger
          Default Logger.
 
Constructor Summary
SelectorHandlerRunner(Controller controller, SelectorHandler selectorHandler)
           
 
Method Summary
protected  boolean continueSelect(SelectorHandler selectorHandler, NIOContext serverCtx)
           
protected  boolean doSelect(SelectorHandler selectorHandler, NIOContext serverCtx)
          This method handle the processing of all Selector's interest op (OP_ACCEPT,OP_READ,OP_WRITE,OP_CONNECT) by delegating to its Handler.
 SelectorHandler getSelectorHandler()
           
 void run()
           
protected static void switchToNewSelector(SelectorHandler selectorHandler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static Logger logger
Default Logger.

Constructor Detail

SelectorHandlerRunner

public SelectorHandlerRunner(Controller controller,
                             SelectorHandler selectorHandler)
Method Detail

getSelectorHandler

public SelectorHandler getSelectorHandler()

run

public void run()
Specified by:
run in interface Runnable

continueSelect

protected boolean continueSelect(SelectorHandler selectorHandler,
                                 NIOContext serverCtx)

doSelect

protected boolean doSelect(SelectorHandler selectorHandler,
                           NIOContext serverCtx)
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.

Parameters:
selectorHandler - - the SelectorHandler

switchToNewSelector

protected static void switchToNewSelector(SelectorHandler selectorHandler)
                                   throws IOException
Throws:
IOException


Copyright © 2012 Oracle Corporation. All Rights Reserved.