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)
          Configure the channel operations.
 void copyTo(Copyable copy)
          Copies current object content to copy object
 SelectorThread getSelectorThread()
           
 boolean onAcceptInterest(SelectionKey key, Context ctx)
          Handle OP_ACCEPT.
 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)
Copies current object content to copy object

Specified by:
copyTo in interface Copyable
Overrides:
copyTo in class TCPSelectorHandler
Parameters:
copy - represents target object, where current object's content will be copied

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
Description copied from class: TCPSelectorHandler
Configure the channel operations.

Specified by:
configureChannel in interface SelectorHandler
Overrides:
configureChannel in class TCPSelectorHandler
Parameters:
channel - SelectableChannel to configure
Throws:
IOException - on possible configuration related error

onAcceptInterest

public boolean onAcceptInterest(SelectionKey key,
                                Context ctx)
                         throws IOException
Description copied from class: TCPSelectorHandler
Handle OP_ACCEPT.

Specified by:
onAcceptInterest in interface SelectorHandler
Overrides:
onAcceptInterest in class TCPSelectorHandler
Parameters:
key - SelectionKey
ctx - Context
Returns:
always returns false
Throws:
IOException


Copyright © 2012 Oracle Corporation. All Rights Reserved.