org.apache.mina.handler.chain

Class ChainedIoHandler

Implemented Interfaces:
IoHandler

public class ChainedIoHandler
extends IoHandlerAdapter

An IoHandler which executes an IoHandlerChain on a messageReceived event.

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, messageReceived, messageSent, sessionClosed, sessionCreated, sessionIdle, sessionOpened

Constructor Details

ChainedIoHandler

public ChainedIoHandler()

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 Details

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 interface IoHandlerAdapter