tppt.xopen
Interface APInterface

All Known Implementing Classes:
ApplicationProgram

public interface APInterface

This interface defines the methods that ApplicationProgram has to implemenet.

Version:
2.0
Author:
Jodie Wu

Method Summary
 boolean beginTransaction()
          Application call the tx_begin() to obtains the transaction id from TM when this method is called.
 void closeTransaction()
          Application calls the tx_close() to tell TransactionManager that this transaction has been done.
 void commitTransaction()
          Application call the tx_commit() to commit the transaction.
 int getTransactionId()
          Obtains the transaction id
 void setTransactionManager(TMInterface obj)
          Set up the TransactionManager instance.
 boolean setupSubTransaction()
          Initiate and define the sub-transaction(s) under this method.
 

Method Detail

getTransactionId

public int getTransactionId()
Obtains the transaction id
Returns:
transaction id

beginTransaction

public boolean beginTransaction()
Application call the tx_begin() to obtains the transaction id from TM when this method is called.
Returns:
true if obtains the transaction id sucessfully, false otherwise.
See Also:
TransactionManager.tx_begin()

setupSubTransaction

public boolean setupSubTransaction()
Initiate and define the sub-transaction(s) under this method.
Returns:
true if sub-transactions set up sucessfully; false otherwise.

commitTransaction

public void commitTransaction()
Application call the tx_commit() to commit the transaction. It is the start point of the two-phase commit protocol.

closeTransaction

public void closeTransaction()
Application calls the tx_close() to tell TransactionManager that this transaction has been done.
See Also:
TransactionManager.tx_close(int)

setTransactionManager

public void setTransactionManager(TMInterface obj)
Set up the TransactionManager instance. Notice that this method is called in the runtime by the TwoPhaseController when the user's TransactionManager is loaded.
Parameters:
obj - TMInterface object
See Also:
TMInterface