1 23 24 package org.apache.slide.transaction; 25 26 import javax.transaction.xa.Xid ; 27 28 33 public final class SlideXid implements Xid { 34 35 36 38 39 42 public SlideXid(byte[] globalTransactionId, int formatId, 43 byte[] branchQualifier) { 44 this.branchQualifier = branchQualifier; 45 this.formatId = formatId; 46 this.globalTransactionId = globalTransactionId; 47 } 48 49 50 52 53 56 private byte[] branchQualifier; 57 58 59 62 private int formatId; 63 64 65 68 private byte[] globalTransactionId; 69 70 71 73 74 76 77 82 public int getFormatId() { 83 return formatId; 84 } 85 86 87 93 public byte[] getGlobalTransactionId() { 94 return globalTransactionId; 95 } 96 97 98 104 public byte[] getBranchQualifier() { 105 return branchQualifier; 106 } 107 108 109 111 112 115 public String toString() { 116 return new String (getGlobalTransactionId()) + "-" 117 + new String (getBranchQualifier()); 118 } 119 120 121 123 124 127 Xid newBranch(int branchNumber) { 128 return new SlideXid(getGlobalTransactionId(), getFormatId(), 129 Integer.toString(branchNumber).getBytes()); 130 } 131 132 133 } 134 | Popular Tags |