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

Quick Search    Search Deep

org.metacosm.framework.event
Class EventManager  view EventManager download EventManager.java

java.lang.Object
  extended byorg.metacosm.framework.event.EventManager

public final class EventManager
extends java.lang.Object

EventManager provides a singleton around util.EventDispatcher on the server side. There should be only one EventManager, event with multiple game, maybe by using a game prefix before event type. This class should be responsible to load the event type tree.


Field Summary
private  org.metacosm.util.MCEventDispatcher eventDispatcher
          MCEventDispatcher instance which does most of the work.
private static EventManager eventManager
          Instance variable for singleton pattern
static java.lang.String STRING_DEBUG
           
static java.lang.String STRING_DESCRIPTION
           
static java.lang.String STRING_SUBTYPE
           
static java.lang.String STRING_TIMESTAMP
           
static java.lang.String STRING_TYPE
           
 
Constructor Summary
private EventManager()
          Private constructor for singleton pattern
 
Method Summary
 void addListener(org.metacosm.util.MCEventListener el, java.lang.String msgType)
          Calls delegated to the MCEventDispatcher instance
static void debugLogEvent(java.lang.String subtype, java.lang.String description)
          Utility fonction to emit a debug log (event type="debug").
static void dispatchEvent(java.lang.String type, java.lang.String subtype, java.lang.String description)
          Utility fonction to emit a "real" event
static EventManager getInstance()
          public static access method for singleton pattern
private  void initEventTree()
          Configures the underlying MCEventDispatcher for the event types we will use.
 void notifyListeners(org.metacosm.util.MCEvent msg)
          Calls delegated to the MCEventDispatcher instance
 void removeListener(org.metacosm.util.MCEventListener el, java.lang.String msgType)
          Calls delegated to the MCEventDispatcher instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRING_DEBUG

public static final java.lang.String STRING_DEBUG
See Also:
Constant Field Values

STRING_TYPE

public static final java.lang.String STRING_TYPE
See Also:
Constant Field Values

STRING_SUBTYPE

public static final java.lang.String STRING_SUBTYPE
See Also:
Constant Field Values

STRING_DESCRIPTION

public static final java.lang.String STRING_DESCRIPTION
See Also:
Constant Field Values

STRING_TIMESTAMP

public static final java.lang.String STRING_TIMESTAMP
See Also:
Constant Field Values

eventManager

private static EventManager eventManager
Instance variable for singleton pattern


eventDispatcher

private org.metacosm.util.MCEventDispatcher eventDispatcher
MCEventDispatcher instance which does most of the work.

Constructor Detail

EventManager

private EventManager()
Private constructor for singleton pattern

Method Detail

getInstance

public static EventManager getInstance()
public static access method for singleton pattern


debugLogEvent

public static void debugLogEvent(java.lang.String subtype,
                                 java.lang.String description)
Utility fonction to emit a debug log (event type="debug").


dispatchEvent

public static void dispatchEvent(java.lang.String type,
                                 java.lang.String subtype,
                                 java.lang.String description)
Utility fonction to emit a "real" event


addListener

public void addListener(org.metacosm.util.MCEventListener el,
                        java.lang.String msgType)
Calls delegated to the MCEventDispatcher instance


removeListener

public void removeListener(org.metacosm.util.MCEventListener el,
                           java.lang.String msgType)
Calls delegated to the MCEventDispatcher instance


notifyListeners

public void notifyListeners(org.metacosm.util.MCEvent msg)
Calls delegated to the MCEventDispatcher instance


initEventTree

private void initEventTree()
Configures the underlying MCEventDispatcher for the event types we will use.