Class TransactionImpl
- java.lang.Object
 - 
- org.apache.geronimo.transaction.manager.TransactionImpl
 
 
- 
- All Implemented Interfaces:
 javax.transaction.Transaction
public class TransactionImpl extends java.lang.Object implements javax.transaction.TransactionBasic local transaction with support for multiple resources. 
- 
- 
Constructor Summary
Constructors Constructor Description TransactionImpl(javax.transaction.xa.Xid xid, TransactionManagerImpl txManager) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.geronimo.transaction.manager.TransactionImpl.TransactionBranchaddBranchXid(javax.transaction.xa.XAResource xaRes, javax.transaction.xa.Xid branchId)voidcommit()Complete the transaction represented by this Transaction object.booleandelistResource(javax.transaction.xa.XAResource xaRes, int flag)Disassociate the resource specified from the transaction associated with the target Transaction object.booleanenlistResource(javax.transaction.xa.XAResource xaRes)Enlist the resource specified with the transaction associated with the target Transaction object.booleanequals(java.lang.Object obj)java.lang.ObjectgetResource(java.lang.Object key)booleangetRollbackOnly()intgetStatus()Obtain the status of the transaction associated with the target Transaction object.java.lang.ObjectgetTransactionKey()intgetTransactionStatus()voidputResource(java.lang.Object key, java.lang.Object value)voidregisterInterposedSynchronization(javax.transaction.Synchronization synchronization)voidregisterSynchronization(javax.transaction.Synchronization synch)Register a synchronization object for the transaction currently associated with the target object.voidrollback()Rollback the transaction represented by this Transaction object.voidsetRollbackOnly()Modify the transaction associated with the target object such that the only possible outcome of the transaction is to roll back the transaction.voidsetRollbackOnly(java.lang.Throwable reason) 
 - 
 
- 
- 
Constructor Detail
- 
TransactionImpl
public TransactionImpl(javax.transaction.xa.Xid xid, TransactionManagerImpl txManager) 
 - 
 
- 
Method Detail
- 
getStatus
public int getStatus()
Description copied from interface:javax.transaction.TransactionObtain the status of the transaction associated with the target Transaction object.- Specified by:
 getStatusin interfacejavax.transaction.Transaction- Returns:
 - The transaction status. If no transaction is associated with the target object, this method returns the Status.NoTransaction value.
 
 
- 
getResource
public java.lang.Object getResource(java.lang.Object key)
 
- 
getRollbackOnly
public boolean getRollbackOnly()
 
- 
getTransactionKey
public java.lang.Object getTransactionKey()
 
- 
getTransactionStatus
public int getTransactionStatus()
 
- 
putResource
public void putResource(java.lang.Object key, java.lang.Object value) 
- 
registerInterposedSynchronization
public void registerInterposedSynchronization(javax.transaction.Synchronization synchronization)
 
- 
setRollbackOnly
public void setRollbackOnly() throws java.lang.IllegalStateExceptionDescription copied from interface:javax.transaction.TransactionModify the transaction associated with the target object such that the only possible outcome of the transaction is to roll back the transaction.- Specified by:
 setRollbackOnlyin interfacejavax.transaction.Transaction- Throws:
 java.lang.IllegalStateException- Thrown if the target object is not associated with any transaction.
 
- 
setRollbackOnly
public void setRollbackOnly(java.lang.Throwable reason)
 
- 
registerSynchronization
public void registerSynchronization(javax.transaction.Synchronization synch) throws java.lang.IllegalStateException, javax.transaction.RollbackException, javax.transaction.SystemExceptionDescription copied from interface:javax.transaction.TransactionRegister a synchronization object for the transaction currently associated with the target object. The transction manager invokes the beforeCompletion method prior to starting the two-phase transaction commit process. After the transaction is completed, the transaction manager invokes the afterCompletion method.- Specified by:
 registerSynchronizationin interfacejavax.transaction.Transaction- Parameters:
 synch- The Synchronization object for the transaction associated with the target object.- Throws:
 java.lang.IllegalStateException- Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.javax.transaction.RollbackException- Thrown to indicate that the transaction has been marked for rollback only.javax.transaction.SystemException- Thrown if the transaction manager encounters an unexpected error condition.
 
- 
enlistResource
public boolean enlistResource(javax.transaction.xa.XAResource xaRes) throws java.lang.IllegalStateException, javax.transaction.RollbackException, javax.transaction.SystemExceptionDescription copied from interface:javax.transaction.TransactionEnlist the resource specified with the transaction associated with the target Transaction object.- Specified by:
 enlistResourcein interfacejavax.transaction.Transaction- Parameters:
 xaRes- The XAResource object associated with the resource (connection).- Returns:
 - true if the resource was enlisted successfully; otherwise false.
 - Throws:
 java.lang.IllegalStateException- Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.javax.transaction.RollbackException- Thrown to indicate that the transaction has been marked for rollback only.javax.transaction.SystemException- Thrown if the transaction manager encounters an unexpected error condition.
 
- 
delistResource
public boolean delistResource(javax.transaction.xa.XAResource xaRes, int flag) throws java.lang.IllegalStateException, javax.transaction.SystemExceptionDescription copied from interface:javax.transaction.TransactionDisassociate the resource specified from the transaction associated with the target Transaction object.- Specified by:
 delistResourcein interfacejavax.transaction.Transaction- Parameters:
 xaRes- The XAResource object associated with the resource (connection).flag- One of the values of TMSUCCESS, TMSUSPEND, or TMFAIL.- Returns:
 - true if the resource was delisted successfully; otherwise false.
 - Throws:
 java.lang.IllegalStateException- Thrown if the transaction in the target object is inactive.javax.transaction.SystemException- Thrown if the transaction manager encounters an unexpected error condition.
 
- 
commit
public void commit() throws javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, javax.transaction.RollbackException, java.lang.SecurityException, javax.transaction.SystemExceptionDescription copied from interface:javax.transaction.TransactionComplete the transaction represented by this Transaction object.- Specified by:
 commitin interfacejavax.transaction.Transaction- Throws:
 javax.transaction.HeuristicMixedException- Thrown to indicate that a heuristic decision was made and that some relevant updates have been committed while others have been rolled back.javax.transaction.HeuristicRollbackException- Thrown to indicate that a heuristic decision was made and that all relevant updates have been rolled back.javax.transaction.RollbackException- Thrown to indicate that the transaction has been rolled back rather than committed.java.lang.SecurityException- Thrown to indicate that the thread is not allowed to commit the transaction.javax.transaction.SystemException- Thrown if the transaction manager encounters an unexpected error condition.
 
- 
rollback
public void rollback() throws java.lang.IllegalStateException, javax.transaction.SystemExceptionDescription copied from interface:javax.transaction.TransactionRollback the transaction represented by this Transaction object.- Specified by:
 rollbackin interfacejavax.transaction.Transaction- Throws:
 java.lang.IllegalStateException- Thrown if the transaction in the target object is in the prepared state or the transaction is inactive.javax.transaction.SystemException- Thrown if the transaction manager encounters an unexpected error condition.
 
- 
equals
public boolean equals(java.lang.Object obj)
- Overrides:
 equalsin classjava.lang.Object
 
- 
addBranchXid
public org.apache.geronimo.transaction.manager.TransactionImpl.TransactionBranch addBranchXid(javax.transaction.xa.XAResource xaRes, javax.transaction.xa.Xid branchId) 
 - 
 
 -