org.apache.mina.protocol.handler
Class DemuxingProtocolHandler

java.lang.Object
  extended by org.apache.mina.protocol.ProtocolHandlerAdapter
      extended by org.apache.mina.protocol.handler.DemuxingProtocolHandler
All Implemented Interfaces:
ProtocolHandler

public class DemuxingProtocolHandler
extends ProtocolHandlerAdapter

A ProtocolHandler that demuxes messageReceived events to the appropriate MessageHandler. You can freely register and deregister MessageHandlers using registerMessageType(Class, MessageHandler) and deregisterMessageType(Class).

Version:
$Rev: 264677 $, $Date: 2005-08-30 11:44:35 +0900 $
Author:
The Apache Directory Project

Constructor Summary
protected DemuxingProtocolHandler()
          Creates a new instance with no registered MessageHandlers.
 
Method Summary
 void deregisterMessageType(Class clazz)
          Deregisters a MessageHandler that receives the messages of the specified type.
 void messageReceived(ProtocolSession session, Object message)
          Forwards the received events into the appropriate MessageHandler which is registered by registerMessageType(Class, MessageHandler).
 void registerMessageType(Class type, MessageHandler handler)
          Registers 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

DemuxingProtocolHandler

protected DemuxingProtocolHandler()
Creates a new instance with no registered MessageHandlers.

Method Detail

registerMessageType

public void registerMessageType(Class type,
                                MessageHandler handler)
Registers a MessageHandler that receives the messages of the specified type.


deregisterMessageType

public void deregisterMessageType(Class clazz)
Deregisters a MessageHandler that receives the messages of the specified type.


messageReceived

public void messageReceived(ProtocolSession session,
                            Object message)
Forwards the received events into the appropriate MessageHandler which is registered by registerMessageType(Class, MessageHandler).

Specified by:
messageReceived in interface ProtocolHandler
Overrides:
messageReceived in class ProtocolHandlerAdapter


Copyright © 2004-2005 . All Rights Reserved.