Class BlacklistDetectingCallback<C,R>

java.lang.Object
org.axonframework.disruptor.commandhandling.BlacklistDetectingCallback<C,R>
Type Parameters:
R - The return value of the Command
C - 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

    Constructors
    Constructor
    Description
    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 given command to be rescheduled on the given ringBuffer if it failed due to a corrupt state.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether this callback has a delegate that needs to be notified of the command handling result
    void
    onResult(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, wait

    Methods 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 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 org.axonframework.commandhandling.CommandMessage<? extends C> commandMessage, @Nonnull org.axonframework.commandhandling.CommandResultMessage<? extends R> commandResultMessage)
      Specified by:
      onResult in interface org.axonframework.commandhandling.CommandCallback<C,R>
    • 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.