i3.dragos.core.services.events
Enum EventCouplingMode

java.lang.Object
  extended by java.lang.Enum<EventCouplingMode>
      extended by i3.dragos.core.services.events.EventCouplingMode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<EventCouplingMode>

public enum EventCouplingMode
extends java.lang.Enum<EventCouplingMode>

The constants in this class describe the different coupling modes between the occurence of an event, a transaction and the notification of the event listener.

Author:
Boris Boehlen <boehlen@cs.rwth-aachen.de>, Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>

Enum Constant Summary
AFTER_COMMIT
          The listener is informed when the changes have finally been committed to the database.
BEFORE_COMMIT
          The listener is notified after consistency checks, just before the transaction is committed to the data storage.
IMMEDIATE
          No delay between event detection and notification.
 
Method Summary
static EventCouplingMode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static EventCouplingMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

IMMEDIATE

public static final EventCouplingMode IMMEDIATE
No delay between event detection and notification. Consistency of the data is not ensured, and any modifications must be done very carefully!


BEFORE_COMMIT

public static final EventCouplingMode BEFORE_COMMIT
The listener is notified after consistency checks, just before the transaction is committed to the data storage. Since there can be multiple listeners, registering for this coupling mode does not guarantee that the data does not change anymore. If any listener modifies the data, this will generate another event, which will be added to the queue of events originally generated in the transaction, and processed like them too. Everytime after a listener received an event (and possibly modified the data), a consistency check is performed before the next listener or next event is processed, to ensure you can operate on consistent data when processing events in this coupling mode.


AFTER_COMMIT

public static final EventCouplingMode AFTER_COMMIT
The listener is informed when the changes have finally been committed to the database. This mode is the safest one: You can be sure that any event you receive actually happens/happened and is not undone by a rollback.

Method Detail

values

public static EventCouplingMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (EventCouplingMode c : EventCouplingMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static EventCouplingMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.