com.groiss.event
Class EventHandler

java.lang.Object
  extended by com.groiss.event.EventHandler
All Implemented Interfaces:
IEventHandler
Direct Known Subclasses:
ExceptionHandlingCompletedHandler

public class EventHandler
extends java.lang.Object
implements IEventHandler

The base class for an event handler.


Constructor Summary
EventHandler()
           
 
Method Summary
 boolean handle(Event e, ProcessInstance handlerProc, EventRegistry reg)
          The handle method is called when an event is raised and a handler has been registered.
 boolean onRegister(ProcessInstance handlerProc)
          This method is called when you register this handler.
 void onUnregister(EventRegistry reg)
          This method is called when the handler is unregistered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventHandler

public EventHandler()
Method Detail

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 >= 2) and returns true. The return value is used only in "sync" event handlers, where returning true immediatly finishs the activity and ungegisters 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(ProcessInstance handlerProc)
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
Parameters:
handlerProc - the process instance which is registring
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


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.