Class ManagedTransactionAdapter
- java.lang.Object
- org.springframework.transaction.jta.ManagedTransactionAdapter
- All Implemented Interfaces:
Transaction
public class ManagedTransactionAdapter extends Object implements Transaction
Adapter for a managed JTA Transaction handle, taking a JTATransactionManagerreference and creating a JTATransactionhandle for it.- Since:
- 3.0.2
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description ManagedTransactionAdapter(TransactionManager transactionManager)Create a new ManagedTransactionAdapter for the given TransactionManager.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit()booleandelistResource(XAResource xaRes, int flag)booleanenlistResource(XAResource xaRes)intgetStatus()TransactionManagergetTransactionManager()Return the JTA TransactionManager that this adapter delegates to.voidregisterSynchronization(Synchronization sync)voidrollback()voidsetRollbackOnly()
Constructor Detail
ManagedTransactionAdapter
public ManagedTransactionAdapter(TransactionManager transactionManager) throws SystemException
Create a new ManagedTransactionAdapter for the given TransactionManager.- Parameters:
transactionManager- the JTA TransactionManager to wrap- Throws:
SystemException
Method Detail
getTransactionManager
public final TransactionManager getTransactionManager()
Return the JTA TransactionManager that this adapter delegates to.
commit
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException
- Specified by:
commitin interfaceTransaction- Throws:
RollbackExceptionHeuristicMixedExceptionHeuristicRollbackExceptionSecurityExceptionSystemException
rollback
public void rollback() throws SystemException
- Specified by:
rollbackin interfaceTransaction- Throws:
SystemException
setRollbackOnly
public void setRollbackOnly() throws SystemException
- Specified by:
setRollbackOnlyin interfaceTransaction- Throws:
SystemException
getStatus
public int getStatus() throws SystemException
- Specified by:
getStatusin interfaceTransaction- Throws:
SystemException
enlistResource
public boolean enlistResource(XAResource xaRes) throws RollbackException, SystemException
- Specified by:
enlistResourcein interfaceTransaction- Throws:
RollbackExceptionSystemException
delistResource
public boolean delistResource(XAResource xaRes, int flag) throws SystemException
- Specified by:
delistResourcein interfaceTransaction- Throws:
SystemException
registerSynchronization
public void registerSynchronization(Synchronization sync) throws RollbackException, SystemException
- Specified by:
registerSynchronizationin interfaceTransaction- Throws:
RollbackExceptionSystemException