com.sun.grizzly.http
Class SelectorThreadHandler

java.lang.Object
  extended by com.sun.grizzly.TCPSelectorHandler
      extended by com.sun.grizzly.http.SelectorThreadHandler
All Implemented Interfaces:
Handler, HttpSelectorHandler, LinuxSpinningWorkaround, SelectorHandler, PendingIOhandler, AttributeHolder, Copyable, SupportStateHolder<State>

public class SelectorThreadHandler
extends TCPSelectorHandler
implements HttpSelectorHandler

SelectorHandler implementation SelectorThread passes to Controller. It is very similar to TCPSelectorHandler, however has some difference in preSelect() processing

Author:
Jeanfrancois Arcand, Alexey Stashok

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
SelectorThreadHandler()
           
SelectorThreadHandler(SelectorThread selectorThread)
           
 
Method Summary
 void configureChannel(SelectableChannel channel)
           
 void copyTo(Copyable copy)
          
 SelectorThread getSelectorThread()
           
 boolean onAcceptInterest(SelectionKey key, Context ctx)
           
 void setSelectorThread(SelectorThread selectorThread)
           
 
Methods inherited from class com.sun.grizzly.TCPSelectorHandler
acceptWithoutRegistration, acquireConnectorHandler, addPendingIO, addPendingKeyCancel, boolean2Role, closeChannel, connect, getAsyncQueueReader, getAsyncQueueWriter, getAttribute, getAttributes, getConnectorInstanceHandlerDelegate, getInet, getLinger, getLogger, getPort, getPortLowLevel, getPortRange, getPreferredSelectionKeyHandler, getProtocolChainInstanceHandler, getRole, getSelectableChannel, getSelectionKeyHandler, getSelector, getSelectTimeout, getServerTimeout, getSocketTimeout, getSpinRate, getSsBackLog, getStateHolder, getThreadPool, invokeAsyncQueueReader, invokeAsyncQueueWriter, invokeCallbackHandler, isExecutePendingIOUsingSelectorThread, isKeepAlive, isOpen, isReuseAddress, isTcpNoDelay, keyFor, keys, onConnectInterest, onConnectOp, onReadInterest, onWriteInterest, pause, pollContext, postSelect, preSelect, processPendingOperations, protocol, register, register, register, releaseConnectorHandler, removeAttribute, resetSpinCounter, resume, select, setAttribute, setAttributes, setExecutePendingIOUsingSelectorThread, setInet, setKeepAlive, setLinger, setLogger, setMaxAcceptRetries, setPort, setPortRange, setProtocolChainInstanceHandler, setReceiveBufferSize, setReuseAddress, setRole, setSelectionKeyHandler, setSelector, setSelectTimeout, setSendBufferSize, setServerTimeout, setSocketTimeout, setSsBackLog, setTcpNoDelay, setThreadPool, shutdown, workaroundSelectorSpin
 
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.SelectorHandler
acceptWithoutRegistration, acquireConnectorHandler, closeChannel, getAsyncQueueReader, getAsyncQueueWriter, getPreferredSelectionKeyHandler, getProtocolChainInstanceHandler, getSelectionKeyHandler, getSelector, getThreadPool, isOpen, keyFor, keys, onConnectInterest, onReadInterest, onWriteInterest, pause, postSelect, preSelect, protocol, register, register, register, releaseConnectorHandler, resume, select, setProtocolChainInstanceHandler, setSelectionKeyHandler, setSelector, setThreadPool, shutdown
 
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

SelectorThreadHandler

public SelectorThreadHandler()

SelectorThreadHandler

public SelectorThreadHandler(SelectorThread selectorThread)
Method Detail

copyTo

public void copyTo(Copyable copy)

Specified by:
copyTo in interface Copyable
Overrides:
copyTo in class TCPSelectorHandler

getSelectorThread

public SelectorThread getSelectorThread()
Specified by:
getSelectorThread in interface HttpSelectorHandler

setSelectorThread

public void setSelectorThread(SelectorThread selectorThread)
Specified by:
setSelectorThread in interface HttpSelectorHandler

configureChannel

public void configureChannel(SelectableChannel channel)
                      throws IOException
Specified by:
configureChannel in interface SelectorHandler
Overrides:
configureChannel in class TCPSelectorHandler
Throws:
IOException

onAcceptInterest

public boolean onAcceptInterest(SelectionKey key,
                                Context ctx)
                         throws IOException
Specified by:
onAcceptInterest in interface SelectorHandler
Overrides:
onAcceptInterest in class TCPSelectorHandler
Throws:
IOException


Copyright © 2010 Oracle Corpration. All Rights Reserved.