javax.jdo.listener
Class InstanceLifecycleEvent
java.util.EventObject
javax.jdo.listener.InstanceLifecycleEvent
public class InstanceLifecycleEvent
extends java.util.EventObject
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.
InstanceLifecycleEvent(Object source, int type) - Creates a new event object with the specified
source and type .
|
InstanceLifecycleEvent(Object source, int type, Object target) - Creates a new event object with the specified
source , type , and target .
|
ATTACH
public static final int ATTACH
CLEAR
public static final int CLEAR
CREATE
public static final int CREATE
DELETE
public static final int DELETE
DETACH
public static final int DETACH
DIRTY
public static final int DIRTY
LOAD
public static final int LOAD
STORE
public static final int STORE
InstanceLifecycleEvent
public InstanceLifecycleEvent(Object source,
int type)
Creates a new event object with the specified
source
and type
.
source
- the instance that triggered the eventtype
- the event type
InstanceLifecycleEvent
public InstanceLifecycleEvent(Object source,
int type,
Object target)
Creates a new event object with the specified
source
, type
, and target
.
source
- the instance that triggered the eventtype
- the event typetarget
- the "other" instance
getDetachedInstance
public Object getDetachedInstance()
Returns the detached instance involved in the event.
- The detached instance involved in the event, or null if there was none.
"Section 12.15, Java Data Objects 2.0 Specification"
getEventType
public int getEventType()
Returns the event type that triggered this event.
getPersistentInstance
public Object getPersistentInstance()
Returns the persistent instance involved in the event.
- The persistent instance involved in the event, or null if there
was none.
"Section 12.15, Java Data Objects 2.0 Specification"
getSource
public Object getSource()
The source object of the Event. Although not deprecated,
it is recommended that the the methods
getPersistentInstance()
and
getDetachedInstance()
be used instead.
- The persistent instance on any pre- callback except preAttach,
or the detached instance for a postDetach or preAttach callback.
getTarget
public Object getTarget()
The target object of the Event. Although not deprecated,
it is recommended that the the methods
getPersistentInstance()
and
getDetachedInstance()
be used instead.
- The detached instance for preDetach and postAttach,
the persistent instance otherwise.