transaction
Class TransactionManagerImpl

java.lang.Object
  extended by transaction.TransactionManagerImpl
All Implemented Interfaces:
java.rmi.Remote, ITransactionManager

public class TransactionManagerImpl
extends java.lang.Object
implements ITransactionManager


Field Summary
 
Fields inherited from interface transaction.ITransactionManager
RMI_TM_NAME
 
Constructor Summary
TransactionManagerImpl()
           
 
Method Summary
 boolean abort(int xid)
          Abort a distributed transaction.
 int begin()
          Begin a new distributed transaction.
 boolean commit(int xid)
          Commit a distributed transaction.
 boolean enlist(java.lang.String resourceManagerRMIName, int globalXID)
          Enlist a resource manager with the given name to the list of participants for the given distributed transaction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionManagerImpl

public TransactionManagerImpl()
Method Detail

abort

public boolean abort(int xid)
              throws TransactionAbortedException,
                     InvalidTransactionException,
                     java.rmi.RemoteException
Description copied from interface: ITransactionManager
Abort a distributed transaction.

Specified by:
abort in interface ITransactionManager
Parameters:
xid - the id of the distributed transaction
Returns:
true on success, false otherwise
Throws:
TransactionAbortedException
InvalidTransactionException
java.rmi.RemoteException

begin

public int begin()
          throws java.rmi.RemoteException
Description copied from interface: ITransactionManager
Begin a new distributed transaction.

Specified by:
begin in interface ITransactionManager
Returns:
a globally unique transaction id
Throws:
java.rmi.RemoteException

commit

public boolean commit(int xid)
               throws TransactionAbortedException,
                      InvalidTransactionException,
                      java.rmi.RemoteException
Description copied from interface: ITransactionManager
Commit a distributed transaction. Initializes the 2PC protocol.

Specified by:
commit in interface ITransactionManager
Parameters:
xid - the id of the distributed transaction
Returns:
true on success, false otherwise
Throws:
TransactionAbortedException
InvalidTransactionException
java.rmi.RemoteException

enlist

public boolean enlist(java.lang.String resourceManagerRMIName,
                      int globalXID)
Description copied from interface: ITransactionManager
Enlist a resource manager with the given name to the list of participants for the given distributed transaction.

Specified by:
enlist in interface ITransactionManager
Parameters:
resourceManagerRMIName - the RMI name of the RM
globalXID - the id of the distributed transaction
Returns:
true on success, false otherwise