Example #1
0
 public XATransactionId(final String key) {
   final String[] tmps = PatternUtils.split(pattern, key);
   if (tmps.length != 4) {
     throw new IllegalArgumentException("Illegal transaction key" + key);
   }
   assert tmps[0].equals("XID");
   this.formatId = Integer.parseInt(tmps[1]);
   this.globalTransactionId = HexSupport.toBytesFromHex(tmps[2]);
   this.branchQualifier = HexSupport.toBytesFromHex(tmps[3]);
 }
Example #2
0
 @Override
 public synchronized String getTransactionKey() {
   if (this.transactionKey == null) {
     this.transactionKey =
         "XID:"
             + this.formatId
             + ":"
             + HexSupport.toHexFromBytes(this.globalTransactionId)
             + ":"
             + HexSupport.toHexFromBytes(this.branchQualifier);
   }
   return this.transactionKey;
 }