Package org.apache.openjpa.event
Class TransactionEvent
java.lang.Object
java.util.EventObject
org.apache.openjpa.event.TransactionEvent
- All Implemented Interfaces:
Serializable
A transactional event. The event source is the
Broker
whose
transaction state changed.- Since:
- 0.3.0
- Author:
- Abe White
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Event type signifying that a transaction has just begun.static final int
Event type signifying that the transaction has committed.static final int
Event type signifying that the commit has completey ended and the transaction is no longer active.static final int
Event type signifying that changes have been flushed to the datastore.static final int
Event type signifying that the transaction was rolled back.static final int
Event type signifying that the rollback has completey ended and the transaction is no longer active.static final int
Event type signifying that all state transitions have been made.static final int
Event type signifying that the transaction is about to be committed.static final int
Event type signifying that changes are about to be flushed to the datastore.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionTransactionEvent
(Broker broker, int type, Collection objs, Collection addClss, Collection updateClss, Collection deleteClss) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturn the unmodifiable the set of classes of persistence capable objects that were deleted in the transaction.Return the unmodifiable the set of classes of persistence capable objects that were created in the transaction.Return the unmodifiable set of persistence capable objects participating in the transaction.int
getType()
Return the type of event.Return the unmodifiable the set of classes of persistence capable objects that were modified in the transaction.Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
AFTER_BEGIN
public static final int AFTER_BEGINEvent type signifying that a transaction has just begun.- See Also:
-
BEFORE_FLUSH
public static final int BEFORE_FLUSHEvent type signifying that changes are about to be flushed to the datastore. This does not necessarily mean that a commit is taking place.- See Also:
-
AFTER_FLUSH
public static final int AFTER_FLUSHEvent type signifying that changes have been flushed to the datastore. This event is only fired if flushing is successful.- See Also:
-
BEFORE_COMMIT
public static final int BEFORE_COMMITEvent type signifying that the transaction is about to be committed. This will be fired before theBEFORE_FLUSH
event for the transaction, so that you can differentiate between flushes for commits and other flushes.- See Also:
-
AFTER_COMMIT
public static final int AFTER_COMMITEvent type signifying that the transaction has committed.- See Also:
-
AFTER_ROLLBACK
public static final int AFTER_ROLLBACKEvent type signifying that the transaction was rolled back.- See Also:
-
AFTER_STATE_TRANSITIONS
public static final int AFTER_STATE_TRANSITIONSEvent type signifying that all state transitions have been made.- See Also:
-
AFTER_COMMIT_COMPLETE
public static final int AFTER_COMMIT_COMPLETEEvent type signifying that the commit has completey ended and the transaction is no longer active.- See Also:
-
AFTER_ROLLBACK_COMPLETE
public static final int AFTER_ROLLBACK_COMPLETEEvent type signifying that the rollback has completey ended and the transaction is no longer active.- See Also:
-
-
Constructor Details
-
TransactionEvent
public TransactionEvent(Broker broker, int type, Collection objs, Collection addClss, Collection updateClss, Collection deleteClss) Constructor.- Parameters:
broker
- the event sourcetype
- the event typeobjs
- transactional objectsaddClss
- classes of added instancesupdateClss
- classes of updated instancesdeleteClss
- classes of deleted instances
-
-
Method Details
-
getType
public int getType()Return the type of event. -
getTransactionalObjects
Return the unmodifiable set of persistence capable objects participating in the transaction. This set will contain all dirty objects, but may not contain clean objects. -
getPersistedTypes
Return the unmodifiable the set of classes of persistence capable objects that were created in the transaction. -
getUpdatedTypes
Return the unmodifiable the set of classes of persistence capable objects that were modified in the transaction. -
getDeletedTypes
Return the unmodifiable the set of classes of persistence capable objects that were deleted in the transaction.
-