Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.metacosm.util
Class MCEventDispatcher  view MCEventDispatcher download MCEventDispatcher.java

java.lang.Object
  extended byorg.metacosm.util.MCEventDispatcher

public class MCEventDispatcher
extends java.lang.Object

EventDispatcher should be able to route message to registered listeners according to the message type. Ideally, types should be ordered in a tree, to allow listeners to register simply to a whole family of message (not implemented yet)


Field Summary
private  java.util.Map listenersByMsgType
           
private  java.util.Set listenersToAll
           
 
Constructor Summary
MCEventDispatcher()
           
 
Method Summary
 void addListener(MCEventListener el, java.lang.String msgType)
           
 void notifyListeners(MCEvent adminMessage)
           
 void removeListener(MCEventListener el, java.lang.String msgType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenersToAll

private java.util.Set listenersToAll

listenersByMsgType

private java.util.Map listenersByMsgType
Constructor Detail

MCEventDispatcher

public MCEventDispatcher()
Method Detail

addListener

public void addListener(MCEventListener el,
                        java.lang.String msgType)

removeListener

public void removeListener(MCEventListener el,
                           java.lang.String msgType)

notifyListeners

public void notifyListeners(MCEvent adminMessage)