T
- Entity type used to detect callbacks
to invoke via their generic type signature.public interface EntityCallback<T>
EntityCallback
@Order
annotation or implement
Ordered
.
EntityCallback
to declare that it throws arbitrary exception types, any checked
exceptions thrown from a EntityCallback
are wrapped in an
UndeclaredThrowableException
since the callback mechanism can
only handle runtime exceptions. Entity callback processing is stopped on the EntityCallback
that raised an
exception and the caused exception is propagated to the caller.
EntityCallback
can generically declare the domain type that it is able to process by specifying the
generic type parameter <T>
. When registered with a Spring
ApplicationContext
, callbacks are filtered accordingly, with the callback getting
invoked for assignable domain objects only.
Typically, entity callbacks are invoked after publishing events
.
EntityCallback
InterfacesEntityCallback
interface needs to define a callback method accepting an object of the parameterized type as
its first argument followed by additional optional arguments.
public interface BeforeSaveCallback<T> extends EntityCallback<T> { T onBeforeSave(T entity, String collection); }
Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.