|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.reflect.LifecycleCallbackRegistry
public class LifecycleCallbackRegistry
A registry of lifecycle callbacks for all callback event types. Valid event types are
LifecycleListener.PRE_PERSIST
, LifecycleListener.POST_PERSIST
,
LifecycleListener.PRE_UPDATE
, LifecycleListener.POST_UPDATE
,
LifecycleListener.PRE_REMOVE
, LifecycleListener.POST_REMOVE
,
LifecycleListener.POST_LOAD
.
Constructor Summary | |
---|---|
LifecycleCallbackRegistry(EntityResolver resolver)
Creates an empty callback registry. |
Method Summary | |
---|---|
void |
addDefaultListener(int type,
Object listener,
String methodName)
Registers a callback method to be invoked on a provided non-entity object when a lifecycle event occurs on any entity that does not suppress default callbacks. |
void |
addDefaultListener(LifecycleListener listener)
Registers a LifecycleListener for all events on all entities. |
void |
addListener(Class entityClass,
LifecycleListener listener)
Registers a LifecycleListener for all events on all entities. |
void |
addListener(int type,
Class entityClass,
Object listener,
String methodName)
Registers callback method to be invoked on a provided non-entity object when a lifecycle event occurs for a specific entity. |
void |
addListener(int type,
Class entityClass,
String methodName)
Registers a callback method to be invoked on an entity class instances when a lifecycle event occurs. |
void |
clear()
Removes all listeners for all event types. |
void |
clear(int type)
Removes listeners for a single event type. |
boolean |
isEmpty(int type)
Returns true if there are no listeners for a specific event type. |
void |
performCallbacks(int type,
Collection objects)
Invokes callbacks of a specific type for a collection of entity objects. |
void |
performCallbacks(int type,
Object object)
Invokes callbacks of a specific type for a given entity object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LifecycleCallbackRegistry(EntityResolver resolver)
Method Detail |
---|
public void clear()
public void clear(int type)
public boolean isEmpty(int type)
public void addDefaultListener(LifecycleListener listener)
LifecycleListener
for all events on all entities. Note that
listeners are not required to implement LifecycleListener
interface. Other
methods in this class can be used to register arbitrary listeners.
public void addDefaultListener(int type, Object listener, String methodName)
public void addListener(Class entityClass, LifecycleListener listener)
LifecycleListener
for all events on all entities. Note that
listeners are not required to implement LifecycleListener
interface. Other
methods in this class can be used to register arbitrary listeners.
public void addListener(int type, Class entityClass, Object listener, String methodName)
public void addListener(int type, Class entityClass, String methodName)
public void performCallbacks(int type, Object object)
public void performCallbacks(int type, Collection objects)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |