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.
|
Exception |
getExceptionResult()
Returns the exception that occurred while processing the incoming command, or
null if
processing did not result in an exception or if execution is not yet finished. |
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. |
Object |
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 |
resetAsRecoverEntry(String newAggregateIdentifier)
Resets this entry, preparing it for use as a recovery entry.
|
void |
setExceptionResult(Exception exceptionResult)
Registers the exception that occurred while processing the incoming command.
|
void |
setResult(Object 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
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 setExceptionResult(Exception exceptionResult)
exceptionResult
- the exception that occurred while processing the incoming commandpublic Exception getExceptionResult()
null
if
processing did not result in an exception or if execution is not yet finished.public void setResult(Object result)
result
- the result of the command's execution, if successfulpublic Object 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 registerAggregateIdentifier(String aggregateIdentifier)
aggregateIdentifier
- identifier of the aggregate that will handle the commandCopyright © 2010–2017. All rights reserved.