Package com.groiss.event
Class EventHandler
java.lang.Object
com.groiss.event.EventHandler
- All Implemented Interfaces:
IEventHandler
The base class for an event handler.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
handle
(Event e, ProcessInstance handlerProc, EventRegistry reg) The handle method is called when an event is raised and a handler has been registered.boolean
This method is called when you register this handler.void
This method is called when the handler is unregistered.
-
Constructor Details
-
EventHandler
public EventHandler()
-
-
Method Details
-
handle
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 interfaceIEventHandler
- Parameters:
e
- the raised eventhandlerProc
- 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 interfaceIEventHandler
- Returns:
- This implementation returns true.
-
onUnregister
Description copied from interface:IEventHandler
This method is called when the handler is unregistered.- Specified by:
onUnregister
in interfaceIEventHandler
-