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 Classes Modifier and Type Interface Description static class
TransactionalHostContextAccessor.Permission
Transaction permissionstatic class
TransactionalHostContextAccessor.Propagation
Transaction propagation, equivalent to the corresponding values of javax.ejb.TransactionAttributeType-
Nested classes/interfaces inherited from interface com.atlassian.sal.spi.HostContextAccessor
com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T extends Object>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <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.<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.<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.
-
-
-
Method Detail
-
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.
-
-