com.atlassian.confluence.spring.transaction.interceptor
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
static class TransactionalHostContextAccessor.Permission
          Transaction permission
static 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>
 
Method Summary
<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, 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.
 
Methods inherited from interface com.atlassian.sal.spi.HostContextAccessor
doInTransaction, getComponentsOfType
 

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 use
callback - The callback class to execute
Returns:
Optional result of the operation. May be null
Throws:
java.lang.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 is TransactionalHostContextAccessor.Propagation.REQUIRED.

Parameters:
permission - if TransactionalHostContextAccessor.Permission.READ_ONLY, attempt to use a read only transaction
callback - The callback class to execute
Returns:
Optional result of the operation. May be null
Throws:
java.lang.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 use
permission - if TransactionalHostContextAccessor.Permission.READ_ONLY, attempt to use a read only transaction
callback - The callback class to execute
Returns:
Optional result of the operation. May be null
Throws:
java.lang.RuntimeException - if anything went wrong. The caller will be responsible for rolling back.


Copyright © 2003-2013 Atlassian. All Rights Reserved.