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 |
onResult(CommandMessage<? extends C> commandMessage,
CommandResultMessage<? extends R> commandResultMessage)
Invoked when command handling execution is completed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
wrap
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 onResult(@Nonnull CommandMessage<? extends C> commandMessage, @Nonnull CommandResultMessage<? extends R> commandResultMessage)
CommandCallback
onResult
in interface CommandCallback<C,R>
commandMessage
- the CommandMessage
that was dispatchedcommandResultMessage
- the CommandResultMessage
of the command handling executionpublic boolean hasDelegate()
true
if this callback has a delegate, otherwise false
.Copyright © 2010–2023. All rights reserved.