Package org.apache.openjpa.event
Class LifecycleEvent
java.lang.Object
java.util.EventObject
org.apache.openjpa.event.LifecycleEvent
- All Implemented Interfaces:
Serializable
Lifecycle event on a persistent instance. The event source
is the persistent instance whose state has changed.
- Since:
- 0.3.3
- Author:
- Steve Kim, Abe White
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Event type when an instance is attached.static final int
Event type when an instance is cleared.static final int
Event type when an instance is deleted.static final int
Event type when an instance is deleted, after the record has been deleted from the store.static final int
Event type when an instance is detached.static final int
Event type when an instance is dirtied for the first time.static final int
Event type when an instance is dirtied for the first time after flush.static final int
Event type when an instance is loaded.static final int
Event type when an instance is made persistentstatic final int
Event type when an instance is made persistent, after the record has been written to the storestatic final int
Event type when an instances is refreshed.static final int
Event type when an instance is stored.static final int
Event type when an instance is modified, after the change has been sent to the store.static final int[]
Convenience array of all event types.static final int
Event type when an instance is attached.static final int
Event type when an instance is cleared.static final int
Event type when an instance is deleted.static final int
Event type when an instance is detached.static final int
Event type when an instance is dirtied for the first time.static final int
Event type when an instance is dirtied for the first time after flush.static final int
Event type before an instance is made persistentstatic final int
Event type when an instance is stored.static final int
Event type when an instance is modified.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionLifecycleEvent
(Object pc, int type) Constructor.LifecycleEvent
(Object pc, Object related, int type) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturn the related object.int
getType()
Return the event type.Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
BEFORE_PERSIST
public static final int BEFORE_PERSISTEvent type before an instance is made persistent- See Also:
-
AFTER_PERSIST
public static final int AFTER_PERSISTEvent type when an instance is made persistent- See Also:
-
AFTER_PERSIST_PERFORMED
public static final int AFTER_PERSIST_PERFORMEDEvent type when an instance is made persistent, after the record has been written to the store- See Also:
-
AFTER_LOAD
public static final int AFTER_LOADEvent type when an instance is loaded.- See Also:
-
BEFORE_STORE
public static final int BEFORE_STOREEvent type when an instance is stored.- See Also:
-
AFTER_STORE
public static final int AFTER_STOREEvent type when an instance is stored.- See Also:
-
BEFORE_CLEAR
public static final int BEFORE_CLEAREvent type when an instance is cleared.- See Also:
-
AFTER_CLEAR
public static final int AFTER_CLEAREvent type when an instance is cleared.- See Also:
-
BEFORE_DELETE
public static final int BEFORE_DELETEEvent type when an instance is deleted.- See Also:
-
AFTER_DELETE
public static final int AFTER_DELETEEvent type when an instance is deleted.- See Also:
-
AFTER_DELETE_PERFORMED
public static final int AFTER_DELETE_PERFORMEDEvent type when an instance is deleted, after the record has been deleted from the store.- See Also:
-
BEFORE_DIRTY
public static final int BEFORE_DIRTYEvent type when an instance is dirtied for the first time.- See Also:
-
AFTER_DIRTY
public static final int AFTER_DIRTYEvent type when an instance is dirtied for the first time.- See Also:
-
BEFORE_DIRTY_FLUSHED
public static final int BEFORE_DIRTY_FLUSHEDEvent type when an instance is dirtied for the first time after flush.- See Also:
-
AFTER_DIRTY_FLUSHED
public static final int AFTER_DIRTY_FLUSHEDEvent type when an instance is dirtied for the first time after flush.- See Also:
-
BEFORE_DETACH
public static final int BEFORE_DETACHEvent type when an instance is detached.- See Also:
-
AFTER_DETACH
public static final int AFTER_DETACHEvent type when an instance is detached.- See Also:
-
BEFORE_ATTACH
public static final int BEFORE_ATTACHEvent type when an instance is attached.- See Also:
-
AFTER_ATTACH
public static final int AFTER_ATTACHEvent type when an instance is attached.- See Also:
-
AFTER_REFRESH
public static final int AFTER_REFRESHEvent type when an instances is refreshed.- See Also:
-
BEFORE_UPDATE
public static final int BEFORE_UPDATEEvent type when an instance is modified. This is not invoked for PNEW records, but is invoked for PNEWFLUSHED.- See Also:
-
AFTER_UPDATE_PERFORMED
public static final int AFTER_UPDATE_PERFORMEDEvent type when an instance is modified, after the change has been sent to the store. This is not invoked for PNEW records, but is invoked for PNEWFLUSHED records.- See Also:
-
ALL_EVENTS
public static final int[] ALL_EVENTSConvenience array of all event types.
-
-
Constructor Details
-
LifecycleEvent
Constructor.- Parameters:
pc
- the persistent instance that triggered the eventtype
- the event type
-
LifecycleEvent
Constructor.- Parameters:
pc
- the persistent instance that triggered the eventtype
- the event typerelated
- the related instance such as the detached copy.
-
-
Method Details
-
getType
public int getType()Return the event type. -
getRelated
Return the related object.
-