Class TransactionInterceptor
java.lang.Object
org.springframework.transaction.interceptor.TransactionAspectSupport
org.springframework.transaction.interceptor.TransactionInterceptor
- All Implemented Interfaces:
Serializable, org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean
public class TransactionInterceptor
extends TransactionAspectSupport
implements org.aopalliance.intercept.MethodInterceptor, Serializable
AOP Alliance MethodInterceptor for declarative transaction
management using the common Spring transaction infrastructure
(
PlatformTransactionManager/
ReactiveTransactionManager).
Derives from the TransactionAspectSupport class which
contains the integration with Spring's underlying transaction API.
TransactionInterceptor simply calls the relevant superclass methods
such as TransactionAspectSupport.invokeWithinTransaction(Method, Class, TransactionAspectSupport.InvocationCallback) in the correct order.
TransactionInterceptors are thread-safe.
- Author:
- Rod Johnson, Juergen Hoeller, Sebastien Deleuze
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class TransactionAspectSupport
TransactionAspectSupport.InvocationCallback, TransactionAspectSupport.TransactionInfo -
Field Summary
Fields inherited from class TransactionAspectSupport
logger -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new TransactionInterceptor.TransactionInterceptor(PlatformTransactionManager ptm, Properties attributes) Deprecated.Deprecated.Create a new TransactionInterceptor. -
Method Summary
Methods inherited from class TransactionAspectSupport
afterPropertiesSet, cleanupTransactionInfo, clearTransactionManagerCache, commitTransactionAfterReturning, completeTransactionAfterThrowing, createTransactionIfNecessary, currentTransactionInfo, currentTransactionStatus, determineTransactionManager, determineTransactionManager, getBeanFactory, getTransactionAttributeSource, getTransactionManager, getTransactionManagerBeanName, invokeWithinTransaction, methodIdentification, prepareTransactionInfo, setBeanFactory, setTransactionAttributes, setTransactionAttributeSource, setTransactionAttributeSources, setTransactionManager, setTransactionManagerBeanName
-
Constructor Details
-
TransactionInterceptor
public TransactionInterceptor()Create a new TransactionInterceptor.Transaction manager and transaction attributes still need to be set.
- See Also:
-
TransactionInterceptor
Create a new TransactionInterceptor.- Parameters:
ptm- the default transaction manager to perform the actual transaction managementtas- the attribute source to be used to find transaction attributes- Since:
- 5.2.5
- See Also:
-
TransactionInterceptor
@Deprecated(since="5.2.5") public TransactionInterceptor(PlatformTransactionManager ptm, TransactionAttributeSource tas) Deprecated.Create a new TransactionInterceptor.- Parameters:
ptm- the default transaction manager to perform the actual transaction managementtas- the attribute source to be used to find transaction attributes- See Also:
-
TransactionInterceptor
@Deprecated(since="5.2.5") public TransactionInterceptor(PlatformTransactionManager ptm, Properties attributes) Deprecated.Create a new TransactionInterceptor.- Parameters:
ptm- the default transaction manager to perform the actual transaction managementattributes- the transaction attributes in properties format- See Also:
-
-
Method Details
-
invoke
-
TransactionAspectSupport.setTransactionAttributes(Properties)