Interface TransactionalHostContextAccessor
- All Superinterfaces:
com.atlassian.sal.spi.HostContextAccessor
- All Known Implementing Classes:
ConfluenceSpringHostContextAccessor
public interface TransactionalHostContextAccessor
extends com.atlassian.sal.spi.HostContextAccessor
Adds extra transaction control features from the underlying product.
- Since:
- 5.2
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumTransaction permissionstatic enumTransaction propagation, equivalent to the corresponding values of javax.ejb.TransactionAttributeTypeNested classes/interfaces inherited from interface com.atlassian.sal.spi.HostContextAccessor
com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> -
Method Summary
Modifier and TypeMethodDescription<T> TdoInTransaction(TransactionalHostContextAccessor.Permission permission, com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> callback) Runs an action in a transaction and returns a optional value.<T> TdoInTransaction(TransactionalHostContextAccessor.Propagation propagation, TransactionalHostContextAccessor.Permission permission, com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> callback) Runs an action in a transaction and returns a optional value.<T> TdoInTransaction(TransactionalHostContextAccessor.Propagation propagation, com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> callback) Runs an action in a transaction and returns a optional value.Methods inherited from interface com.atlassian.sal.spi.HostContextAccessor
doInTransaction, getComponentsOfType
-
Method Details
-
doInTransaction
<T> T doInTransaction(TransactionalHostContextAccessor.Propagation propagation, com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> callback) Runs an action in a transaction and returns a optional value.- Parameters:
propagation- the propagation mode to usecallback- The callback class to execute- Returns:
- Optional result of the operation. May be null
- Throws:
RuntimeException- if anything went wrong. The caller will be responsible for rolling back.
-
doInTransaction
<T> T doInTransaction(TransactionalHostContextAccessor.Permission permission, com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> callback) Runs an action in a transaction and returns a optional value. The transaction isTransactionalHostContextAccessor.Propagation.REQUIRED.- Parameters:
permission- ifTransactionalHostContextAccessor.Permission.READ_ONLY, attempt to use a read only transactioncallback- The callback class to execute- Returns:
- Optional result of the operation. May be null
- Throws:
RuntimeException- if anything went wrong. The caller will be responsible for rolling back.
-
doInTransaction
<T> T doInTransaction(TransactionalHostContextAccessor.Propagation propagation, TransactionalHostContextAccessor.Permission permission, com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> callback) Runs an action in a transaction and returns a optional value.- Parameters:
propagation- the propagation mode to usepermission- ifTransactionalHostContextAccessor.Permission.READ_ONLY, attempt to use a read only transactioncallback- The callback class to execute- Returns:
- Optional result of the operation. May be null
- Throws:
RuntimeException- if anything went wrong. The caller will be responsible for rolling back.
-