public Xid recover(int formatId, byte[] globalTransactionid, byte[] branchQualifier) { return new XidImpl(formatId, globalTransactionid, branchQualifier); }
/** * 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 static String id(Object key) { if (key instanceof XidImpl) { byte[] globalId = ((XidImpl) key).getGlobalTransactionId(); StringBuilder buffer = new StringBuilder(); for (byte aGlobalId : globalId) { buffer.append(Integer.toHexString(aGlobalId)); } return buffer.toString().replaceAll("0*$", ""); } return key.toString(); }
public Xid recover(int formatId, byte[] globalTransactionid, byte[] branchQualifier) { return new XidImpl(formatId, globalTransactionid, branchQualifier); }
public XidImpl(int formatId, byte[] globalId, byte[] branchId) { this.formatId = formatId; this.globalId = globalId; this.branchId = branchId; check(); }
public Xid recover(int formatId, byte[] globalTransactionid, byte[] branchQualifier) { return new XidImpl(formatId, globalTransactionid, branchQualifier); }
/** * 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(); }
public Xid recover(int formatId, byte[] globalTransactionid, byte[] branchQualifier) { return new XidImpl(formatId, globalTransactionid, branchQualifier); }
public Xid recover(int formatId, byte[] globalTransactionid, byte[] branchQualifier) { return new XidImpl(formatId, globalTransactionid, branchQualifier); }
public Xid createBranch(Xid globalId, int branch) { byte[] branchId = (byte[]) baseId.clone(); branchId[0] = (byte) branch; branchId[1] = (byte) (branch >>> 8); branchId[2] = (byte) (branch >>> 16); branchId[3] = (byte) (branch >>> 24); return new XidImpl(globalId, branchId); }
public Xid createBranch(Xid globalId, int branch) { byte[] branchId = (byte[]) baseId.clone(); branchId[0] = (byte) branch; branchId[1] = (byte) (branch >>> 8); branchId[2] = (byte) (branch >>> 16); branchId[3] = (byte) (branch >>> 24); return new XidImpl(globalId, branchId); }
public Xid createBranch(Xid globalId, int branch) { byte[] branchId = (byte[]) baseId.clone(); branchId[0] = (byte) branch; branchId[1] = (byte) (branch >>> 8); branchId[2] = (byte) (branch >>> 16); branchId[3] = (byte) (branch >>> 24); return new XidImpl(globalId, branchId); }
public Xid createXid() { byte[] globalId = (byte[]) baseId.clone(); long id; synchronized (this) { id = count++; } globalId[0] = (byte) id; globalId[1] = (byte) (id >>> 8); globalId[2] = (byte) (id >>> 16); globalId[3] = (byte) (id >>> 24); globalId[4] = (byte) (id >>> 32); globalId[5] = (byte) (id >>> 40); globalId[6] = (byte) (id >>> 48); globalId[7] = (byte) (id >>> 56); return new XidImpl(globalId); }
public Xid createXid() { byte[] globalId = (byte[]) baseId.clone(); long id; synchronized (this) { id = count++; } globalId[0] = (byte) id; globalId[1] = (byte) (id >>> 8); globalId[2] = (byte) (id >>> 16); globalId[3] = (byte) (id >>> 24); globalId[4] = (byte) (id >>> 32); globalId[5] = (byte) (id >>> 40); globalId[6] = (byte) (id >>> 48); globalId[7] = (byte) (id >>> 56); return new XidImpl(globalId); }
public Xid createXid() { byte[] globalId = (byte[]) baseId.clone(); long id; synchronized (this) { id = count++; } globalId[0] = (byte) id; globalId[1] = (byte) (id >>> 8); globalId[2] = (byte) (id >>> 16); globalId[3] = (byte) (id >>> 24); globalId[4] = (byte) (id >>> 32); globalId[5] = (byte) (id >>> 40); globalId[6] = (byte) (id >>> 48); globalId[7] = (byte) (id >>> 56); return new XidImpl(globalId); }