org.axonframework.commandhandling.disruptor
Class BlacklistDetectingCallback<R>

java.lang.Object
  extended by org.axonframework.commandhandling.disruptor.BlacklistDetectingCallback<R>
Type Parameters:
R - The return value of the Command
All Implemented Interfaces:
CommandCallback<R>

public class BlacklistDetectingCallback<R>
extends Object
implements CommandCallback<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
BlacklistDetectingCallback(CommandCallback<R> delegate, CommandMessage command, com.lmax.disruptor.RingBuffer<CommandHandlingEntry> ringBuffer, DisruptorCommandBus commandBus, 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
 boolean hasDelegate()
          Indicates whether this callback has a delegate that needs to be notified of the command handling result
 void onFailure(Throwable cause)
          Invoked when command handling execution resulted in an error.
 void onSuccess(R result)
          Invoked when command handling execution was successful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlacklistDetectingCallback

public BlacklistDetectingCallback(CommandCallback<R> delegate,
                                  CommandMessage command,
                                  com.lmax.disruptor.RingBuffer<CommandHandlingEntry> ringBuffer,
                                  DisruptorCommandBus commandBus,
                                  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
command - The command being executed
ringBuffer - The RingBuffer on which an Aggregate Cleanup should be scheduled when a corrupted aggregate state was detected
commandBus - The CommandBus on which the command should be rescheduled if it was executed on a corrupt aggregate
rescheduleOnCorruptState - Whether the command should be retried if it has been executed against corrupt state
Method Detail

onSuccess

public void onSuccess(R result)
Description copied from interface: CommandCallback
Invoked when command handling execution was successful.

Specified by:
onSuccess in interface CommandCallback<R>
Parameters:
result - The result of the command handling execution, if any.

onFailure

public void onFailure(Throwable cause)
Description copied from interface: CommandCallback
Invoked when command handling execution resulted in an error.

Specified by:
onFailure in interface CommandCallback<R>
Parameters:
cause - The exception raised during command handling

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.


Copyright © 2010-2016. All Rights Reserved.