public class InstanceLifecycleEvent extends EventObject
Note that although InstanceLifecycleEvent inherits Serializable interface from EventObject, it is not intended to be Serializable. Appropriate serialization methods are implemented to throw NotSerializableException.
| Modifier and Type | Field and Description |
|---|---|
static int |
ATTACH |
static int |
CLEAR |
static int |
CREATE |
static int |
DELETE |
static int |
DETACH |
static int |
DIRTY |
static int |
LOAD |
static int |
STORE |
source| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getDetachedInstance()
Returns the detached instance involved in the event.
|
int |
getEventType()
Returns the event type that triggered this event.
|
Object |
getPersistentInstance()
Returns the persistent instance involved in the event.
|
Object |
getSource()
The source object of the Event.
|
Object |
getTarget()
The target object of the Event.
|
toStringpublic static final int CREATE
public static final int LOAD
public static final int STORE
public static final int CLEAR
public static final int DELETE
public static final int DIRTY
public static final int DETACH
public static final int ATTACH
public InstanceLifecycleEvent(Object source, int type)
source and type.source - the instance that triggered the eventtype - the event typepublic int getEventType()
public Object getSource()
getPersistentInstance() and
getDetachedInstance() be used instead.getSource in class EventObjectgetPersistentInstance(),
getDetachedInstance(),
"Section 12.15, Java Data Objects 2.0 Specification"public Object getTarget()
getPersistentInstance() and
getDetachedInstance() be used instead.getPersistentInstance(),
getDetachedInstance(),
"Section 12.15, Java Data Objects 2.0 Specification"public Object getPersistentInstance()
public Object getDetachedInstance()
Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.