public class TransactionInterceptor extends TransactionAspectSupport implements java.io.Serializable
PlatformTransactionManager
).
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(java.lang.reflect.Method, java.lang.Class<?>, org.springframework.transaction.interceptor.TransactionAspectSupport.InvocationCallback)
in the correct order.
TransactionInterceptors are thread-safe.
TransactionProxyFactoryBean
,
ProxyFactoryBean
,
ProxyFactory
,
Serialized FormTransactionAspectSupport.InvocationCallback, TransactionAspectSupport.TransactionInfo
logger
Constructor and Description |
---|
TransactionInterceptor()
Create a new TransactionInterceptor.
|
TransactionInterceptor(PlatformTransactionManager ptm,
java.util.Properties attributes)
Create a new TransactionInterceptor.
|
TransactionInterceptor(PlatformTransactionManager ptm,
TransactionAttributeSource tas)
Create a new TransactionInterceptor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
invoke(MethodInvocation invocation) |
private void |
readObject(java.io.ObjectInputStream ois) |
private void |
writeObject(java.io.ObjectOutputStream oos) |
afterPropertiesSet, cleanupTransactionInfo, clearTransactionManagerCache, commitTransactionAfterReturning, completeTransactionAfterThrowing, createTransactionIfNecessary, currentTransactionInfo, currentTransactionStatus, determineTransactionManager, getBeanFactory, getTransactionAttributeSource, getTransactionManager, getTransactionManagerBeanName, invokeWithinTransaction, methodIdentification, prepareTransactionInfo, setBeanFactory, setTransactionAttributes, setTransactionAttributeSource, setTransactionAttributeSources, setTransactionManager, setTransactionManagerBeanName
public TransactionInterceptor()
Transaction manager and transaction attributes still need to be set.
public TransactionInterceptor(PlatformTransactionManager ptm, java.util.Properties attributes)
ptm
- the default transaction manager to perform the actual transaction managementattributes
- the transaction attributes in properties formatTransactionAspectSupport.setTransactionManager(org.springframework.transaction.PlatformTransactionManager)
,
TransactionAspectSupport.setTransactionAttributes(java.util.Properties)
public TransactionInterceptor(PlatformTransactionManager ptm, TransactionAttributeSource tas)
ptm
- the default transaction manager to perform the actual transaction managementtas
- the attribute source to be used to find transaction attributesTransactionAspectSupport.setTransactionManager(org.springframework.transaction.PlatformTransactionManager)
,
TransactionAspectSupport.setTransactionAttributeSource(TransactionAttributeSource)
public java.lang.Object invoke(MethodInvocation invocation) throws java.lang.Throwable
java.lang.Throwable
private void writeObject(java.io.ObjectOutputStream oos) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream ois) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException