public class BitronixXid
extends java.lang.Object
implements javax.transaction.xa.Xid
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.
UidGenerator,
BitronixTransaction,
XAResourceManager,
XA Exposed, Part III: The Implementor's Notebook| Modifier and Type | Field and Description |
|---|---|
static int |
FORMAT_ID
int-encoded "Btnx" string.
|
| Constructor and Description |
|---|
BitronixXid(Uid globalTransactionId,
Uid branchQualifier)
Create a new XID using the specified GTRID and BQUAL.
|
BitronixXid(javax.transaction.xa.Xid xid) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compare two XIDs for equality.
|
byte[] |
getBranchQualifier()
Get the BQUAL of the XID.
|
Uid |
getBranchQualifierUid() |
int |
getFormatId()
Get Bitronix XID format ID.
|
byte[] |
getGlobalTransactionId()
Get the GTRID of the XID.
|
Uid |
getGlobalTransactionIdUid() |
int |
hashCode()
Get an integer hash for the XID.
|
java.lang.String |
toString()
Get a human-readable string representation of the XID.
|
public static final int FORMAT_ID
public BitronixXid(Uid globalTransactionId, Uid branchQualifier)
globalTransactionId - the GTRID.branchQualifier - the BQUAL.public BitronixXid(javax.transaction.xa.Xid xid)
public int getFormatId()
FORMAT_ID.getFormatId in interface javax.transaction.xa.Xidpublic byte[] getBranchQualifier()
getBranchQualifier in interface javax.transaction.xa.Xidpublic Uid getBranchQualifierUid()
public byte[] getGlobalTransactionId()
getGlobalTransactionId in interface javax.transaction.xa.Xidpublic Uid getGlobalTransactionIdUid()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the XID to compare to.public int hashCode()
hashCode in class java.lang.ObjectCopyright © 2006-2021 Bitronix Software. All Rights Reserved.