org.mmbase.core.event
Class EventManager

java.lang.Object
  extended by org.mmbase.core.event.EventManager
All Implemented Interfaces:
EventListener, SystemEventListener

public class EventManager
extends Object
implements SystemEventListener

This class manages all event related stuff. it is the place to register event brokers, and it will propagate all events. The class is set up as a singleton. When the manager is instantiated, event brokers are added for Event, NodeEvent and RelationEvent

Since:
MMBase-1.8
Version:
$Id: EventManager.java 42770 2010-07-01 12:28:59Z michiel $
Author:
Ernst Bunders

Field Summary
static String DTD_EVENTMANAGER
           
static String PUBLIC_ID_EVENTMANAGER
           
protected  ResourceWatcher watcher
           
 
Method Summary
 void addEventBroker(EventBroker broker)
          add an event broker for a specific type of event
 void addEventListener(EventListener listener)
           
protected  void configure(String resource)
           
 Collection<EventBroker> getBrokers()
           
static EventManager getInstance()
          use this metod to get an instance of the event manager
static String getMachineName()
           
 long getNumberOfPropagatedEvents()
           
 long getPropagationCost()
           
 long getPropagationCostNs()
           
static UUID getUUID()
           
 void notify(SystemEvent se)
           
 void propagateEvent(Event event)
          This method will propagate the given event to all the aproprate listeners.
 void propagateEvent(Event event, boolean asynchronous)
          Like propagateEvent(org.mmbase.core.event.Event) but with an extra argument 'asynchronous'.
 void removeEventBroker(EventBroker broker)
          remove a broker for a specific type of event
 void removeEventListener(EventListener listener)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUBLIC_ID_EVENTMANAGER

public static final String PUBLIC_ID_EVENTMANAGER
See Also:
Constant Field Values

DTD_EVENTMANAGER

public static final String DTD_EVENTMANAGER
See Also:
Constant Field Values

watcher

protected ResourceWatcher watcher
Method Detail

getInstance

public static EventManager getInstance()
use this metod to get an instance of the event manager


getUUID

public static UUID getUUID()
Since:
MMBase-2.0

getMachineName

public static String getMachineName()
Since:
MMBase-2.0

notify

public void notify(SystemEvent se)
Specified by:
notify in interface SystemEventListener

configure

protected void configure(String resource)

getBrokers

public Collection<EventBroker> getBrokers()
Since:
MMBase-1.8.5

addEventBroker

public void addEventBroker(EventBroker broker)
add an event broker for a specific type of event

Parameters:
broker -

removeEventBroker

public void removeEventBroker(EventBroker broker)
remove a broker for a specific type of event

Parameters:
broker -

addEventListener

public void addEventListener(EventListener listener)
Parameters:
listener -

removeEventListener

public void removeEventListener(EventListener listener)
Parameters:
listener -

propagateEvent

public void propagateEvent(Event event)
This method will propagate the given event to all the aproprate listeners. what makes a listener apropriate is determined by it's type (class) and by possible constraint properties (if the handling broker supports those

Parameters:
event -
See Also:
AbstractEventBroker

propagateEvent

public void propagateEvent(Event event,
                           boolean asynchronous)
Like propagateEvent(org.mmbase.core.event.Event) but with an extra argument 'asynchronous'.

Parameters:
asynchronous - If true, execute the propagation in a different thread, and don't let this thread wait for the result.
Since:
MMBase-1.9.3

getNumberOfPropagatedEvents

public long getNumberOfPropagatedEvents()
Since:
MMBase-1.8.1

getPropagationCost

public long getPropagationCost()
Since:
MMBase-1.8.1

getPropagationCostNs

public long getPropagationCostNs()
Since:
MMBase-1.9

shutdown

public void shutdown()
Since:
MMBase-1.9


MMBase 2.0-SNAPSHOT - null