Class ConfluenceSpringHostContextAccessor
java.lang.Object
com.atlassian.sal.spring.component.SpringHostContextAccessor
com.atlassian.confluence.spring.transaction.interceptor.ConfluenceSpringHostContextAccessor
- All Implemented Interfaces:
TransactionalHostContextAccessor
,com.atlassian.sal.spi.HostContextAccessor
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class ConfluenceSpringHostContextAccessor
extends com.atlassian.sal.spring.component.SpringHostContextAccessor
implements TransactionalHostContextAccessor
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.sal.spi.HostContextAccessor
com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T extends Object>
Nested classes/interfaces inherited from interface com.atlassian.confluence.spring.transaction.interceptor.TransactionalHostContextAccessor
TransactionalHostContextAccessor.Permission, TransactionalHostContextAccessor.Propagation
-
Constructor Summary
ConstructorDescriptionConfluenceSpringHostContextAccessor
(org.springframework.transaction.PlatformTransactionManager transactionManager) ConfluenceSpringHostContextAccessor
(org.springframework.transaction.PlatformTransactionManager transactionManager, VCacheRequestContextOperations ignored) Deprecated.since 8.0 -
Method Summary
Modifier and TypeMethodDescription<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.Methods inherited from class com.atlassian.sal.spring.component.SpringHostContextAccessor
doInTransaction, getComponentsOfType, getTransactionDefinition, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.sal.spi.HostContextAccessor
doInTransaction, getComponentsOfType
-
Constructor Details
-
ConfluenceSpringHostContextAccessor
public ConfluenceSpringHostContextAccessor(org.springframework.transaction.PlatformTransactionManager transactionManager) - Since:
- 8.0
-
ConfluenceSpringHostContextAccessor
@Deprecated public ConfluenceSpringHostContextAccessor(org.springframework.transaction.PlatformTransactionManager transactionManager, VCacheRequestContextOperations ignored) Deprecated.since 8.0
-
-
Method Details
-
doInTransaction
public <T> T doInTransaction(TransactionalHostContextAccessor.Propagation propagation, com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> callback) Description copied from interface:TransactionalHostContextAccessor
Runs an action in a transaction and returns a optional value.- Specified by:
doInTransaction
in interfaceTransactionalHostContextAccessor
- Parameters:
propagation
- the propagation mode to usecallback
- The callback class to execute- Returns:
- Optional result of the operation. May be null
-
doInTransaction
public <T> T doInTransaction(TransactionalHostContextAccessor.Permission permission, com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> callback) Description copied from interface:TransactionalHostContextAccessor
Runs an action in a transaction and returns a optional value. The transaction isTransactionalHostContextAccessor.Propagation.REQUIRED
.- Specified by:
doInTransaction
in interfaceTransactionalHostContextAccessor
- 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
-
doInTransaction
public <T> T doInTransaction(TransactionalHostContextAccessor.Propagation propagation, TransactionalHostContextAccessor.Permission permission, com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> callback) Description copied from interface:TransactionalHostContextAccessor
Runs an action in a transaction and returns a optional value.- Specified by:
doInTransaction
in interfaceTransactionalHostContextAccessor
- 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
-