org.apache.mina.handler.chain

## Class ChainedIoHandler

- java.lang.Object
- - org.apache.mina.core.service.IoHandlerAdapter
  - - org.apache.mina.handler.chain.ChainedIoHandler

- All Implemented Interfaces:
    IoHandler

      public class ChainedIoHandler
      extends IoHandlerAdapter

  An `IoHandler` which executes an `IoHandlerChain` on a `messageReceived` event.
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChainedIoHandler()` Creates a new instance which contains an empty `IoHandlerChain`.
    `ChainedIoHandler(IoHandlerChain chain)` Creates a new instance which executes the specified `IoHandlerChain` on a `messageReceived` event.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IoHandlerChain` | `getChain()` Returns the `IoHandlerCommand` this handler will use to handle `messageReceived` events.
    `void` | `messageReceived(IoSession session, Object message)` Handles the specified `messageReceived` event with the `IoHandlerCommand` or `IoHandlerChain` you specified in the constructor.

    - ### Methods inherited from class org.apache.mina.core.service.IoHandlerAdapter

      `exceptionCaught, messageSent, sessionClosed, sessionCreated, sessionIdle, sessionOpened`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ChainedIoHandler

          public ChainedIoHandler()

      Creates a new instance which contains an empty `IoHandlerChain`.

    - #### ChainedIoHandler

          public ChainedIoHandler(IoHandlerChain chain)

      Creates a new instance which executes the specified `IoHandlerChain` on a `messageReceived` event.
      Parameters:
        `chain` - an `IoHandlerChain` to execute

  - ### Method Detail

    - #### getChain

          public IoHandlerChain getChain()

      Returns the `IoHandlerCommand` this handler will use to handle `messageReceived` events.

    - #### messageReceived

          public void messageReceived(IoSession session,
                             Object message)
                               throws Exception

      Handles the specified `messageReceived` event with the `IoHandlerCommand` or `IoHandlerChain` you specified in the constructor.
      Specified by:
        `messageReceived` in interface `IoHandler`
      Overrides:
        `messageReceived` in class `IoHandlerAdapter`
      Throws:
        `Exception`

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.