org.pm4j.core.pm.api
Class PmEventApi

java.lang.Object
  extended by org.pm4j.core.pm.api.PmEventApi

public class PmEventApi
extends java.lang.Object


Constructor Summary
PmEventApi()
           
 
Method Summary
static void addHierarchyListener(PmObject hierachyRootPm, int eventMask, PmEventListener listener)
           
static void addPmEventListener(PmObject pm, int eventMask, PmEventListener listener)
          The provided listener will receive PmEvent events whenever something happens that affects the given item.
static void addWeakPmEventListener(PmObject pm, int eventMask, PmEventListener listener)
           
static java.lang.Object ensureThreadEventSource(java.lang.Object param)
           
static void firePmEvent(PmObject pm, int eventMask)
          Creates and sends a PmEvent instance to each registered event listener.
static void firePmEvent(PmObject pm, PmEvent event)
           
static void firePmEventIfInitialized(PmObject pm, int eventMask)
           
static java.lang.Object getThreadEventSource()
           
static void removePmEventListener(PmObject pm, int eventMask, PmEventListener listener)
           
static void removePmEventListener(PmObject pm, PmEventListener listener)
          Removes the listener reference.
static java.lang.Object setThreadEventSource(java.lang.Object src)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PmEventApi

public PmEventApi()
Method Detail

addPmEventListener

public static void addPmEventListener(PmObject pm,
                                      int eventMask,
                                      PmEventListener listener)
The provided listener will receive PmEvent events whenever something happens that affects the given item.

This call generates only a weak reference to the listener. The calling code has to ensure the intended live time of the listener.

Parameters:
pm - The PM to observe
eventMask - A bit-mask that defines the kind of observed events. See the event kind constants in PmEvent.
listener - The listener that wants to get informed whenever the title changes.

addWeakPmEventListener

public static void addWeakPmEventListener(PmObject pm,
                                          int eventMask,
                                          PmEventListener listener)

addHierarchyListener

public static void addHierarchyListener(PmObject hierachyRootPm,
                                        int eventMask,
                                        PmEventListener listener)

removePmEventListener

public static void removePmEventListener(PmObject pm,
                                         PmEventListener listener)
Removes the listener reference.

Parameters:
listener - The listener to unregister.

removePmEventListener

public static void removePmEventListener(PmObject pm,
                                         int eventMask,
                                         PmEventListener listener)

firePmEvent

public static void firePmEvent(PmObject pm,
                               int eventMask)
Creates and sends a PmEvent instance to each registered event listener.

Parameters:
eventSource - The instance that triggered the event.

firePmEvent

public static void firePmEvent(PmObject pm,
                               PmEvent event)

firePmEventIfInitialized

public static void firePmEventIfInitialized(PmObject pm,
                                            int eventMask)

setThreadEventSource

public static java.lang.Object setThreadEventSource(java.lang.Object src)

getThreadEventSource

public static java.lang.Object getThreadEventSource()

ensureThreadEventSource

public static java.lang.Object ensureThreadEventSource(java.lang.Object param)