public class CommandHandlingEntry extends DisruptorUnitOfWork<CommandMessage<?>>
UnitOfWork.Phase
Constructor and Description |
---|
CommandHandlingEntry()
Initializes the CommandHandlingEntry
|
Modifier and Type | Method and Description |
---|---|
String |
getAggregateIdentifier()
Returns the identifier of the aggregate to recover.
|
BlacklistDetectingCallback<?,?> |
getCallback()
Returns the CommandCallback instance for the executed command.
|
InterceptorChain |
getInvocationInterceptorChain()
Returns the InterceptorChain for the invocation process registered with this entry, or
null if none is
available. |
int |
getInvokerId()
Returns the Identifier of the invoker that is chosen to handle this entry.
|
int |
getPublisherId()
Returns the Identifier of the publisher that is chosen to handle this entry.
|
InterceptorChain |
getPublisherInterceptorChain()
Returns the InterceptorChain for the publication process registered with this entry, or
null if none is
available. |
CommandResultMessage<?> |
getResult()
Returns the result of the command's execution, or
null if the command is not yet executed or resulted in
an exception. |
boolean |
isRecoverEntry()
Indicates whether this entry is a recovery entry.
|
void |
registerAggregateIdentifier(String aggregateIdentifier)
Registers the identifier of the aggregate that will process the next command.
|
void |
reset(CommandMessage<?> newCommand,
MessageHandler<? super CommandMessage<?>> newCommandHandler,
int newInvokerSegmentId,
int newPublisherSegmentId,
BlacklistDetectingCallback<?,?> newCallback,
List<MessageHandlerInterceptor<? super CommandMessage<?>>> invokerInterceptors,
List<MessageHandlerInterceptor<? super CommandMessage<?>>> publisherInterceptors)
Resets this entry, preparing it for use for another command.
|
void |
resetAsCallable(Callable<Object> callable,
int newInvokerSegmentId,
int newPublisherSegmentId,
BlacklistDetectingCallback<Object,Object> newCallback)
Resets this entry, preparing it to run given
callable from within the invocationInterceptorChain . |
void |
resetAsRecoverEntry(String newAggregateIdentifier)
Resets this entry, preparing it for use as a recovery entry.
|
void |
setResult(CommandResultMessage<?> result)
Registers the result of the command's execution, if successful.
|
addHandler, executeWithResult, getExecutionResult, getMessage, notifyHandlers, parent, pause, reset, resume, setExecutionResult, setRollbackCause, transformMessage
afterCommit, changePhase, commit, correlationDataProviders, getCorrelationData, isRolledBack, onCleanup, onCommit, onPrepareCommit, onRollback, phase, registerCorrelationDataProvider, resources, rollback, setPhase, start
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
attachTransaction, execute, execute, executeWithResult, getOrComputeResource, getOrDefaultResource, getResource, isActive, isCurrent, isRoot, rollback, root
public CommandHandlingEntry()
public InterceptorChain getInvocationInterceptorChain()
null
if none is
available.public InterceptorChain getPublisherInterceptorChain()
null
if none is
available.public void setResult(CommandResultMessage<?> result)
result
- the result of the command's execution, if successfulpublic CommandResultMessage<?> getResult()
null
if the command is not yet executed or resulted in
an exception.public BlacklistDetectingCallback<?,?> getCallback()
public boolean isRecoverEntry()
true
, this entry does not contain any command
handling information.true
if this entry represents a recovery request, otherwise false
.public String getAggregateIdentifier()
null
when isRecoverEntry()
returns
false
.public int getInvokerId()
public int getPublisherId()
public void reset(CommandMessage<?> newCommand, MessageHandler<? super CommandMessage<?>> newCommandHandler, int newInvokerSegmentId, int newPublisherSegmentId, BlacklistDetectingCallback<?,?> newCallback, List<MessageHandlerInterceptor<? super CommandMessage<?>>> invokerInterceptors, List<MessageHandlerInterceptor<? super CommandMessage<?>>> publisherInterceptors)
newCommand
- The new command the entry is used fornewCommandHandler
- The Command Handler responsible for handling newCommand
newInvokerSegmentId
- The SegmentID of the invoker that should process this entrynewPublisherSegmentId
- The SegmentID of the publisher that should process this entrynewCallback
- The callback to report the result of command execution toinvokerInterceptors
- The interceptors to invoke during the command handler invocation phasepublisherInterceptors
- The interceptors to invoke during the publication phasepublic void resetAsRecoverEntry(String newAggregateIdentifier)
newAggregateIdentifier
- The identifier of the aggregate to recoverpublic void resetAsCallable(Callable<Object> callable, int newInvokerSegmentId, int newPublisherSegmentId, BlacklistDetectingCallback<Object,Object> newCallback)
callable
from within the invocationInterceptorChain
.callable
- a Callable
which performs a task in the invocationInterceptorChain
,
for example publishing a scheduled DeadlineMessage
newInvokerSegmentId
- The SegmentId of the invoker that should process this entrynewPublisherSegmentId
- The SegmentId of the publisher that should process this entrynewCallback
- The callback to report the result of command execution topublic void registerAggregateIdentifier(String aggregateIdentifier)
aggregateIdentifier
- identifier of the aggregate that will handle the commandCopyright © 2010–2024. All rights reserved.