## com.sun.grizzly
Class ReadController

    java.lang.Object
      com.sun.grizzly.Controller
          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.Protocol`

Field Summary

Fields inherited from class com.sun.grizzly.Controller
`attributes, connectorHandlerPool, instanceHandler, multiReadThreadSelectorHandler, readThreadControllers, readThreadsCount, readySelectorHandlerCounter, selectionKeyHandler, selectorHandlers, stateHolder, stateListeners, stoppedSelectorHandlerCounter`

Constructor Summary
`ReadController()`

Method Summary
`void` `addChannel(SelectableChannel channel, SelectorHandler selectorHandler)` Add a `Channel` to be processed by`ReadController`'s `SelectorHandler`
`SelectorHandler` `getSelectorHandlerClone(SelectorHandler selectorHandler)` Gets `SelectorHandler`'s clone, registered on this`ReadController`
`void` `removeSelectorHandlerClone(SelectorHandler selectorHandler)` Removes `SelectorHandler`'s clone, registered on this`ReadController`
`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, doSelect, getAttribute, getAttributes, getConnectorHandlerPool, getHandlerController, getPipeline, getProtocolChainInstanceHandler, getReadThreadsCount, getSelectionKeyHandler, getSelectorHandler, getSelectorHandler, getSelectorHandlers, getStateHolder, isHandleReadWriteConcurrently, isStarted, logger, pause, pollContext, pollContext, registerKey, registerKey, registerKey, releaseConnectorHandler, removeAttribute, removeSelectorHandler, removeStateListener, resume, returnContext, run, setAttribute, setAttributes, setConnectorHandlerPool, setHandleReadWriteConcurrently, setLogger, setPipeline, setProtocolChainInstanceHandler, setReadThreadsCount, setSelectionKeyHandler, setSelectorHandler, stop, waitUntilSeletorHandlersStop`

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 this`ReadController`

  Parameters:
    `selectorHandler` - original `SelectorHandler`
  Returns:
    passed `SelectorHandler` clone, registered on this`ReadController`

### removeSelectorHandlerClone

    public void removeSelectorHandlerClone(SelectorHandler selectorHandler)

  Removes `SelectorHandler`'s clone, registered on this`ReadController`

  Parameters:
    `selectorHandler` -

### addChannel

    public void addChannel(SelectableChannel channel,
                           SelectorHandler selectorHandler)

  Add a `Channel` to be processed by`ReadController`'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 Pipeline 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 © 2008 SUN Microsystems. All Rights Reserved.