Package javax.jdo.listener
Class InstanceLifecycleEvent
java.lang.Object
java.util.EventObject
javax.jdo.listener.InstanceLifecycleEvent
- All 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:
- 2.0
- Version:
- 2.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
private final int
The event type that triggered the construction of this event object.private static final int
private static final int
static final int
private static final I18NHelper
The Internationalization message helper.private static final long
static final int
private final Object
The "other" object associated with the event.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionInstanceLifecycleEvent
(Object source, int type) Creates a new event object with the specifiedsource
andtype
.InstanceLifecycleEvent
(Object source, int type, Object target) Creates a new event object with the specifiedsource
,type
, andtarget
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the detached instance involved in the event.int
Returns the event type that triggered this event.Returns the persistent instance involved in the event.The source object of the Event.The target object of the Event.private void
Serialization is not supported for InstanceLifecycleEvents.Methods inherited from class java.util.EventObject
toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
FIRST_EVENT_TYPE
private static final int FIRST_EVENT_TYPE- See Also:
-
CREATE
public static final int CREATE- See Also:
-
LOAD
public static final int LOAD- See Also:
-
STORE
public static final int STORE- See Also:
-
CLEAR
public static final int CLEAR- See Also:
-
DELETE
public static final int DELETE- See Also:
-
DIRTY
public static final int DIRTY- See Also:
-
DETACH
public static final int DETACH- See Also:
-
ATTACH
public static final int ATTACH- See Also:
-
LAST_EVENT_TYPE
private static final int LAST_EVENT_TYPE- See Also:
-
msg
The Internationalization message helper. -
eventType
private final int eventTypeThe event type that triggered the construction of this event object. -
target
The "other" object associated with the event.
-
-
Constructor Details
-
InstanceLifecycleEvent
Creates a new event object with the specifiedsource
andtype
.- Parameters:
source
- the instance that triggered the eventtype
- the event type- Since:
- 2.0
-
InstanceLifecycleEvent
Creates a new event object with the specifiedsource
,type
, andtarget
.- Parameters:
source
- the instance that triggered the eventtype
- the event typetarget
- the "other" instance- Since:
- 2.0
-
-
Method Details
-
getEventType
public int getEventType()Returns the event type that triggered this event.- Returns:
- the event type
- Since:
- 2.0
-
getSource
The source object of the Event. Although not deprecated, it is recommended that the the methodsgetPersistentInstance()
andgetDetachedInstance()
be used instead.- Overrides:
getSource
in classEventObject
- Returns:
- The persistent instance on any pre- callback except preAttach, or the detached instance for a postDetach or preAttach callback.
- See Also:
-
getTarget
The target object of the Event. Although not deprecated, it is recommended that the the methodsgetPersistentInstance()
andgetDetachedInstance()
be used instead.- Returns:
- The detached instance for preDetach and postAttach, the persistent instance otherwise.
- Since:
- 2.0
- See Also:
-
getPersistentInstance
Returns the persistent instance involved in the event.- Returns:
- The persistent instance involved in the event, or null if there was none.
- See Also:
-
getDetachedInstance
Returns the detached instance involved in the event.- Returns:
- The detached instance involved in the event, or null if there was none.
- See Also:
-
writeObject
Serialization is not supported for InstanceLifecycleEvents.- Parameters:
out
- the output stream- Throws:
IOException
- Thrown when an error occurs- Since:
- 2.0
-