org.apache.mina.handler.chain
Class ChainedIoHandler

java.lang.Object
  extended byorg.apache.mina.common.IoHandlerAdapter
      extended byorg.apache.mina.handler.chain.ChainedIoHandler
All Implemented Interfaces:
IoHandler

public class ChainedIoHandler
extends IoHandlerAdapter

An IoHandler which executes an IoHandlerChain on a messageReceived event.

Version:
$Rev: 436993 $, $Date: 2006-08-26 00:36:56 +0200 (Sat, 26 Aug 2006) $
Author:
The Apache Directory Project (mina-dev@directory.apache.org)

Constructor Summary
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
 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.common.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