Package org.axonframework.eventhandling
Class MultiEventHandlerInvoker
java.lang.Object
org.axonframework.eventhandling.MultiEventHandlerInvoker
- All Implemented Interfaces:
EventHandlerInvoker
Implementation of
EventHandlerInvoker with capabilities to invoke several different invokers.- Since:
- 3.3
- Author:
- Milan Savic
-
Constructor Summary
ConstructorsConstructorDescriptionMultiEventHandlerInvoker(List<EventHandlerInvoker> delegates) Initializes multi invoker with different invokers.MultiEventHandlerInvoker(EventHandlerInvoker... delegates) Initializes multi invoker with different invokers. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(EventMessage<?> eventMessage, Segment segment) Check whether or not this invoker has handlers that can handle the giveneventMessagefor a givensegment.booleancanHandleType(Class<?> payloadType) Check whether or not this invoker has handlers that can handle the givenpayloadType.voidhandle(EventMessage<?> message, Segment segment) Handle the givenmessagefor the givensegment.voidPerforms any activities that are required to reset the state managed by handlers assigned to this invoker.<R> voidperformReset(R resetContext) Performs any activities that are required to reset the state managed by handlers assigned to this invoker.booleanIndicates whether the handlers managed by this invoker support a reset.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.eventhandling.EventHandlerInvoker
segmentReleased
-
Constructor Details
-
MultiEventHandlerInvoker
Initializes multi invoker with different invokers. Invokers of instanceMultiEventHandlerInvokerwill be flattened.- Parameters:
delegates- which will be used to do the actual event handling
-
MultiEventHandlerInvoker
Initializes multi invoker with different invokers. Invokers of instanceMultiEventHandlerInvokerwill be flattened.- Parameters:
delegates- which will be used to do the actual event handling
-
-
Method Details
-
delegates
-
canHandle
Description copied from interface:EventHandlerInvokerCheck whether or not this invoker has handlers that can handle the giveneventMessagefor a givensegment.- Specified by:
canHandlein interfaceEventHandlerInvoker- Parameters:
eventMessage- The message to be processedsegment- The segment for which the event handler should be invoked- Returns:
trueif the invoker has one or more handlers that can handle the given message,falseotherwise
-
canHandleType
Description copied from interface:EventHandlerInvokerCheck whether or not this invoker has handlers that can handle the givenpayloadType.- Specified by:
canHandleTypein interfaceEventHandlerInvoker- Parameters:
payloadType- The payloadType of the message to be processed- Returns:
trueif the invoker has one or more handlers that can handle the given message,falseotherwise
-
handle
Description copied from interface:EventHandlerInvokerHandle the givenmessagefor the givensegment.Callers are recommended to invoke
EventHandlerInvoker.canHandle(EventMessage, Segment)prior to invocation, but aren't required to do so. Implementations must ensure to take the given segment into account when processing messages.- Specified by:
handlein interfaceEventHandlerInvoker- Parameters:
message- The message to handlesegment- The segment for which to handle the message- Throws:
Exception- when an exception occurs while handling the message
-
supportsReset
public boolean supportsReset()Description copied from interface:EventHandlerInvokerIndicates whether the handlers managed by this invoker support a reset.- Specified by:
supportsResetin interfaceEventHandlerInvoker- Returns:
trueif a reset is supported, otherwisefalse
-
performReset
public void performReset()Description copied from interface:EventHandlerInvokerPerforms any activities that are required to reset the state managed by handlers assigned to this invoker.- Specified by:
performResetin interfaceEventHandlerInvoker
-
performReset
public <R> void performReset(R resetContext) Description copied from interface:EventHandlerInvokerPerforms any activities that are required to reset the state managed by handlers assigned to this invoker.- Specified by:
performResetin interfaceEventHandlerInvoker- Type Parameters:
R- the type of the providedresetContext- Parameters:
resetContext- aRused to support the reset operation
-