Package 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
AnIoHandlerwhich executes anIoHandlerChainon a messageReceived event.- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description ChainedIoHandler()Creates a new instance which contains an emptyIoHandlerChain.ChainedIoHandler(IoHandlerChain chain)Creates a new instance which executes the specifiedIoHandlerChainon a messageReceived event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IoHandlerChaingetChain()voidmessageReceived(IoSession session, java.lang.Object message)Handles the specified messageReceived event with theIoHandlerCommandorIoHandlerChainyou specified in the constructor.-
Methods inherited from class org.apache.mina.core.service.IoHandlerAdapter
event, exceptionCaught, inputClosed, messageSent, sessionClosed, sessionCreated, sessionIdle, sessionOpened
-
-
-
-
Constructor Detail
-
ChainedIoHandler
public ChainedIoHandler()
Creates a new instance which contains an emptyIoHandlerChain.
-
ChainedIoHandler
public ChainedIoHandler(IoHandlerChain chain)
Creates a new instance which executes the specifiedIoHandlerChainon a messageReceived event.- Parameters:
chain- anIoHandlerChainto execute
-
-
Method Detail
-
getChain
public IoHandlerChain getChain()
- Returns:
- the
IoHandlerCommandthis handler will use to handle messageReceived events.
-
messageReceived
public void messageReceived(IoSession session, java.lang.Object message) throws java.lang.Exception
Handles the specified messageReceived event with theIoHandlerCommandorIoHandlerChainyou specified in the constructor.- Specified by:
messageReceivedin interfaceIoHandler- Overrides:
messageReceivedin classIoHandlerAdapter- Parameters:
session- The session that is receiving a messagemessage- The received message- Throws:
java.lang.Exception- If we get an exception while processing the received message
-
-