Package io.micronaut.transaction.impl
Class AbstractInternalTransaction<C>
java.lang.Object
io.micronaut.transaction.impl.AbstractInternalTransaction<C>
- Type Parameters:
- C- The connection type
- All Implemented Interfaces:
- InternalTransaction<C>,- TransactionExecution,- TransactionStatus<C>
- Direct Known Subclasses:
- DefaultTransactionStatus
@Internal
public abstract class AbstractInternalTransaction<C>
extends Object
implements InternalTransaction<C>
The abstract internal transaction.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidbooleanReturn whether this transaction is completed, that is, whether it has already been committed or rolled back.booleanTemplate method for determining the global rollback-only flag of the underlying transaction, if any.booleanDetermine the rollback-only flag via checking this TransactionStatus.booleanReturn whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure).voidregisterSynchronization(@NonNull TransactionSynchronization synchronization) Register a new transaction synchronization for the current state.protected voidSet global rollback only.voidSet the transaction rollback-only.voidvoidvoidvoidMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.transaction.impl.InternalTransactionisNestedTransaction, resume, suspendMethods inherited from interface io.micronaut.transaction.TransactionExecutiongetTransactionDefinition, isNewTransactionMethods inherited from interface io.micronaut.transaction.TransactionStatusgetConnection, getConnectionStatus, getTransaction
- 
Field Details- 
synchronizations
 
- 
- 
Constructor Details- 
AbstractInternalTransactionpublic AbstractInternalTransaction()
 
- 
- 
Method Details- 
setGlobalRollbackOnlyprotected void setGlobalRollbackOnly()Set global rollback only.
- 
setRollbackOnlypublic void setRollbackOnly()Description copied from interface:TransactionExecutionSet the transaction rollback-only. This instructs the transaction manager that the only possible outcome of the transaction may be a rollback, as alternative to throwing an exception which would in turn trigger a rollback.- Specified by:
- setRollbackOnlyin interface- TransactionExecution
 
- 
isRollbackOnlypublic boolean isRollbackOnly()Description copied from interface:TransactionExecutionReturn whether the transaction has been marked as rollback-only (either by the application or by the transaction infrastructure).- Specified by:
- isRollbackOnlyin interface- TransactionExecution
- Returns:
- Whether the execution has been marked to rollback
 
- 
isLocalRollbackOnlypublic boolean isLocalRollbackOnly()Description copied from interface:InternalTransactionDetermine the rollback-only flag via checking this TransactionStatus.Will only return "true" if the application called setRollbackOnlyon this TransactionStatus object.- Specified by:
- isLocalRollbackOnlyin interface- InternalTransaction<C>
- Returns:
- Whether is local rollback
 
- 
isGlobalRollbackOnlypublic boolean isGlobalRollbackOnly()Description copied from interface:InternalTransactionTemplate method for determining the global rollback-only flag of the underlying transaction, if any.This implementation always returns false.- Specified by:
- isGlobalRollbackOnlyin interface- InternalTransaction<C>
- Returns:
- Whether is global rollback
 
- 
isCompletedpublic boolean isCompleted()Description copied from interface:TransactionExecutionReturn whether this transaction is completed, that is, whether it has already been committed or rolled back.- Specified by:
- isCompletedin interface- TransactionExecution
- Returns:
- Whether the execution has completed
 
- 
triggerBeforeCommitpublic void triggerBeforeCommit()- Specified by:
- triggerBeforeCommitin interface- InternalTransaction<C>
 
- 
triggerAfterCommitpublic void triggerAfterCommit()- Specified by:
- triggerAfterCommitin interface- InternalTransaction<C>
 
- 
triggerBeforeCompletionpublic void triggerBeforeCompletion()- Specified by:
- triggerBeforeCompletionin interface- InternalTransaction<C>
 
- 
triggerAfterCompletion- Specified by:
- triggerAfterCompletionin interface- InternalTransaction<C>
 
- 
cleanupAfterCompletionpublic void cleanupAfterCompletion()- Specified by:
- cleanupAfterCompletionin interface- InternalTransaction<C>
 
- 
registerSynchronizationDescription copied from interface:TransactionStatusRegister a new transaction synchronization for the current state.Note that synchronizations can implement the Orderedinterface. They will be executed in an order according to their order value (if any).- Specified by:
- registerSynchronizationin interface- TransactionStatus<C>
- Parameters:
- synchronization- the synchronization object to register
 
 
-