activemq-cpp-3.6.0
cms::Xid Class Reference

An interface which provides a mapping for the X/Open XID transaction identifier structure. More...

#include <src/main/cms/Xid.h>

Inheritance diagram for cms::Xid:

Public Member Functions

 Xid ()
virtual ~Xid ()
virtual Xidclone () const =0
 Creates a Copy of this Xid instance that contains the same id values.
virtual bool equals (const Xid *other) const =0
 Compares this Xid to another and returns true if they are the same.
virtual int getBranchQualifier (unsigned char *buffer, int size) const =0
 Gets the transaction branch qualifier component of the XID.
virtual int getFormatId () const =0
 Gets the format identifier component of the XID.
virtual int getGlobalTransactionId (unsigned char *buffer, int size) const =0
 Gets the global transaction id component of the XID.

Static Public Attributes

static const int MAXGTRIDSIZE
 The maximum number of bytes which will be copied into the array passed to getGlobaltransactionId().
static const int MAXBQUALSIZE
 The maximum number of bytes which will be copied into the array that is passed to getBranchQualifier().

Detailed Description

An interface which provides a mapping for the X/Open XID transaction identifier structure.

The Xid interface is used by the Transaction Manager and the Resource managers. It is not typically used by application programs directly but the application developer must define a mechanism to map the calls and structures used by the Transaction Manager API in use into the format used by the CMS XA interfaces.

Since
2.3

Constructor & Destructor Documentation

cms::Xid::Xid ( )
virtual cms::Xid::~Xid ( )
virtual

Member Function Documentation

virtual Xid* cms::Xid::clone ( ) const
pure virtual

Creates a Copy of this Xid instance that contains the same id values.

Returns
a new Xid instance that is equal to this one when compared.

Implemented in activemq::commands::XATransactionId.

virtual bool cms::Xid::equals ( const Xid other) const
pure virtual

Compares this Xid to another and returns true if they are the same.

Returns
true if both Xid's represent that same id value.
virtual int cms::Xid::getBranchQualifier ( unsigned char *  buffer,
int  size 
) const
pure virtual

Gets the transaction branch qualifier component of the XID.

The value of this Xid's branch qualifier is copied into the buffer provided. If the size of the provided buffer is not large enough to accommodate the branch qualifier then no copy is performed and the method returns -1.

Parameters
bufferThe location in memory to copy the qualifier bytes to.
sizeThe size of the buffer provided.
Returns
the number of bytes copied into the buffer, or -1 if the buffer provided was not large enough.
Exceptions
XAExceptionif the size parameter is less than zero or buffer is NULL.

Implemented in activemq::commands::XATransactionId.

virtual int cms::Xid::getFormatId ( ) const
pure virtual

Gets the format identifier component of the XID.

Returns
an integer containing the format identifier. 0 means the OSI CCR format.

Implemented in activemq::commands::XATransactionId.

virtual int cms::Xid::getGlobalTransactionId ( unsigned char *  buffer,
int  size 
) const
pure virtual

Gets the global transaction id component of the XID.

The value of this Xid's transaction id is copied into the buffer provided. If the size of the provided buffer is not large enough to accommodate the transaction id then no copy is performed and the method returns -1.

Parameters
bufferThe location in memory to copy the transaction id bytes to.
sizeThe size of the buffer provided.
Returns
the number of bytes copied into the buffer, or -1 if the buffer provided was not large enough.
Exceptions
XAExceptionif the size parameter is less than zero or buffer is NULL.

Implemented in activemq::commands::XATransactionId.

Field Documentation

const int cms::Xid::MAXBQUALSIZE
static

The maximum number of bytes which will be copied into the array that is passed to getBranchQualifier().

const int cms::Xid::MAXGTRIDSIZE
static

The maximum number of bytes which will be copied into the array passed to getGlobaltransactionId().


The documentation for this class was generated from the following file: