Class BlacklistDetectingCallback<C,R>

java.lang.Object
org.axonframework.disruptor.commandhandling.BlacklistDetectingCallback<C,R>
Type Parameters:
C - The type of payload of the dispatched command
R - The return value of the Command
All Implemented Interfaces:
CommandCallback<C,R>

public class BlacklistDetectingCallback<C,R> extends Object implements 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 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 given command to be rescheduled on the given ringBuffer if it failed due to a corrupt state.
      Parameters:
      delegate - The callback to invoke when an exception occurred
      ringBuffer - The RingBuffer on which an Aggregate Cleanup should be scheduled when a corrupted aggregate state was detected
      retryMethod - The method to reschedule a command if it was executed on a corrupt aggregate
      rescheduleOnCorruptState - 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: CommandCallback
      Invoked when command handling execution is completed.
      Specified by:
      onResult in interface CommandCallback<C,R>
      Parameters:
      commandMessage - the CommandMessage that was dispatched
      commandResultMessage - the CommandResultMessage of 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:
      true if this callback has a delegate, otherwise false.