IT_Bus::TransactionParticipant Class Reference

#include <it_bus/transaction_participant.h>

Inheritance diagram for IT_Bus::TransactionParticipant:

IT_Bus::RefCountedBase List of all members.

Detailed Description

The event interface used for participants of a transaction.

The operations on this interface are invoked during the lifetime of a transaction. If the transaction is being completed using a two phase commit protocol, the participant will have the opportunity to vote on the outcome of the transaction.

Participants wishing to be enlisted in a transaction should implement this interface and register themselves using the IT_Bus::TransactionManager::enlist() API.

Definition at line 26 of file transaction_participant.h.

Public Types

enum  VoteOutcome
 The possible outcomes from a call to the prepare() method during a two phase commit protocol. More...

Public Member Functions

virtual void commit_one_phase ()=0
 An event informing the participant that it should commit its state.
virtual VoteOutcome prepare ()=0
 An event informing the participant to prepare itself for the completion of the transaction.
virtual void commit ()=0
 An event informing the participant that it should commit its state.
virtual void rollback ()=0
 An event informing the participant that the transaction has been aborted and therefore it should rollback its state.
virtual void set_manager (TransactionManager *tx_manager)=0
 A callback event identifying the manager interface for the transaction within which it has been enlisted.
virtual String preferred_transaction_manager ()=0
 Query operation called after a participant has enlisted with the Artix transaction system to determine which type of transaction management interface it requires to be sent during the set_manager() event call.


Member Enumeration Documentation

enum IT_Bus::TransactionParticipant::VoteOutcome

The possible outcomes from a call to the prepare() method during a two phase commit protocol.

The 'VoteCommit' outcome indicates that a participants wishes the transaction to successfully complete. The 'VoteRollback' outcome indicates that a participants wishes the transaction to be aborted. The 'VoteReadOnly' outcome indicates that a participants represents a read-only resource and therefore does not wish to influence the outcome of the transaction. This outcome will not cause a transaction to be aborted.

Definition at line 43 of file transaction_participant.h.


Member Function Documentation

virtual void IT_Bus::TransactionParticipant::commit_one_phase (  )  [pure virtual]

An event informing the participant that it should commit its state.

This event indicates that a one phase commit protocol is in operation.

virtual VoteOutcome IT_Bus::TransactionParticipant::prepare (  )  [pure virtual]

An event informing the participant to prepare itself for the completion of the transaction.

The participant is required to vote on the outcome of the transaction. This is phase one in a two phase commit protocol. If this method is called, either commit() or rollback() must follow.

virtual void IT_Bus::TransactionParticipant::commit (  )  [pure virtual]

An event informing the participant that it should commit its state.

This is phase two in a two phase commit protocol.

virtual void IT_Bus::TransactionParticipant::rollback (  )  [pure virtual]

An event informing the participant that the transaction has been aborted and therefore it should rollback its state.

This is phase two in a two phase commit protocol.

virtual void IT_Bus::TransactionParticipant::set_manager ( TransactionManager tx_manager  )  [pure virtual]

A callback event identifying the manager interface for the transaction within which it has been enlisted.

For participants that require mode detailed interactions with the underlying transactional provider, this manager interface may be downcast to a more appropriate manager interface type. See preferred_transaction_manager() for more details.

Parameters:
tx_manager The management interface to the transaction. This manager interface can be downcast to a more specific interface derivation. For example, to an OTSTransactionManager, an XATransactionManager or to an WSAtomicTransactionManager interface.

virtual String IT_Bus::TransactionParticipant::preferred_transaction_manager (  )  [pure virtual]

Query operation called after a participant has enlisted with the Artix transaction system to determine which type of transaction management interface it requires to be sent during the set_manager() event call.

If the transaction manager preferred by a participant is different to that supported by the underlying transaction, Artix will interpose a transaction manager of the requested type between the participant and the transaction.

For example, the underlying transaction type is an OTS transaction, when called, the participant returns "ws-atomic-transaction" from this operation, indicating a preference for WS-AtomicTransaction style interactions. Artix will construct a WSAtomicTransactionManager that acts as an OTS resource manager to the underlying OTS transaction.

Returns:
A string representing the participants preference. Valid values are: DEFAULT_TRANSACTION_TYPE - No preference, use current default OTS_TRANSACTION_TYPE - CosTransactions OTS preferred WSAT_TRANSACTION_TYPE - WS-AtomicTransactions preferred


Generated on Tue Mar 20 15:28:08 2007 for Artix by  doxygen 1.5.1-p1