public class StandaloneTransactionContext extends Object implements TransactionContext
Modifier and Type | Field and Description |
---|---|
protected CommandContext |
commandContext |
protected Map<TransactionState,List<TransactionListener>> |
stateTransactionListeners |
Constructor and Description |
---|
StandaloneTransactionContext(CommandContext commandContext) |
Modifier and Type | Method and Description |
---|---|
void |
addTransactionListener(TransactionState transactionState,
TransactionListener transactionListener)
Add a
TransactionListener to the current transaction. |
void |
commit()
Commit the current transaction.
|
protected void |
fireTransactionEvent(TransactionState transactionState) |
boolean |
isTransactionActive() |
void |
rollback()
Rollback the current transaction.
|
protected void |
setLastTransactionState(TransactionState transactionState) |
protected CommandContext commandContext
protected Map<TransactionState,List<TransactionListener>> stateTransactionListeners
public StandaloneTransactionContext(CommandContext commandContext)
public void addTransactionListener(TransactionState transactionState, TransactionListener transactionListener)
TransactionContext
TransactionListener
to the current transaction.addTransactionListener
in interface TransactionContext
transactionState
- the transaction state for which the TransactionListener
should be added.transactionListener
- the TransactionListener
to add.public void commit()
TransactionContext
commit
in interface TransactionContext
protected void fireTransactionEvent(TransactionState transactionState)
protected void setLastTransactionState(TransactionState transactionState)
public void rollback()
TransactionContext
rollback
in interface TransactionContext
public boolean isTransactionActive()
isTransactionActive
in interface TransactionContext
Copyright © 2021. All rights reserved.