/** * Constructor taking a global id (for the main transaction) * @param globalId the global transaction id */ public XidImpl(byte[] globalId) { this.formatId = FORMAT_ID; this.globalId = globalId; //this.hash = hash(0, globalId); branchId = new byte[Xid.MAXBQUALSIZE]; check(); }
public XidImpl(int formatId, byte[] globalId, byte[] branchId) { this.formatId = formatId; this.globalId = globalId; this.branchId = branchId; check(); }
/** * Constructor for a branch id * @param global the xid of the global transaction this branch belongs to * @param branch the branch id */ public XidImpl(Xid global, byte[] branch) { this.formatId = FORMAT_ID; //int hash; if (global instanceof XidImpl) { globalId = ((XidImpl) global).globalId; //hash = ((XidImpl) global).hash; } else { globalId = global.getGlobalTransactionId(); //hash = hash(0, globalId); } branchId = branch; //this.hash = hash(hash, branchId); check(); }