All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.txlayer.exchange.ExchangeTransaction

java.lang.Object
   |
   +----semper.txlayer.transaction.Transaction
           |
           +----semper.txlayer.exchange.ExchangeTransaction

public class ExchangeTransaction
extends Transaction
implements Serializable
this is the baseclass for performing exchanges. The exchange is done as a sequence of TransferTransaction.


Variable Index

 o _cont
 o _expectation
 o _offeredAttributes
 o _received_cont
 o _requestedAttributes
 o _role
 o _txc
 o NO_ROLE
Thee constants define the roles.
 o ORIGINATOR
 o RESPONDER

Constructor Index

 o ExchangeTransaction()
Empty Constructor.
 o ExchangeTransaction(Container)
Create an ExchangeTransaction from a Container.
 o ExchangeTransaction(TransactionID)

Method Index

 o getObject()
This method gives the Object that was received in the exchange.
 o prepareOriginator(TXSubContext, AttributeSet, AttributeSet, Description)
This method must be called before a begin().
 o prepareOriginator(TXSubContext, Description)
This method must be called before a begin().
 o prepareResponder(TXSubContext, AttributeSet, AttributeSet, Description)
This method must be called before a begin().
 o prepareResponder(TXSubContext, Description)
This method must be called before a begin().
 o run()
This is the method we have to implement because we extend from Transaction.

Variables

 o NO_ROLE
 public static final int NO_ROLE
Thee constants define the roles.

 o ORIGINATOR
 public static final int ORIGINATOR
 o RESPONDER
 public static final int RESPONDER
 o _cont
 protected Container _cont
 o _received_cont
 protected Container _received_cont
 o _role
 protected int _role
 o _expectation
 protected Description _expectation
 o _txc
 protected TXSubContext _txc
 o _offeredAttributes
 protected AttributeSet _offeredAttributes
 o _requestedAttributes
 protected AttributeSet _requestedAttributes

Constructors

 o ExchangeTransaction
 public ExchangeTransaction()
Empty Constructor. Can be used.

 o ExchangeTransaction
 public ExchangeTransaction(TransactionID tid)
Parameters:
tid - The TransactionID the ExchangeTransaction should have.
 o ExchangeTransaction
 public ExchangeTransaction(Container c)
Create an ExchangeTransaction from a Container.

Parameters:
c - The Container.

Methods

 o run
 public void run()
This is the method we have to implement because we extend from Transaction. The exchange takes place here.

Overrides:
run in class Transaction
 o prepareOriginator
 public void prepareOriginator(TXSubContext txc,
                               Description expectation)
This method must be called before a begin(). Necessary to prepare one side as Originator.

Parameters:
txc - The context that contains means for communication.
expectation - The description of the goods we want to receive.
 o prepareOriginator
 public void prepareOriginator(TXSubContext txc,
                               AttributeSet offeredAttributes,
                               AttributeSet requestedAttributes,
                               Description expectation)
This method must be called before a begin(). Necessary to prepare one side as Originator.

Parameters:
txc - The context that contains means for communication.
secAttributes - The security attributes that are to be applied to each transfer.
expectation - The description of the goods we want to receive.
 o prepareResponder
 public void prepareResponder(TXSubContext txc,
                              Description expectation)
This method must be called before a begin(). It is necessary to prepare one side as Responder.

Parameters:
txc - The context that contains means for communication.
expectation - The description of the goods we want to receive.
 o prepareResponder
 public void prepareResponder(TXSubContext txc,
                              AttributeSet offeredAttributes,
                              AttributeSet requestedAttributes,
                              Description expectation)
This method must be called before a begin(). It is necessary to prepare one side as Responder.

Parameters:
txc - The context that contains means for communication.
secAttributes - The security attributes that are to be applied to each transfer.
expectation - The description of the goods we want to receive.
 o getObject
 public Object getObject()
This method gives the Object that was received in the exchange.

Returns:
The received object.

All Packages  Class Hierarchy  This Package  Previous  Next  Index