com.groiss.event
Class EventHandler

java.lang.Object
  extended by com.groiss.event.EventHandler

public class EventHandler
extends java.lang.Object

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.
 
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.

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.

Parameters:
handlerProc - the process instance which is registring
Returns:
This implementation returns true.


Copyright © 2001-2006 Groiss Informatics GmbH. All Rights Reserved.