Package org.apache.mina.handler.demux
Interface MessageHandler<M>
-
- Type Parameters:
M- The message type
public interface MessageHandler<M>A handler interface thatDemuxingIoHandlerforwards messageReceived or messageSent events to. You have to register your handler with the type of the message you want to get notified usingDemuxingIoHandler.addReceivedMessageHandler(Class, MessageHandler)orDemuxingIoHandler.addSentMessageHandler(Class, MessageHandler).- Author:
- Apache MINA Project
-
-
Field Summary
Fields Modifier and Type Field Description static MessageHandler<java.lang.Object>NOOPAMessageHandlerthat does nothing.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidhandleMessage(IoSession session, M message)Invoked when the specific type of message is received from or sent to the specifiedsession.
-
-
-
Field Detail
-
NOOP
static final MessageHandler<java.lang.Object> NOOP
AMessageHandlerthat does nothing. This is useful when you want to ignore a message of a specific type silently.
-
-
Method Detail
-
handleMessage
void handleMessage(IoSession session, M message) throws java.lang.Exception
Invoked when the specific type of message is received from or sent to the specifiedsession.- Parameters:
session- the associatedIoSessionmessage- the message to decode. Its type is set by the implementation- Throws:
java.lang.Exception- if there is an error during the message processing
-
-