javax.jdo.listener.InstanceLifecycleEvent - JDO class
javax.jdo.listener
Class InstanceLifecycleEvent
java.lang.Object
java.util.EventObject
javax.jdo.listener.InstanceLifecycleEvent
- Implemented Interfaces:
-
Serializable
This is the event class used in life cycle event notifications.
Note that although InstanceLifecycleEvent inherits Serializable interface from EventObject, it is not intended to be Serializable. Appropriate serialization methods are implemented to throw NotSerializableException.
- Since:
- JDO 2.0
int ATTACH
- Since:
- JDO 2.0
int CLEAR
- Since:
- JDO 2.0
int CREATE
- Since:
- JDO 2.0
int DELETE
- Since:
- JDO 2.0
int DETACH
- Since:
- JDO 2.0
int DIRTY
- Since:
- JDO 2.0
int LOAD
- Since:
- JDO 2.0
int STORE
- Since:
- JDO 2.0
InstanceLifecycleEvent(Object source, int type)
Creates a new event object with the specified
source
and type
. - Parameters:
-
source
- the instance that triggered the eventtype
- the event type
- Since:
- JDO 2.0
InstanceLifecycleEvent(Object source, int type, Object target)
Creates a new event object with the specified
source
, type
, and target
. - Parameters:
-
source
- the instance that triggered the eventtype
- the event typetarget
- the "other" instance
- Since:
- JDO 2.0
Object getDetachedInstance()
Returns the detached instance involved in the event.
- Returns:
- The detached instance involved in the event, or null if there was none.
- Since:
- JDO 2.0
- See Also:
-
"Section 12.15, Java Data Objects 2.0 Specification"
int getEventType()
Returns the event type that triggered this event.
- Returns:
- the event type
- Since:
- JDO 2.0
Object getPersistentInstance()
Returns the persistent instance involved in the event.
- Returns:
- The persistent instance involved in the event, or null if there was none.
- Since:
- JDO 2.0
- See Also:
-
"Section 12.15, Java Data Objects 2.0 Specification"
Object getSource()
Object getSource()
The source object of the Event. Although not deprecated, it is recommended that the the methods
getPersistentInstance()
and getDetachedInstance()
be used instead. - Returns:
- The persistent instance on any pre- callback except preAttach, or the detached instance for a postDetach or preAttach callback.
- Since:
- JDO 2.0
- See Also:
- getPersistentInstance()
- getDetachedInstance()
"Section 12.15, Java Data Objects 2.0 Specification"
- getDetachedInstance()
Object getTarget()
The target object of the Event. Although not deprecated, it is recommended that the the methods
getPersistentInstance()
and getDetachedInstance()
be used instead. - Returns:
- The detached instance for preDetach and postAttach, the persistent instance otherwise.
- Since:
- JDO 2.0
- See Also:
- getPersistentInstance()
- getDetachedInstance()
"Section 12.15, Java Data Objects 2.0 Specification"
- getDetachedInstance()
String toString()