R - The return value of the CommandC - The type of payload of the dispatched commandpublic class BlacklistDetectingCallback<C,R> extends Object implements CommandCallback<C,R>
| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasDelegate()
Indicates whether this callback has a delegate that needs to be notified of the command handling result
|
void |
onFailure(CommandMessage<? extends C> command,
Throwable cause)
Invoked when command handling execution resulted in an error.
|
void |
onSuccess(CommandMessage<? extends C> commandMessage,
R result)
Invoked when command handling execution was successful.
|
public BlacklistDetectingCallback(CommandCallback<? super C,R> delegate, com.lmax.disruptor.RingBuffer<CommandHandlingEntry> ringBuffer, BiConsumer<CommandMessage<? extends C>,CommandCallback<? super C,R>> retryMethod, boolean rescheduleOnCorruptState)
command to be rescheduled on the given
ringBuffer if it failed due to a corrupt state.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
statepublic void onSuccess(CommandMessage<? extends C> commandMessage, R result)
CommandCallbackonSuccess in interface CommandCallback<C,R>commandMessage - The message that was dispatchedresult - The result of the command handling execution, if any.public void onFailure(CommandMessage<? extends C> command, Throwable cause)
CommandCallbackonFailure in interface CommandCallback<C,R>command - The message that was dispatchedcause - The exception raised during command handlingpublic boolean hasDelegate()
true if this callback has a delegate, otherwise false.Copyright © 2010–2018. All rights reserved.