com.groiss.event
Class EventManager

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

public class EventManager
extends java.lang.Object

The event-manager allows registrating for events, unregistrating, and raising events.


Field Summary
static int CURRENT_TX
          execute event in current transaction
static int NEW_TX
          reserved for future use, execute event in a new transaction (not yet implemented)
 
Constructor Summary
EventManager()
           
 
Method Summary
static void raiseEvent(Event e)
          Raises an event.
static long register(java.lang.String name, java.lang.Class<? extends IEventHandler> eh, java.lang.Object context)
          Register an event handler
static long register(java.lang.String name, java.lang.Class<? extends IEventHandler> eh, java.lang.Object context, ActivityInstance registrant)
          Register an event handler
static void unregister(long oid)
          unregister an event handler
static void unregister(java.lang.String name, ProcessInstance registrant)
          Unregister all event handler for the named event.
static void unregisterAll(ActivityInstance registrant)
           
static void unregisterAll(ProcessInstance registrant)
          unregister all event handlers of a process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENT_TX

public static final int CURRENT_TX
execute event in current transaction

See Also:
Constant Field Values

NEW_TX

public static final int NEW_TX
reserved for future use, execute event in a new transaction (not yet implemented)

See Also:
Constant Field Values
Constructor Detail

EventManager

public EventManager()
Method Detail

raiseEvent

public static void raiseEvent(Event e)
Raises an event.

Parameters:
e - the event

register

public static long register(java.lang.String name,
                            java.lang.Class<? extends IEventHandler> eh,
                            java.lang.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(java.lang.String name,
                            java.lang.Class<? extends IEventHandler> eh,
                            java.lang.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(java.lang.String name,
                              ProcessInstance registrant)
                       throws java.lang.Exception
Unregister all event handler for the named event.

Parameters:
name - the event name
registrant - the process which registered
Throws:
java.lang.Exception

unregisterAll

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


unregisterAll

public static void unregisterAll(ActivityInstance registrant)


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