Package com.groiss.event
Class EventManager
java.lang.Object
com.groiss.event.EventManager
The event-manager allows registrating for events, unregistrating, and
raising events.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
execute event in current transactionstatic final int
reserved for future use, execute event in a new transaction (not yet implemented) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
raiseEvent
(Event e) Raises an event.static long
register
(String name, Class<? extends IEventHandler> eh, Object context) Register an event handlerstatic long
register
(String name, Class<? extends IEventHandler> eh, Object context, ActivityInstance registrant) Register an event handlerstatic void
unregister
(long oid) unregister an event handlerstatic void
unregister
(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
-
Field Details
-
CURRENT_TX
public static final int CURRENT_TXexecute event in current transaction- See Also:
-
NEW_TX
public static final int NEW_TXreserved for future use, execute event in a new transaction (not yet implemented)- See Also:
-
-
Method Details
-
raiseEvent
Raises an event.- Parameters:
e
- the event
-
register
Register an event handler- Parameters:
name
- the name of the eventeh
- the class of the eventhandler, must be a subclass of EventHandlercontext
- a context object- Returns:
- the unique oid of this registration (use for unregister)
-
register
public static long register(String name, Class<? extends IEventHandler> eh, Object context, ActivityInstance registrant) Register an event handler- Parameters:
name
- the name of the eventeh
- the class of the eventhandler, must be a subclass of EventHandlercontext
- a context objectregistrant
- 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
Unregister all event handler for the named event.- Parameters:
name
- the event nameregistrant
- the process which registered
-
unregisterAll
unregister all event handlers of a process -
unregisterAll
-