org.apache.mina.handler.chain
Class ChainedIoHandler

java.lang.Object
  extended by org.apache.mina.core.service.IoHandlerAdapter
      extended by 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.

Version:
$Rev: 671827 $, $Date: 2008-06-26 10:49:48 +0200 (jeu, 26 jun 2008) $
Author:
The Apache MINA Project (dev@mina.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.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-2008 Apache MINA Project. All Rights Reserved.