com.caucho.transaction
Class UserTransactionProxy

java.lang.Object
  extended by com.caucho.transaction.UserTransactionProxy
All Implemented Interfaces:
java.io.Serializable, TransactionManager, UserTransaction

public class UserTransactionProxy
extends java.lang.Object
implements UserTransaction, TransactionManager, java.io.Serializable

Implementation of the UserTransactionImpl for a thread instance.

See Also:
Serialized Form

Method Summary
 void abortTransaction()
          Finish any transaction.
 void begin()
          Start the transaction.
 void commit()
          Commits the transaction
static UserTransactionProxy getCurrent()
          Returns the local UT proxy.
 UserTransactionImpl getCurrentUserTransactionImpl()
          Gets the current thread transaction.
static UserTransactionProxy getInstance()
          Returns the local UT proxy.
 int getStatus()
          Gets the transaction's status
 Transaction getTransaction()
          Returns the current transaction.
 UserTransactionImpl getUserTransaction()
          Gets the thread transaction.
 void recover(XAResource xaRes)
          Recovers an XAResource
 void resume(Transaction transaction)
          Resume a transaction.
 void rollback()
          Rolls the transaction back
 void setRollbackOnly()
          Marks the transaction as rollback only.
 void setRollbackOnly(java.lang.Exception e)
          Marks the transaction as rollback only.
 void setTransactionTimeout(int seconds)
          Sets the transaction's timeout.
 Transaction suspend()
          Suspends the transaction.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static UserTransactionProxy getInstance()
Returns the local UT proxy.


getCurrent

public static UserTransactionProxy getCurrent()
Returns the local UT proxy.


getUserTransaction

public UserTransactionImpl getUserTransaction()
Gets the thread transaction.


getCurrentUserTransactionImpl

public UserTransactionImpl getCurrentUserTransactionImpl()
Gets the current thread transaction.


setTransactionTimeout

public void setTransactionTimeout(int seconds)
                           throws SystemException
Sets the transaction's timeout.

Specified by:
setTransactionTimeout in interface TransactionManager
Specified by:
setTransactionTimeout in interface UserTransaction
Throws:
SystemException

getStatus

public int getStatus()
              throws SystemException
Gets the transaction's status

Specified by:
getStatus in interface TransactionManager
Specified by:
getStatus in interface UserTransaction
Throws:
SystemException

begin

public void begin()
           throws NotSupportedException,
                  SystemException
Start the transaction.

Specified by:
begin in interface TransactionManager
Specified by:
begin in interface UserTransaction
Throws:
NotSupportedException
SystemException

setRollbackOnly

public void setRollbackOnly()
                     throws java.lang.IllegalStateException,
                            SystemException
Marks the transaction as rollback only.

Specified by:
setRollbackOnly in interface TransactionManager
Specified by:
setRollbackOnly in interface UserTransaction
Throws:
java.lang.IllegalStateException
SystemException

setRollbackOnly

public void setRollbackOnly(java.lang.Exception e)
                     throws java.lang.IllegalStateException
Marks the transaction as rollback only.

Throws:
java.lang.IllegalStateException

commit

public void commit()
            throws java.lang.IllegalStateException,
                   RollbackException,
                   HeuristicMixedException,
                   HeuristicRollbackException,
                   java.lang.SecurityException,
                   SystemException
Commits the transaction

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

rollback

public void rollback()
              throws java.lang.IllegalStateException,
                     java.lang.SecurityException,
                     SystemException
Rolls the transaction back

Specified by:
rollback in interface TransactionManager
Specified by:
rollback in interface UserTransaction
Throws:
java.lang.IllegalStateException
java.lang.SecurityException
SystemException

abortTransaction

public void abortTransaction()
                      throws java.lang.IllegalStateException
Finish any transaction.

Throws:
java.lang.IllegalStateException

recover

public void recover(XAResource xaRes)
             throws XAException
Recovers an XAResource

Throws:
XAException

getTransaction

public Transaction getTransaction()
                           throws SystemException
Returns the current transaction.

Specified by:
getTransaction in interface TransactionManager
Throws:
SystemException

suspend

public Transaction suspend()
                    throws SystemException
Suspends the transaction.

Specified by:
suspend in interface TransactionManager
Throws:
SystemException

resume

public void resume(Transaction transaction)
            throws java.lang.IllegalStateException,
                   InvalidTransactionException,
                   SystemException
Resume a transaction.

Specified by:
resume in interface TransactionManager
Throws:
java.lang.IllegalStateException
InvalidTransactionException
SystemException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object