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
AnIoHandler
which executes anIoHandlerChain
on 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 specifiedIoHandlerChain
on a messageReceived event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IoHandlerChain
getChain()
void
messageReceived(IoSession session, Object message)
Handles the specified messageReceived event with theIoHandlerCommand
orIoHandlerChain
you specified in the constructor.-
Methods inherited from class org.apache.mina.core.service.IoHandlerAdapter
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 specifiedIoHandlerChain
on a messageReceived event.- Parameters:
chain
- anIoHandlerChain
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 theIoHandlerCommand
orIoHandlerChain
you specified in the constructor.- Specified by:
messageReceived
in interfaceIoHandler
- Overrides:
messageReceived
in 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
-
-