Package org.apache.mina.handler.chain
Class ChainedIoHandler
java.lang.Object
org.apache.mina.common.IoHandlerAdapter
org.apache.mina.handler.chain.ChainedIoHandler
- All Implemented Interfaces:
IoHandler
An
IoHandler
which executes an IoHandlerChain
on a messageReceived event.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance which contains an emptyIoHandlerChain
.ChainedIoHandler
(IoHandlerChain chain) Creates a new instance which executes the specifiedIoHandlerChain
on a messageReceived event. -
Method Summary
Modifier and TypeMethodDescriptiongetChain()
Returns theIoHandlerCommand
this handler will use to handle messageReceived events.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.common.IoHandlerAdapter
exceptionCaught, messageSent, sessionClosed, sessionCreated, sessionIdle, sessionOpened
-
Constructor Details
-
ChainedIoHandler
public ChainedIoHandler()Creates a new instance which contains an emptyIoHandlerChain
. -
ChainedIoHandler
Creates a new instance which executes the specifiedIoHandlerChain
on a messageReceived event.- Parameters:
chain
- anIoHandlerChain
to execute
-
-
Method Details
-
getChain
Returns theIoHandlerCommand
this handler will use to handle messageReceived events. -
messageReceived
Handles the specified messageReceived event with theIoHandlerCommand
orIoHandlerChain
you specified in the constructor.- Specified by:
messageReceived
in interfaceIoHandler
- Overrides:
messageReceived
in classIoHandlerAdapter
- Throws:
Exception
-