|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.mina.protocol.ProtocolHandlerAdapter
org.apache.mina.protocol.handler.DemuxingProtocolHandler
public class DemuxingProtocolHandler
A ProtocolHandler that demuxes messageReceived events
to the appropriate MessageHandler.
You can freely register and deregister MessageHandlers using
addMessageHandler(Class, MessageHandler) and
removeMessageHandler(Class).
| Constructor Summary | |
|---|---|
protected |
DemuxingProtocolHandler()
Creates a new instance with no registered MessageHandlers. |
| Method Summary | |
|---|---|
MessageHandler |
addMessageHandler(java.lang.Class type,
MessageHandler handler)
Registers a MessageHandler that receives the messages of
the specified type. |
MessageHandler |
getMessageHandler(java.lang.Class type)
Returns the MessageHandler which is registered to process
the specified type. |
java.util.Map |
getMessageHandlerMap()
Returns the Map which contains all messageType-MessageHandler
pairs registered to this handler. |
void |
messageReceived(ProtocolSession session,
java.lang.Object message)
Forwards the received events into the appropriate MessageHandler
which is registered by addMessageHandler(Class, MessageHandler). |
MessageHandler |
removeMessageHandler(java.lang.Class type)
Deregisters a MessageHandler that receives the messages of
the specified type. |
| Methods inherited from class org.apache.mina.protocol.ProtocolHandlerAdapter |
|---|
exceptionCaught, messageSent, sessionClosed, sessionCreated, sessionIdle, sessionOpened |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected DemuxingProtocolHandler()
MessageHandlers.
| Method Detail |
|---|
public MessageHandler addMessageHandler(java.lang.Class type,
MessageHandler handler)
MessageHandler that receives the messages of
the specified type.
public MessageHandler removeMessageHandler(java.lang.Class type)
MessageHandler that receives the messages of
the specified type.
public MessageHandler getMessageHandler(java.lang.Class type)
MessageHandler which is registered to process
the specified type.
public java.util.Map getMessageHandlerMap()
Map which contains all messageType-MessageHandler
pairs registered to this handler.
public void messageReceived(ProtocolSession session,
java.lang.Object message)
MessageHandler
which is registered by addMessageHandler(Class, MessageHandler).
messageReceived in interface ProtocolHandlermessageReceived in class ProtocolHandlerAdapter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||