com.sun.grizzly
Class ReadController

java.lang.Object
  extended by com.sun.grizzly.Controller
      extended by com.sun.grizzly.ReadController
All Implemented Interfaces:
ConnectorHandlerPool, Lifecycle, AttributeHolder, Copyable, SupportStateHolder<State>, Runnable

public class ReadController
extends Controller

ReadController class represents Controller, which is not itself independent. Should be used for handling OP_READ operations Supports TCP derived protocols

Author:
Alexey Stashok

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.grizzly.Controller
Controller.KernelExecutorFactory, Controller.Protocol
 
Field Summary
 
Fields inherited from class com.sun.grizzly.Controller
attributes, connectorHandlerPool, instanceHandler, logger, multiReadThreadSelectorHandler, readThreadControllers, readThreadsCount, readySelectorHandlerCounter, selectionKeyHandler, selectorHandlers, stateHolder, stateListeners, stoppedSelectorHandlerCounter, threadPool
 
Constructor Summary
ReadController()
           
 
Method Summary
 void addChannel(SelectableChannel channel, SelectorHandler selectorHandler)
          Add a Channel to be processed byReadController's SelectorHandler
 SelectorHandler getSelectorHandlerClone(SelectorHandler selectorHandler)
          Gets SelectorHandler's clone, registered on thisReadController
 void removeSelectorHandlerClone(SelectorHandler selectorHandler)
          Removes SelectorHandler's clone, registered on thisReadController
 void start()
          Start the Controller.
 void stop()
          Stop the Controller by canceling all the registered keys.
 
Methods inherited from class com.sun.grizzly.Controller
acquireConnectorHandler, addSelectorHandler, addStateListener, cancelKey, configureContext, copyTo, createKernelExecutor, executeUsingKernelExecutor, executeUsingKernelExecutor, getAttribute, getAttributes, getConnectorHandlerPool, getHandlerController, getKernelExecutorFactory, getProtocolChainInstanceHandler, getReadThreadsCount, getSelectionKeyHandler, getSelectorHandler, getSelectorHandler, getSelectorHandlers, getStateHolder, getThreadPool, isAllowContextCaching, isAutoConfigure, isExecutePendingIOUsingSelectorThread, isHandleReadWriteConcurrently, isStarted, logger, logVersion, notifyException, notifyReady, notifyStarted, notifyStopped, pause, pollContext, registerKey, registerKey, registerKey, releaseConnectorHandler, removeAttribute, removeSelectorHandler, removeStateListener, resume, returnContext, run, setAllowContextCaching, setAttribute, setAttributes, setAutoConfigure, setConnectorHandlerPool, setDisplayConfiguration, setExecutePendingIOUsingSelectorThread, setHandleReadWriteConcurrently, setKernelExecutorFactory, setLogger, setMaxAcceptRetries, setProtocolChainInstanceHandler, setReadThreadsCount, setSelectionKeyHandler, setSelectorHandler, setThreadPool, startSelectorHandlerRunner, stop, useLeaderFollowerStrategy, useLeaderFollowerStrategy, waitUntilSelectorHandlersStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadController

public ReadController()
Method Detail

getSelectorHandlerClone

public SelectorHandler getSelectorHandlerClone(SelectorHandler selectorHandler)
Gets SelectorHandler's clone, registered on thisReadController

Parameters:
selectorHandler - original SelectorHandler
Returns:
passed SelectorHandler clone, registered on thisReadController

removeSelectorHandlerClone

public void removeSelectorHandlerClone(SelectorHandler selectorHandler)
Removes SelectorHandler's clone, registered on thisReadController

Parameters:
selectorHandler -

addChannel

public void addChannel(SelectableChannel channel,
                       SelectorHandler selectorHandler)
Add a Channel to be processed byReadController's SelectorHandler

Parameters:
channel - new channel to be managed by ReadController
protocol - name of the protocol channel corresponds to

start

public void start()
           throws IOException
Start the Controller. If the thread pool and/or Handler has not been defined, the default will be used.

Specified by:
start in interface Lifecycle
Overrides:
start in class Controller
Throws:
IOException

stop

public void stop()
          throws IOException
Stop the Controller by canceling all the registered keys.

Specified by:
stop in interface Lifecycle
Overrides:
stop in class Controller
Throws:
IOException


Copyright © 2012 Oracle Corporation. All Rights Reserved.