Interface TransactionalHostContextAccessor
-
- All Superinterfaces:
com.atlassian.sal.spi.HostContextAccessor
- All Known Implementing Classes:
ConfluenceSpringHostContextAccessor
public interface TransactionalHostContextAccessor extends com.atlassian.sal.spi.HostContextAccessorAdds extra transaction control features from the underlying product.- Since:
- 5.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTransactionalHostContextAccessor.PermissionTransaction permissionstatic classTransactionalHostContextAccessor.PropagationTransaction 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> 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.
-
-
-
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.
-
-