|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.commandhandling.interceptors.TransactionInterceptor<T>
T - The type of object representing the transactionpublic abstract class TransactionInterceptor<T>
Abstract implementation of a CommandHandlerInterceptor that starts a
transaction and binds a UnitOfWork to the current thread.
| Constructor Summary | |
|---|---|
TransactionInterceptor()
|
|
| Method Summary | |
|---|---|
protected abstract void |
commitTransaction(T transaction)
Commits the transaction for the command execution described by the given context. |
Object |
handle(Object command,
UnitOfWork unitOfWork,
InterceptorChain interceptorChain)
The handle method is invoked each time a command is dispatched through the event bus that the CommandHandlerInterceptor is declared on. |
protected abstract void |
rollbackTransaction(T transaction)
Rolls back a transaction for a command execution described by the given context. |
protected abstract T |
startTransaction()
Start a new transaction for a command execution described by the given context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransactionInterceptor()
| Method Detail |
|---|
public Object handle(Object command,
UnitOfWork unitOfWork,
InterceptorChain interceptorChain)
throws Throwable
CommandHandlerInterceptorcommandContext.
The interceptor is responsible for the continuation of the dispatch process by invoking the InterceptorChain.proceed(Object) method on the given
interceptorChain.
Any information gathered by interceptors may be attached to the command context. This information is made
available to the CommandCallback provided by the dispatching component.
Interceptors are highly recommended not to change the type of the command handling result, as the dispatching
component might expect a result of a specific type.
handle in interface CommandHandlerInterceptorcommand - The command being dispatchedunitOfWork - The UnitOfWork in whichinterceptorChain - The interceptor chain that allows this interceptor to proceed the dispatch process
Throwable - any exception that occurs while handling the commandprotected abstract T startTransaction()
context. The given
unitOfWork is the unitOfWork bound to the current thread.
protected abstract void commitTransaction(T transaction)
context. The given
unitOfWork is the unitOfWork bound to the current thread.
transaction - The transaction object returned during during startTransaction()protected abstract void rollbackTransaction(T transaction)
context. The given
unitOfWork is the unitOfWork bound to the current thread.
transaction - The transaction object returned during during startTransaction()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||