Package bitronix.tm
Class BitronixXid
java.lang.Object
bitronix.tm.BitronixXid
- All Implemented Interfaces:
Xid
Implementation of
Xid.
A XID is divided in two parts: globalTransactionId (GTRID) and branchQualifier (BQUAL). The first one uniquely identifies the global transaction while the latter uniquely identifies the transaction branch, or the local part of the global transaction inside a resource.
Technically in the Bitronix implementation, GTRID and BQUAL have the same format as described by Mike Spille.
Each BitronixTransaction get assigned a GTRID at creation time and full XIDs are created and
assigned to every XAResourceHolderState when enlisted in the transaction's
XAResourceManager. Both GTRID and XIDs are generated
by the UidGenerator.
- Author:
- lorban
- See Also:
-
Field Summary
FieldsFields inherited from interface javax.transaction.xa.Xid
MAXBQUALSIZE, MAXGTRIDSIZE -
Constructor Summary
ConstructorsConstructorDescriptionBitronixXid(Uid globalTransactionId, Uid branchQualifier) Create a new XID using the specified GTRID and BQUAL.BitronixXid(Xid xid) -
Method Summary
-
Field Details
-
FORMAT_ID
public static final int FORMAT_IDint-encoded "Btnx" string. This is used as the globally unique ID to discriminate BTM XIDs.- See Also:
-
-
Constructor Details
-
BitronixXid
Create a new XID using the specified GTRID and BQUAL.- Parameters:
globalTransactionId- the GTRID.branchQualifier- the BQUAL.
-
BitronixXid
-
-
Method Details
-
getFormatId
public int getFormatId()Get Bitronix XID format ID. Defined byFORMAT_ID.- Specified by:
getFormatIdin interfaceXid- Returns:
- the Bitronix XID format ID.
-
getBranchQualifier
public byte[] getBranchQualifier()Get the BQUAL of the XID.- Specified by:
getBranchQualifierin interfaceXid- Returns:
- the XID branch qualifier.
-
getBranchQualifierUid
-
getGlobalTransactionId
public byte[] getGlobalTransactionId()Get the GTRID of the XID.- Specified by:
getGlobalTransactionIdin interfaceXid- Returns:
- the XID global transaction ID.
-
getGlobalTransactionIdUid
-
toString
Get a human-readable string representation of the XID. -
equals
Compare two XIDs for equality. -
hashCode
public int hashCode()Get an integer hash for the XID.
-