public final class PBLifeCycleEvent extends PersistenceBrokerEvent
PBLifeCycleEvent
encapsulates information about
the life-cycle of a persistent object.
Modifier and Type | Class and Description |
---|---|
static class |
PBLifeCycleEvent.Type
Enum-like class for the event types.
|
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_AFTER_DELETE
Denotes an event that happens after the deletion of an object.
|
static int |
TYPE_AFTER_INSERT
Denotes an event that happens after the insertion of an object.
|
static int |
TYPE_AFTER_LOOKUP
Denotes an event that happens after the lookup of an object.
|
static int |
TYPE_AFTER_UPDATE
Denotes an event that happens after the update of an object.
|
static int |
TYPE_BEFORE_DELETE
Denotes an event that happens before the deletion of an object.
|
static int |
TYPE_BEFORE_INSERT
Denotes an event that happens before the insertion of an object.
|
static int |
TYPE_BEFORE_UPDATE
Denotes an event that happens before the update of an object.
|
Constructor and Description |
---|
PBLifeCycleEvent(PersistenceBroker broker,
java.lang.Object target,
PBLifeCycleEvent.Type eventType)
Creates a new event instance.
|
PBLifeCycleEvent(PersistenceBroker broker,
PBLifeCycleEvent.Type type)
Creates a new event instance.
|
Modifier and Type | Method and Description |
---|---|
PBLifeCycleEvent.Type |
getEventType()
Returns the event type.
|
PersistenceBrokerAware |
getPersitenceBrokerAware()
Returns the target object as an instance of
PersistenceBrokerAware if possible. |
java.lang.Object |
getTarget()
Returns the object that caused the event.
|
void |
setTarget(java.lang.Object obj)
Set the object that caused the event.
|
java.lang.String |
toString() |
getTriggeringBroker
public static final int TYPE_BEFORE_INSERT
public static final int TYPE_BEFORE_DELETE
public static final int TYPE_BEFORE_UPDATE
public static final int TYPE_AFTER_UPDATE
public static final int TYPE_AFTER_DELETE
public static final int TYPE_AFTER_LOOKUP
public static final int TYPE_AFTER_INSERT
public PBLifeCycleEvent(PersistenceBroker broker, java.lang.Object target, PBLifeCycleEvent.Type eventType)
broker
- The brokertarget
- The object which caused the eventeventType
- The type of the eventpublic PBLifeCycleEvent(PersistenceBroker broker, PBLifeCycleEvent.Type type)
broker
- The brokertype
- The type of the eventpublic PersistenceBrokerAware getPersitenceBrokerAware()
PersistenceBrokerAware
if possible.PersistenceBrokerAware
instance if there is a target and it implements
this interfacepublic void setTarget(java.lang.Object obj)
obj
- The objectpublic java.lang.Object getTarget()
public java.lang.String toString()
toString
in class java.util.EventObject
public PBLifeCycleEvent.Type getEventType()
(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30