BitronixXid (Bitronix Transaction Manager :: Core 2.1.4 API)
Date: 2013-09-15

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## bitronix.tm
Class BitronixXid

    java.lang.Object
      bitronix.tm.BitronixXid

All Implemented Interfaces:
  Xid

    public class BitronixXid

extends Object
implements 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:
  `UidGenerator`, `BitronixTransaction`, `XAResourceManager`, XA Exposed, Part III: The Implementor's Notebook

Field Summary
`static int` | `FORMAT_ID` int-encoded "Btnx" string.

Fields inherited from interface javax.transaction.xa.Xid
`MAXBQUALSIZE, MAXGTRIDSIZE`

Constructor Summary
`BitronixXid(Uid globalTransactionId, Uid branchQualifier)` Create a new XID using the specified GTRID and BQUAL.
`BitronixXid(Xid xid)`

Method Summary
`boolean` | `equals(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.
`String` | `toString()` Get a human-readable string representation of the XID.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### FORMAT_ID

    public static final int FORMAT_ID

  int-encoded "Btnx" string. This is used as the globally unique ID to discriminate BTM XIDs.

  See Also:
    Constant Field Values

Constructor Detail

### BitronixXid

    public BitronixXid(Uid globalTransactionId,
                       Uid branchQualifier)

  Create a new XID using the specified GTRID and BQUAL.

  Parameters:
    `globalTransactionId` - the GTRID.
    `branchQualifier` - the BQUAL.

### BitronixXid

    public BitronixXid(Xid xid)

Method Detail

### getFormatId

    public int getFormatId()

  Get Bitronix XID format ID. Defined by `FORMAT_ID`.

  Specified by:
    `getFormatId` in interface `Xid`
  Returns:
    the Bitronix XID format ID.

### getBranchQualifier

    public byte[] getBranchQualifier()

  Get the BQUAL of the XID.

  Specified by:
    `getBranchQualifier` in interface `Xid`
  Returns:
    the XID branch qualifier.

### getBranchQualifierUid

    public Uid getBranchQualifierUid()

### getGlobalTransactionId

    public byte[] getGlobalTransactionId()

  Get the GTRID of the XID.

  Specified by:
    `getGlobalTransactionId` in interface `Xid`
  Returns:
    the XID global transaction ID.

### getGlobalTransactionIdUid

    public Uid getGlobalTransactionIdUid()

### toString

    public String toString()

  Get a human-readable string representation of the XID.

  Overrides:
    `toString` in class `Object`
  Returns:
    a human-readable string representation.

### equals

    public boolean equals(Object obj)

  Compare two XIDs for equality.

  Overrides:
    `equals` in class `Object`
  Parameters:
    `obj` - the XID to compare to.
  Returns:
    true if both XIDs have the same format ID and contain exactly the same GTRID and BQUAL.

### hashCode

    public int hashCode()

  Get an integer hash for the XID.

  Overrides:
    `hashCode` in class `Object`
  Returns:
    a constant hash value.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2013 Bitronix Software. All Rights Reserved.