Class DisruptorUnitOfWork<T extends org.axonframework.messaging.Message<?>>
java.lang.Object
org.axonframework.messaging.unitofwork.AbstractUnitOfWork<T>
org.axonframework.disruptor.commandhandling.DisruptorUnitOfWork<T>
- All Implemented Interfaces:
org.axonframework.messaging.unitofwork.UnitOfWork<T>
- Direct Known Subclasses:
CommandHandlingEntry
public abstract class DisruptorUnitOfWork<T extends org.axonframework.messaging.Message<?>>
extends org.axonframework.messaging.unitofwork.AbstractUnitOfWork<T>
Specialized UnitOfWork instance for the
DisruptorCommandBus. It expects the executing command message to
target a single aggregate instance.- Since:
- 2.0
- Author:
- Allard Buijze
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.axonframework.messaging.unitofwork.UnitOfWork
org.axonframework.messaging.unitofwork.UnitOfWork.Phase -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddHandler(org.axonframework.messaging.unitofwork.UnitOfWork.Phase phase, Consumer<org.axonframework.messaging.unitofwork.UnitOfWork<T>> handler) <R> org.axonframework.messaging.ResultMessage<R>executeWithResult(Callable<R> task, org.axonframework.messaging.unitofwork.RollbackConfiguration rollbackConfiguration) org.axonframework.messaging.unitofwork.ExecutionResultprotected voidnotifyHandlers(org.axonframework.messaging.unitofwork.UnitOfWork.Phase phase) Optional<org.axonframework.messaging.unitofwork.UnitOfWork<?>>parent()voidpause()Pause this Unit of Work by deregistering it with theCurrentUnitOfWork.voidResets the state of this Unit of Work, by setting its phase toNOT_STARTED, replacing the message of this Unit of Work with givenmessage, and clearing its collection of registered handlers.voidresume()Resume a paused Unit of Work by registering it with theCurrentUnitOfWork.protected voidsetExecutionResult(org.axonframework.messaging.unitofwork.ExecutionResult executionResult) protected voidsetRollbackCause(Throwable cause) org.axonframework.messaging.unitofwork.UnitOfWork<T>transformMessage(Function<T, ? extends org.axonframework.messaging.Message<?>> transformOperator) Methods inherited from class org.axonframework.messaging.unitofwork.AbstractUnitOfWork
afterCommit, changePhase, commit, correlationDataProviders, getCorrelationData, isRolledBack, onCleanup, onCommit, onPrepareCommit, onRollback, phase, registerCorrelationDataProvider, resources, rollback, setPhase, startMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.unitofwork.UnitOfWork
attachTransaction, execute, execute, executeWithResult, getOrComputeResource, getOrDefaultResource, getResource, isActive, isCurrent, isRoot, rollback, root
-
Constructor Details
-
DisruptorUnitOfWork
public DisruptorUnitOfWork()
-
-
Method Details
-
reset
Resets the state of this Unit of Work, by setting its phase toNOT_STARTED, replacing the message of this Unit of Work with givenmessage, and clearing its collection of registered handlers.- Parameters:
message- the new Message that is about to be processed.
-
pause
public void pause()Pause this Unit of Work by deregistering it with theCurrentUnitOfWork. This will detach it from the current thread. -
resume
public void resume()Resume a paused Unit of Work by registering it with theCurrentUnitOfWork. This will attach it to the current thread again. -
parent
-
getMessage
-
transformMessage
-
notifyHandlers
protected void notifyHandlers(org.axonframework.messaging.unitofwork.UnitOfWork.Phase phase) - Specified by:
notifyHandlersin classorg.axonframework.messaging.unitofwork.AbstractUnitOfWork<T extends org.axonframework.messaging.Message<?>>
-
addHandler
protected void addHandler(org.axonframework.messaging.unitofwork.UnitOfWork.Phase phase, Consumer<org.axonframework.messaging.unitofwork.UnitOfWork<T>> handler) - Specified by:
addHandlerin classorg.axonframework.messaging.unitofwork.AbstractUnitOfWork<T extends org.axonframework.messaging.Message<?>>
-
setExecutionResult
protected void setExecutionResult(org.axonframework.messaging.unitofwork.ExecutionResult executionResult) - Specified by:
setExecutionResultin classorg.axonframework.messaging.unitofwork.AbstractUnitOfWork<T extends org.axonframework.messaging.Message<?>>
-
setRollbackCause
- Specified by:
setRollbackCausein classorg.axonframework.messaging.unitofwork.AbstractUnitOfWork<T extends org.axonframework.messaging.Message<?>>
-
executeWithResult
public <R> org.axonframework.messaging.ResultMessage<R> executeWithResult(Callable<R> task, @Nonnull org.axonframework.messaging.unitofwork.RollbackConfiguration rollbackConfiguration) This feature is not supported by this Unit of Work. -
getExecutionResult
public org.axonframework.messaging.unitofwork.ExecutionResult getExecutionResult()
-