Package org.apache.openjpa.event
Class LifecycleEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.apache.openjpa.event.LifecycleEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class LifecycleEvent extends java.util.EventObjectLifecycle 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intAFTER_ATTACHEvent type when an instance is attached.static intAFTER_CLEAREvent type when an instance is cleared.static intAFTER_DELETEEvent type when an instance is deleted.static intAFTER_DELETE_PERFORMEDEvent type when an instance is deleted, after the record has been deleted from the store.static intAFTER_DETACHEvent type when an instance is detached.static intAFTER_DIRTYEvent type when an instance is dirtied for the first time.static intAFTER_DIRTY_FLUSHEDEvent type when an instance is dirtied for the first time after flush.static intAFTER_LOADEvent type when an instance is loaded.static intAFTER_PERSISTEvent type when an instance is made persistentstatic intAFTER_PERSIST_PERFORMEDEvent type when an instance is made persistent, after the record has been written to the storestatic intAFTER_REFRESHEvent type when an instances is refreshed.static intAFTER_STOREEvent type when an instance is stored.static intAFTER_UPDATE_PERFORMEDEvent type when an instance is modified, after the change has been sent to the store.static int[]ALL_EVENTSConvenience array of all event types.static intBEFORE_ATTACHEvent type when an instance is attached.static intBEFORE_CLEAREvent type when an instance is cleared.static intBEFORE_DELETEEvent type when an instance is deleted.static intBEFORE_DETACHEvent type when an instance is detached.static intBEFORE_DIRTYEvent type when an instance is dirtied for the first time.static intBEFORE_DIRTY_FLUSHEDEvent type when an instance is dirtied for the first time after flush.static intBEFORE_PERSISTEvent type before an instance is made persistentstatic intBEFORE_STOREEvent type when an instance is stored.static intBEFORE_UPDATEEvent type when an instance is modified.
-
Constructor Summary
Constructors Constructor Description LifecycleEvent(java.lang.Object pc, int type)Constructor.LifecycleEvent(java.lang.Object pc, java.lang.Object related, int type)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetRelated()Return the related object.intgetType()Return the event type.
-
-
-
Field Detail
-
BEFORE_PERSIST
public static final int BEFORE_PERSIST
Event type before an instance is made persistent- See Also:
- Constant Field Values
-
AFTER_PERSIST
public static final int AFTER_PERSIST
Event type when an instance is made persistent- See Also:
- Constant Field Values
-
AFTER_PERSIST_PERFORMED
public static final int AFTER_PERSIST_PERFORMED
Event type when an instance is made persistent, after the record has been written to the store- See Also:
- Constant Field Values
-
AFTER_LOAD
public static final int AFTER_LOAD
Event type when an instance is loaded.- See Also:
- Constant Field Values
-
BEFORE_STORE
public static final int BEFORE_STORE
Event type when an instance is stored.- See Also:
- Constant Field Values
-
AFTER_STORE
public static final int AFTER_STORE
Event type when an instance is stored.- See Also:
- Constant Field Values
-
BEFORE_CLEAR
public static final int BEFORE_CLEAR
Event type when an instance is cleared.- See Also:
- Constant Field Values
-
AFTER_CLEAR
public static final int AFTER_CLEAR
Event type when an instance is cleared.- See Also:
- Constant Field Values
-
BEFORE_DELETE
public static final int BEFORE_DELETE
Event type when an instance is deleted.- See Also:
- Constant Field Values
-
AFTER_DELETE
public static final int AFTER_DELETE
Event type when an instance is deleted.- See Also:
- Constant Field Values
-
AFTER_DELETE_PERFORMED
public static final int AFTER_DELETE_PERFORMED
Event type when an instance is deleted, after the record has been deleted from the store.- See Also:
- Constant Field Values
-
BEFORE_DIRTY
public static final int BEFORE_DIRTY
Event type when an instance is dirtied for the first time.- See Also:
- Constant Field Values
-
AFTER_DIRTY
public static final int AFTER_DIRTY
Event type when an instance is dirtied for the first time.- See Also:
- Constant Field Values
-
BEFORE_DIRTY_FLUSHED
public static final int BEFORE_DIRTY_FLUSHED
Event type when an instance is dirtied for the first time after flush.- See Also:
- Constant Field Values
-
AFTER_DIRTY_FLUSHED
public static final int AFTER_DIRTY_FLUSHED
Event type when an instance is dirtied for the first time after flush.- See Also:
- Constant Field Values
-
BEFORE_DETACH
public static final int BEFORE_DETACH
Event type when an instance is detached.- See Also:
- Constant Field Values
-
AFTER_DETACH
public static final int AFTER_DETACH
Event type when an instance is detached.- See Also:
- Constant Field Values
-
BEFORE_ATTACH
public static final int BEFORE_ATTACH
Event type when an instance is attached.- See Also:
- Constant Field Values
-
AFTER_ATTACH
public static final int AFTER_ATTACH
Event type when an instance is attached.- See Also:
- Constant Field Values
-
AFTER_REFRESH
public static final int AFTER_REFRESH
Event type when an instances is refreshed.- See Also:
- Constant Field Values
-
BEFORE_UPDATE
public static final int BEFORE_UPDATE
Event type when an instance is modified. This is not invoked for PNEW records, but is invoked for PNEWFLUSHED.- See Also:
- Constant Field Values
-
AFTER_UPDATE_PERFORMED
public static final int AFTER_UPDATE_PERFORMED
Event 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:
- Constant Field Values
-
ALL_EVENTS
public static final int[] ALL_EVENTS
Convenience array of all event types.
-
-
Constructor Detail
-
LifecycleEvent
public LifecycleEvent(java.lang.Object pc, int type)Constructor.- Parameters:
pc- the persistent instance that triggered the eventtype- the event type
-
LifecycleEvent
public LifecycleEvent(java.lang.Object pc, java.lang.Object related, int type)Constructor.- Parameters:
pc- the persistent instance that triggered the eventtype- the event typerelated- the related instance such as the detached copy.
-
-