Class EventHandler

java.lang.Object
com.groiss.event.EventHandler
All Implemented Interfaces:
IEventHandler

public class EventHandler extends Object implements IEventHandler
The base class for an event handler.
  • Constructor Details

    • EventHandler

      public EventHandler()
  • Method Details

    • handle

      public boolean handle(Event e, ProcessInstance handlerProc, EventRegistry reg)
      The handle method is called when an event is raised and a handler has been registered. This method only writes a message to the log (log level >= DEBUG) and returns true. The return value is used only in "sync" event handlers, where returning true immediately finishes the activity and unregisters the handler.
      Specified by:
      handle in interface IEventHandler
      Parameters:
      e - the raised event
      handlerProc - the process instance which has registered for the event.
      reg - the event registry entry
      Returns:
      this implementation returns true
    • onRegister

      public boolean onRegister()
      This method is called when you register this handler. It does nothing. If the method returns false, the event is not registered. In sync event handlers returning false finishes the step.
      Specified by:
      onRegister in interface IEventHandler
      Returns:
      This implementation returns true.
    • onUnregister

      public void onUnregister(EventRegistry reg)
      Description copied from interface: IEventHandler
      This method is called when the handler is unregistered.
      Specified by:
      onUnregister in interface IEventHandler