org.apache.mina.protocol.handler
Class DemuxingProtocolHandler

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

public abstract class DemuxingProtocolHandler
extends Object
implements ProtocolHandler

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: 188659 $, $Date: 2005-06-07 10:35:54 +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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.mina.protocol.ProtocolHandler
exceptionCaught, messageSent, sessionClosed, sessionCreated, sessionIdle, sessionOpened
 

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


Copyright © 2004-2005 . All Rights Reserved.