Interface ReactiveEntityCallbacks
public interface ReactiveEntityCallbacks
Interface to be implemented by objects that can manage a number of
EntityCallback
objects and invoke these
with a specific entity.- Since:
- 2.2
- Author:
- Christoph Strobl
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntityCallback
(EntityCallback<?> callback) Add the givencallback
using generic type argument detection for identification of supported types.<T> reactor.core.publisher.Mono<T>
callback
(Class<? extends EntityCallback> callbackType, T entity, Object... args) Onsubscribe
invoke the matchingentity callbacks
with given arguments.static ReactiveEntityCallbacks
create()
Obtain a newReactiveEntityCallbacks
instance.static ReactiveEntityCallbacks
create
(BeanFactory beanFactory) Obtain a newReactiveEntityCallbacks
instance.static ReactiveEntityCallbacks
create
(EntityCallback<?>... callbacks) Create a newReactiveEntityCallbacks
instance with givencallbacks
.
-
Method Details
-
addEntityCallback
Add the givencallback
using generic type argument detection for identification of supported types.- Parameters:
callback
- must not be null.- Throws:
IllegalArgumentException
- if the required argument is null.
-
callback
<T> reactor.core.publisher.Mono<T> callback(Class<? extends EntityCallback> callbackType, T entity, Object... args) Onsubscribe
invoke the matchingentity callbacks
with given arguments.- Type Parameters:
T
- Entity type.- Parameters:
callbackType
- must not be null.entity
- must not be null.args
- optional arguments.- Returns:
- a
Mono
emitting the result after invoking the callbacks. - Throws:
IllegalArgumentException
- if a required argument is null.
-
create
Create a newReactiveEntityCallbacks
instance with givencallbacks
.
The providedcallbacks
are immediatelyadded
. -
create
Obtain a newReactiveEntityCallbacks
instance.
UseaddEntityCallback(EntityCallback)
to register callbacks manually. -
create
Obtain a newReactiveEntityCallbacks
instance.callbacks
are pre loaded from the givenBeanFactory
.
UseaddEntityCallback(EntityCallback)
to register additional callbacks manually.- Parameters:
beanFactory
- must not be null.- Throws:
IllegalArgumentException
- if a required argument is null.
-