Package org.datanucleus.state
Interface CallbackHandler
-
- All Known Implementing Classes:
ExecutionContextImpl.NullCallbackHandler
public interface CallbackHandlerCallBack handlers receive notification of events on persistent objects. Handlers are responsible for invoking event listeners/callback methods on Callback or Listener implementations. When a validation handler is set, the prePersist, preStore and preDelete callbacks will be routed through to this validation handler.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddListener(Object listener, Class[] classes)Adds a new listener to this handler.voidclose()Clear any objects to release resources.default voidpostAttach(Object pc, Object detachedPC)Callback after the object is attached.default voidpostClear(Object pc)Callback after the fields of the object are cleared.default voidpostCreate(Object pc)Callback after the object has been created.default voidpostDelete(Object pc)Callback after the object is deleted.default voidpostDetach(Object pc, Object detachedPC)Callback after the object is detached.default voidpostDirty(Object pc)Callback after the object is made dirty.default voidpostLoad(Object pc)Callback after the fields of the object are loaded.default voidpostRefresh(Object pc)Callback after the fields of the object are refreshed.default voidpostStore(Object pc)Callback after the object is stored.default voidpreAttach(Object detachedPC)Callback before the object is attached.default voidpreClear(Object pc)Callback before the fields of the object are cleared.default voidpreDelete(Object pc)Callback before the object is deleted.default voidpreDetach(Object pc)Callback before the object is detached.default voidpreDirty(Object pc)Callback before the object is made dirty.default voidprePersist(Object pc)Callback before the object is persisted (just before the lifecycle state change).default voidpreStore(Object pc)Callback before the object is stored.voidremoveListener(Object listener)Remove a listener for this handler.
-
-
-
Method Detail
-
postCreate
default void postCreate(Object pc)
Callback after the object has been created.- Parameters:
pc- The Object
-
prePersist
default void prePersist(Object pc)
Callback before the object is persisted (just before the lifecycle state change).- Parameters:
pc- The Object
-
preStore
default void preStore(Object pc)
Callback before the object is stored.- Parameters:
pc- The Object
-
postStore
default void postStore(Object pc)
Callback after the object is stored.- Parameters:
pc- The Object
-
preClear
default void preClear(Object pc)
Callback before the fields of the object are cleared.- Parameters:
pc- The Object
-
postClear
default void postClear(Object pc)
Callback after the fields of the object are cleared.- Parameters:
pc- The Object
-
preDelete
default void preDelete(Object pc)
Callback before the object is deleted.- Parameters:
pc- The Object
-
postDelete
default void postDelete(Object pc)
Callback after the object is deleted.- Parameters:
pc- The Object
-
preDirty
default void preDirty(Object pc)
Callback before the object is made dirty.- Parameters:
pc- The Object
-
postDirty
default void postDirty(Object pc)
Callback after the object is made dirty.- Parameters:
pc- The Object
-
postLoad
default void postLoad(Object pc)
Callback after the fields of the object are loaded.- Parameters:
pc- The Object
-
postRefresh
default void postRefresh(Object pc)
Callback after the fields of the object are refreshed.- Parameters:
pc- The Object
-
preDetach
default void preDetach(Object pc)
Callback before the object is detached.- Parameters:
pc- The Object
-
postDetach
default void postDetach(Object pc, Object detachedPC)
Callback after the object is detached.- Parameters:
pc- The ObjectdetachedPC- The detached object
-
preAttach
default void preAttach(Object detachedPC)
Callback before the object is attached.- Parameters:
detachedPC- The Object
-
postAttach
default void postAttach(Object pc, Object detachedPC)
Callback after the object is attached.- Parameters:
pc- The attached ObjectdetachedPC- The detached object
-
addListener
void addListener(Object listener, Class[] classes)
Adds a new listener to this handler.- Parameters:
listener- the listener instanceclasses- the persistent classes which events are fired for the listener
-
removeListener
void removeListener(Object listener)
Remove a listener for this handler.- Parameters:
listener- the listener instance
-
close
void close()
Clear any objects to release resources.
-
-