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
- 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 amessageReceivedevent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IoHandlerChaingetChain()voidmessageReceived(IoSession session, Object message)Handles the specifiedmessageReceivedevent 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 amessageReceivedevent.- Parameters:
chain- anIoHandlerChainto execute
-
-
Method Detail
-
getChain
public IoHandlerChain getChain()
- Returns:
- the
IoHandlerCommandthis handler will use to handlemessageReceivedevents.
-
messageReceived
public void messageReceived(IoSession session, Object message) throws Exception
Handles the specifiedmessageReceivedevent 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:
Exception- If we get an exception while processing the received message
-
-