Package org.datanucleus.state
Interface CallbackHandler
- All Known Implementing Classes:
ExecutionContextImpl.NullCallbackHandler
public interface CallbackHandler
CallBack 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
Modifier and TypeMethodDescriptionvoid
addListener
(Object listener, Class[] classes) Adds a new listener to this handler.void
close()
Clear any objects to release resources.default void
postAttach
(Object pc, Object detachedPC) Callback after the object is attached.default void
Callback after the fields of the object are cleared.default void
postCreate
(Object pc) Callback after the object has been created.default void
postDelete
(Object pc) Callback after the object is deleted.default void
postDetach
(Object pc, Object detachedPC) Callback after the object is detached.default void
Callback after the object is made dirty.default void
Callback after the fields of the object are loaded.default void
postRefresh
(Object pc) Callback after the fields of the object are refreshed.default void
Callback after the object is stored.default void
Callback before the object is attached.default void
Callback before the fields of the object are cleared.default void
Callback before the object is deleted.default void
Callback before the object is detached.default void
Callback before the object is made dirty.default void
prePersist
(Object pc) Callback before the object is persisted (just before the lifecycle state change).default void
Callback before the object is stored.void
removeListener
(Object listener) Remove a listener for this handler.
-
Method Details
-
postCreate
Callback after the object has been created.- Parameters:
pc
- The Object
-
prePersist
Callback before the object is persisted (just before the lifecycle state change).- Parameters:
pc
- The Object
-
preStore
Callback before the object is stored.- Parameters:
pc
- The Object
-
postStore
Callback after the object is stored.- Parameters:
pc
- The Object
-
preClear
Callback before the fields of the object are cleared.- Parameters:
pc
- The Object
-
postClear
Callback after the fields of the object are cleared.- Parameters:
pc
- The Object
-
preDelete
Callback before the object is deleted.- Parameters:
pc
- The Object
-
postDelete
Callback after the object is deleted.- Parameters:
pc
- The Object
-
preDirty
Callback before the object is made dirty.- Parameters:
pc
- The Object
-
postDirty
Callback after the object is made dirty.- Parameters:
pc
- The Object
-
postLoad
Callback after the fields of the object are loaded.- Parameters:
pc
- The Object
-
postRefresh
Callback after the fields of the object are refreshed.- Parameters:
pc
- The Object
-
preDetach
Callback before the object is detached.- Parameters:
pc
- The Object
-
postDetach
Callback after the object is detached.- Parameters:
pc
- The ObjectdetachedPC
- The detached object
-
preAttach
Callback before the object is attached.- Parameters:
detachedPC
- The Object
-
postAttach
Callback after the object is attached.- Parameters:
pc
- The attached ObjectdetachedPC
- The detached object
-
addListener
Adds a new listener to this handler.- Parameters:
listener
- the listener instanceclasses
- the persistent classes which events are fired for the listener
-
removeListener
Remove a listener for this handler.- Parameters:
listener
- the listener instance
-
close
void close()Clear any objects to release resources.
-