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 TypeMethodDescriptionvoidaddEntityCallback(EntityCallback<?> callback) Add the givencallbackusing generic type argument detection for identification of supported types.<T> reactor.core.publisher.Mono<T>callback(Class<? extends EntityCallback> callbackType, T entity, Object... args) Onsubscribeinvoke the matchingentity callbackswith given arguments.static ReactiveEntityCallbackscreate()Obtain a newReactiveEntityCallbacksinstance.static ReactiveEntityCallbackscreate(BeanFactory beanFactory) Obtain a newReactiveEntityCallbacksinstance.static ReactiveEntityCallbackscreate(EntityCallback<?>... callbacks) Create a newReactiveEntityCallbacksinstance with givencallbacks.
-
Method Details
-
addEntityCallback
Add the givencallbackusing 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) Onsubscribeinvoke the matchingentity callbackswith given arguments.- Type Parameters:
T- Entity type.- Parameters:
callbackType- must not be null.entity- must not be null.args- optional arguments.- Returns:
- a
Monoemitting the result after invoking the callbacks. - Throws:
IllegalArgumentException- if a required argument is null.
-
create
Create a newReactiveEntityCallbacksinstance with givencallbacks.
The providedcallbacksare immediatelyadded. -
create
Obtain a newReactiveEntityCallbacksinstance.
UseaddEntityCallback(EntityCallback)to register callbacks manually. -
create
Obtain a newReactiveEntityCallbacksinstance.callbacksare 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.
-