Class BlacklistDetectingCallback<C,R>
java.lang.Object
org.axonframework.disruptor.commandhandling.BlacklistDetectingCallback<C,R>
- Type Parameters:
R- The return value of the CommandC- The type of payload of the dispatched command
- All Implemented Interfaces:
org.axonframework.commandhandling.CommandCallback<C,R>
public class BlacklistDetectingCallback<C,R>
extends Object
implements org.axonframework.commandhandling.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(org.axonframework.commandhandling.CommandCallback<? super C, R> delegate, com.lmax.disruptor.RingBuffer<CommandHandlingEntry> ringBuffer, BiConsumer<org.axonframework.commandhandling.CommandMessage<? extends C>, org.axonframework.commandhandling.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(org.axonframework.commandhandling.CommandMessage<? extends C> commandMessage, org.axonframework.commandhandling.CommandResultMessage<? extends R> commandResultMessage) 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(org.axonframework.commandhandling.CommandCallback<? super C, R> delegate, com.lmax.disruptor.RingBuffer<CommandHandlingEntry> ringBuffer, BiConsumer<org.axonframework.commandhandling.CommandMessage<? extends C>, org.axonframework.commandhandling.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
-
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.
-