Class EventManager

java.lang.Object
com.groiss.event.EventManager

public class EventManager extends Object
The event-manager allows registrating for events, unregistrating, and raising events.
  • Field Details

    • CURRENT_TX

      public static final int CURRENT_TX
      execute event in current transaction
      See Also:
    • NEW_TX

      public static final int NEW_TX
      reserved for future use, execute event in a new transaction (not yet implemented)
      See Also:
  • Method Details

    • raiseEvent

      public static void raiseEvent(Event e)
      Raises an event.
      Parameters:
      e - the event
    • register

      public static long register(String name, Class<? extends IEventHandler> eh, Object context)
      Register an event handler
      Parameters:
      name - the name of the event
      eh - the class of the eventhandler, must be a subclass of EventHandler
      context - a context object
      Returns:
      the unique oid of this registration (use for unregister)
    • register

      public static long register(String name, Class<? extends IEventHandler> eh, Object context, ActivityInstance registrant)
      Register an event handler
      Parameters:
      name - the name of the event
      eh - the class of the eventhandler, must be a subclass of EventHandler
      context - a context object
      registrant - an activity of te registering process instance, or the process instance itself
      Returns:
      the unique oid of this registration (use for unregister)
    • unregister

      public static void unregister(long oid)
      unregister an event handler
    • unregister

      public static void unregister(String name, ProcessInstance registrant)
      Unregister all event handler for the named event.
      Parameters:
      name - the event name
      registrant - the process which registered
    • unregisterAll

      public static void unregisterAll(ProcessInstance registrant)
      unregister all event handlers of a process
    • unregisterAll

      public static void unregisterAll(ActivityInstance registrant)