com.sun.jts.jta
Class TransactionImpl

java.lang.Object
  extended by com.sun.jts.jta.TransactionImpl
All Implemented Interfaces:
TransactionInternal, Transaction

public class TransactionImpl
extends java.lang.Object
implements TransactionInternal

An implementation of javax.transaction.Transaction using JTS XXX TODO should catch all org.omg.CORBA.SystemException and throw javax.transaction.SystemException

Author:
Tony Ng

Constructor Summary
TransactionImpl(org.omg.CosTransactions.Control control, GlobalTID gtid)
           
 
Method Summary
 void commit()
          Complete the transaction represented by this Transaction object
 boolean delistResource(XAResource res, int flags)
           
 boolean enlistResource(XAResource res)
          enlist a resource with the current transaction If a transaction is marked as rollback, enlistment will succeed if the resource has been enlisted before.
 boolean equals(java.lang.Object object)
           
 long getStartTime()
           
 int getStatus()
           
 java.lang.String getTransactionId()
           
 int hashCode()
           
 void registerInterposedSynchronization(Synchronization sync)
           
 void registerSynchronization(Synchronization sync)
           
 void rollback()
          Rollback the transaction represented by this Transaction object.
 void setRollbackOnly()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionImpl

public TransactionImpl(org.omg.CosTransactions.Control control,
                       GlobalTID gtid)
                throws SystemException
Throws:
SystemException
Method Detail

commit

public void commit()
            throws HeuristicMixedException,
                   RollbackException,
                   HeuristicRollbackException,
                   java.lang.IllegalStateException,
                   java.lang.SecurityException,
                   SystemException
Complete the transaction represented by this Transaction object

Specified by:
commit in interface Transaction
Throws:
HeuristicMixedException
RollbackException
HeuristicRollbackException
java.lang.IllegalStateException
java.lang.SecurityException
SystemException

rollback

public void rollback()
              throws java.lang.IllegalStateException,
                     SystemException
Rollback the transaction represented by this Transaction object.

Specified by:
rollback in interface Transaction
Throws:
java.lang.IllegalStateException
SystemException

enlistResource

public boolean enlistResource(XAResource res)
                       throws RollbackException,
                              java.lang.IllegalStateException,
                              SystemException
enlist a resource with the current transaction If a transaction is marked as rollback, enlistment will succeed if the resource has been enlisted before. Otherwise, enlistment will fail. In both cases, a RollbackException will be thrown.

Specified by:
enlistResource in interface Transaction
Throws:
RollbackException
java.lang.IllegalStateException
SystemException

delistResource

public boolean delistResource(XAResource res,
                              int flags)
                       throws java.lang.IllegalStateException,
                              SystemException
Specified by:
delistResource in interface Transaction
Throws:
java.lang.IllegalStateException
SystemException

getStatus

public int getStatus()
              throws SystemException
Specified by:
getStatus in interface Transaction
Throws:
SystemException

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

registerSynchronization

public void registerSynchronization(Synchronization sync)
                             throws RollbackException,
                                    java.lang.IllegalStateException,
                                    SystemException
Specified by:
registerSynchronization in interface Transaction
Throws:
RollbackException
java.lang.IllegalStateException
SystemException

registerInterposedSynchronization

public void registerInterposedSynchronization(Synchronization sync)
                                       throws RollbackException,
                                              java.lang.IllegalStateException,
                                              SystemException
Specified by:
registerInterposedSynchronization in interface TransactionInternal
Throws:
RollbackException
java.lang.IllegalStateException
SystemException

setRollbackOnly

public void setRollbackOnly()
                     throws java.lang.IllegalStateException,
                            SystemException
Specified by:
setRollbackOnly in interface Transaction
Throws:
java.lang.IllegalStateException
SystemException

getTransactionId

public java.lang.String getTransactionId()

getStartTime

public long getStartTime()


Copyright © 2012 GlassFish Community. All Rights Reserved.