|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.EventObject
org.apache.ojb.broker.util.event.OjbEvent
org.apache.ojb.broker.PersistenceBrokerEvent
org.apache.ojb.broker.PBLifeCycleEvent
public final class PBLifeCycleEvent
The PBLifeCycleEvent encapsulates information about
the life-cycle of a persistent object.
NOTE:
Because of performance reasons OJB intern reuse instances of this class
by reset target object.
| Nested Class Summary | |
|---|---|
static class |
PBLifeCycleEvent.Type
Enum-like class for the event types. |
| Field Summary | |
|---|---|
private PBLifeCycleEvent.Type |
eventType
|
private Object |
target
|
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. |
| Fields inherited from class java.util.EventObject |
|---|
source |
| Constructor Summary | |
|---|---|
PBLifeCycleEvent(PersistenceBroker broker,
Object target,
PBLifeCycleEvent.Type eventType)
Creates a new event instance. |
|
PBLifeCycleEvent(PersistenceBroker broker,
PBLifeCycleEvent.Type type)
Creates a new event instance. |
|
| Method Summary | |
|---|---|
PBLifeCycleEvent.Type |
getEventType()
Returns the event type. |
PersistenceBrokerAware |
getPersitenceBrokerAware()
Returns the target object as an instance of PersistenceBrokerAware if possible. |
Object |
getTarget()
Returns the object that caused the event. |
void |
setTarget(Object obj)
Set the object that caused the event. |
String |
toString()
|
| Methods inherited from class org.apache.ojb.broker.PersistenceBrokerEvent |
|---|
getTriggeringBroker |
| Methods inherited from class java.util.EventObject |
|---|
getSource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
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
private PBLifeCycleEvent.Type eventType
private Object target
| Constructor Detail |
|---|
public PBLifeCycleEvent(PersistenceBroker broker,
Object target,
PBLifeCycleEvent.Type eventType)
broker - The brokertarget - The object which caused the eventeventType - The type of the event
public PBLifeCycleEvent(PersistenceBroker broker,
PBLifeCycleEvent.Type type)
broker - The brokertype - The type of the event| Method Detail |
|---|
public PersistenceBrokerAware getPersitenceBrokerAware()
PersistenceBrokerAware if possible.
PersistenceBrokerAware instance if there is a target and it implements
this interfacepublic void setTarget(Object obj)
obj - The objectpublic Object getTarget()
public String toString()
toString in class EventObjectpublic PBLifeCycleEvent.Type getEventType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||