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 JTATransactionManager
reference and creating a JTATransaction
handle 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 void
commit()
boolean
delistResource(XAResource xaRes, int flag)
boolean
enlistResource(XAResource xaRes)
int
getStatus()
TransactionManager
getTransactionManager()
Return the JTA TransactionManager that this adapter delegates to.void
registerSynchronization(Synchronization sync)
void
rollback()
void
setRollbackOnly()
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:
commit
in interfaceTransaction
- Throws:
RollbackException
HeuristicMixedException
HeuristicRollbackException
SecurityException
SystemException
rollback
public void rollback() throws SystemException
- Specified by:
rollback
in interfaceTransaction
- Throws:
SystemException
setRollbackOnly
public void setRollbackOnly() throws SystemException
- Specified by:
setRollbackOnly
in interfaceTransaction
- Throws:
SystemException
getStatus
public int getStatus() throws SystemException
- Specified by:
getStatus
in interfaceTransaction
- Throws:
SystemException
enlistResource
public boolean enlistResource(XAResource xaRes) throws RollbackException, SystemException
- Specified by:
enlistResource
in interfaceTransaction
- Throws:
RollbackException
SystemException
delistResource
public boolean delistResource(XAResource xaRes, int flag) throws SystemException
- Specified by:
delistResource
in interfaceTransaction
- Throws:
SystemException
registerSynchronization
public void registerSynchronization(Synchronization sync) throws RollbackException, SystemException
- Specified by:
registerSynchronization
in interfaceTransaction
- Throws:
RollbackException
SystemException