当前页面:
在线文档首页 >
Spring Framework 2.1.0 API 文档英文版
TransactionInterceptor (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版
org.springframework.transaction.interceptor
Class TransactionInterceptor
java.lang.Object
org.springframework.transaction.interceptor.TransactionAspectSupport
org.springframework.transaction.interceptor.TransactionInterceptor
- All Implemented Interfaces:
- Serializable, Advice, Interceptor, MethodInterceptor, InitializingBean
public class TransactionInterceptor
- extends TransactionAspectSupport
- implements MethodInterceptor, Serializable
AOP Alliance MethodInterceptor providing declarative transaction
management using the common Spring transaction infrastructure.
Derives from the TransactionAspectSupport class. That class contains
the necessary calls into Spring's underlying transaction API:
subclasses such as this are responsible for calling superclass methods
such as createTransactionIfNecessary
in the correct order,
in the event of normal invocation return or an exception.
TransactionInterceptors are thread-safe.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
TransactionProxyFactoryBean
,
ProxyFactoryBean
,
TransactionAspectSupport
,
PlatformTransactionManager
,
Serialized Form
Methods inherited from class org.springframework.transaction.interceptor.TransactionAspectSupport |
afterPropertiesSet, cleanupTransactionInfo, commitTransactionAfterReturning, completeTransactionAfterThrowing, createTransactionIfNecessary, createTransactionIfNecessary, currentTransactionInfo, currentTransactionStatus, getTransactionAttributeSource, getTransactionManager, methodIdentification, prepareTransactionInfo, setTransactionAttributes, setTransactionAttributeSource, setTransactionAttributeSources, setTransactionManager |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransactionInterceptor
public TransactionInterceptor()
- Create a new TransactionInterceptor.
Transaction manager and transaction attributes still need to be set.
- See Also:
TransactionAspectSupport.setTransactionManager(org.springframework.transaction.PlatformTransactionManager)
,
TransactionAspectSupport.setTransactionAttributes(java.util.Properties)
,
TransactionAspectSupport.setTransactionAttributeSource(TransactionAttributeSource)
TransactionInterceptor
public TransactionInterceptor(PlatformTransactionManager ptm,
Properties attributes)
- Create a new TransactionInterceptor.
- Parameters:
ptm
- the transaction manager to perform the actual transaction managementattributes
- the transaction attributes in properties format- See Also:
TransactionAspectSupport.setTransactionManager(org.springframework.transaction.PlatformTransactionManager)
,
TransactionAspectSupport.setTransactionAttributes(java.util.Properties)
TransactionInterceptor
public TransactionInterceptor(PlatformTransactionManager ptm,
TransactionAttributeSource tas)
- Create a new TransactionInterceptor.
- Parameters:
ptm
- the transaction manager to perform the actual transaction managementtas
- the attribute source to be used to find transaction attributes- See Also:
TransactionAspectSupport.setTransactionManager(org.springframework.transaction.PlatformTransactionManager)
,
TransactionAspectSupport.setTransactionAttributeSource(TransactionAttributeSource)
invoke
public Object invoke(MethodInvocation invocation)
throws Throwable
- Specified by:
invoke
in interface MethodInterceptor
- Throws:
Throwable
Copyright © 2002-2007 The Spring Framework.