org.jboss.tm.usertx.server
Class UserTransactionSessionImpl

java.lang.Object
  extended byorg.jboss.tm.usertx.server.UserTransactionSessionImpl
All Implemented Interfaces:
java.rmi.Remote, UserTransactionSession (src)

public class UserTransactionSessionImpl
extends java.lang.Object
implements UserTransactionSession (src)

A UserTransaction session implementation. It handles transactions on behalf of a single client.


Constructor Summary
UserTransactionSessionImpl()
           
 
Method Summary
 java.lang.Object begin(int timeout)
          Start a new transaction, and return its TPC.
 void commit(java.lang.Object tpc)
          Commit the transaction.
 void destroy()
          Destroy this session.
static UserTransactionSession (src) getInstance()
           
 int getStatus(java.lang.Object tpc)
          Return status of the transaction.
protected static TransactionPropagationContextFactory (src) getTPCFactory()
          Get a reference to the TPC Factory
protected static TransactionManager (src) getTransactionManager()
          Get a reference to the transaction manager.
 void rollback(java.lang.Object tpc)
          Rollback the transaction.
 void setRollbackOnly(java.lang.Object tpc)
          Mark the transaction for rollback only.
 void unreferenced()
          When no longer referenced, be sure to rollback any transactions that are still active.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserTransactionSessionImpl

public UserTransactionSessionImpl()
Method Detail

getInstance

public static UserTransactionSession (src)  getInstance()

getTransactionManager

protected static TransactionManager (src)  getTransactionManager()
Get a reference to the transaction manager.


getTPCFactory

protected static TransactionPropagationContextFactory (src)  getTPCFactory()
Get a reference to the TPC Factory


destroy

public void destroy()
             throws java.rmi.RemoteException
Destroy this session.

Specified by:
destroy in interface UserTransactionSession (src)
Throws:
java.rmi.RemoteException

begin

public java.lang.Object begin(int timeout)
                       throws java.rmi.RemoteException,
                              NotSupportedException (src) ,
                              SystemException (src) 
Start a new transaction, and return its TPC.

Specified by:
begin in interface UserTransactionSession (src)
Parameters:
timeout - The timeout value for the new transaction, in seconds.
Returns:
The transaction propagation context for the new transaction.
Throws:
java.rmi.RemoteException
NotSupportedException (src)
SystemException (src)

commit

public void commit(java.lang.Object tpc)
            throws java.rmi.RemoteException,
                   RollbackException (src) ,
                   HeuristicMixedException (src) ,
                   HeuristicRollbackException (src) ,
                   java.lang.SecurityException,
                   java.lang.IllegalStateException,
                   SystemException (src) 
Commit the transaction.

Specified by:
commit in interface UserTransactionSession (src)
Parameters:
tpc - The transaction propagation context for the transaction.
Throws:
java.rmi.RemoteException
RollbackException (src)
HeuristicMixedException (src)
HeuristicRollbackException (src)
java.lang.SecurityException
java.lang.IllegalStateException
SystemException (src)

rollback

public void rollback(java.lang.Object tpc)
              throws java.rmi.RemoteException,
                     java.lang.SecurityException,
                     java.lang.IllegalStateException,
                     SystemException (src) 
Rollback the transaction.

Specified by:
rollback in interface UserTransactionSession (src)
Parameters:
tpc - The transaction propagation context for the transaction.
Throws:
java.rmi.RemoteException
java.lang.SecurityException
java.lang.IllegalStateException
SystemException (src)

setRollbackOnly

public void setRollbackOnly(java.lang.Object tpc)
                     throws java.rmi.RemoteException,
                            java.lang.IllegalStateException,
                            SystemException (src) 
Mark the transaction for rollback only.

Specified by:
setRollbackOnly in interface UserTransactionSession (src)
Parameters:
tpc - The transaction propagation context for the transaction.
Throws:
java.rmi.RemoteException
java.lang.IllegalStateException
SystemException (src)

getStatus

public int getStatus(java.lang.Object tpc)
              throws java.rmi.RemoteException,
                     SystemException (src) 
Return status of the transaction.

Specified by:
getStatus in interface UserTransactionSession (src)
Parameters:
tpc - The transaction propagation context for the transaction.
Throws:
java.rmi.RemoteException
SystemException (src)

unreferenced

public void unreferenced()
When no longer referenced, be sure to rollback any transactions that are still active.