Class BlacklistDetectingCallback<C,R>
java.lang.Object
org.axonframework.disruptor.commandhandling.BlacklistDetectingCallback<C,R>
- Type Parameters:
C- The type of payload of the dispatched commandR- The return value of the Command
- All Implemented Interfaces:
CommandCallback<C,R>
Wrapper for command handler Callbacks that detects blacklisted aggregates and starts a cleanup process when an
aggregate is blacklisted.
- Since:
- 2.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionBlacklistDetectingCallback(CommandCallback<? super C, R> delegate, com.lmax.disruptor.RingBuffer<CommandHandlingEntry> ringBuffer, BiConsumer<CommandMessage<? extends C>, CommandCallback<? super C, R>> retryMethod, boolean rescheduleOnCorruptState) Initializes the callback which allows the givencommandto be rescheduled on the givenringBufferif it failed due to a corrupt state. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether this callback has a delegate that needs to be notified of the command handling resultvoidonResult(CommandMessage<? extends C> commandMessage, CommandResultMessage<? extends R> commandResultMessage) Invoked when command handling execution is completed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.commandhandling.CommandCallback
wrap
-
Constructor Details
-
BlacklistDetectingCallback
public BlacklistDetectingCallback(CommandCallback<? super C, R> delegate, com.lmax.disruptor.RingBuffer<CommandHandlingEntry> ringBuffer, BiConsumer<CommandMessage<? extends C>, CommandCallback<? super C, R>> retryMethod, boolean rescheduleOnCorruptState) Initializes the callback which allows the givencommandto be rescheduled on the givenringBufferif it failed due to a corrupt state.- Parameters:
delegate- The callback to invoke when an exception occurredringBuffer- The RingBuffer on which an Aggregate Cleanup should be scheduled when a corrupted aggregate state was detectedretryMethod- The method to reschedule a command if it was executed on a corrupt aggregaterescheduleOnCorruptState- Whether the command should be retried if it has been executed against corrupt state
-
-
Method Details
-
onResult
public void onResult(@Nonnull CommandMessage<? extends C> commandMessage, @Nonnull CommandResultMessage<? extends R> commandResultMessage) Description copied from interface:CommandCallbackInvoked when command handling execution is completed.- Specified by:
onResultin interfaceCommandCallback<C,R> - Parameters:
commandMessage- theCommandMessagethat was dispatchedcommandResultMessage- theCommandResultMessageof the command handling execution
-
hasDelegate
public boolean hasDelegate()Indicates whether this callback has a delegate that needs to be notified of the command handling result- Returns:
trueif this callback has a delegate, otherwisefalse.
-