service
Class MessageDispatcher

java.lang.Object
  extended by service.MessageDispatcher

public class MessageDispatcher
extends java.lang.Object


Field Summary
protected  java.util.HashMap<MessageType,SynchronizedBuffer> serviceMap
          This hash map associates a buffer to each type of message
 
Constructor Summary
MessageDispatcher()
           
 
Method Summary
 SynchronizedBuffer<Message> associateService(MessageType type)
          For a given message type, create and associate a dedicated buffer
 void newEvent(TypedMessage msg)
          Depending on the type of the message, put this message in the associated buffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceMap

protected java.util.HashMap<MessageType,SynchronizedBuffer> serviceMap
This hash map associates a buffer to each type of message

Constructor Detail

MessageDispatcher

public MessageDispatcher()
Method Detail

associateService

public SynchronizedBuffer<Message> associateService(MessageType type)
For a given message type, create and associate a dedicated buffer

Parameters:
type - the type of the message
Returns:
the buffer associated with this message type

newEvent

public void newEvent(TypedMessage msg)
Depending on the type of the message, put this message in the associated buffer

Parameters:
msg - the message to dispatch to the associated buffer