org.apache.geronimo.transaction.manager.XidImpl类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中org.apache.geronimo.transaction.manager.XidImpl类的一些代码示例,展示了XidImpl类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XidImpl类的具体详情如下:
包路径:org.apache.geronimo.transaction.manager.XidImpl
类名称:XidImpl

XidImpl介绍

[英]Unique id for a transaction.
[中]事务的唯一id。

代码示例

代码示例来源:origin: org.apache.geronimo.components/geronimo-transaction

  1. public Xid recover(int formatId, byte[] globalTransactionid, byte[] branchQualifier) {
  2. return new XidImpl(formatId, globalTransactionid, branchQualifier);
  3. }

代码示例来源:origin: org.apache.geronimo.components/geronimo-transaction

  1. public int hashCode() {
  2. if (hash == 0) {
  3. hash = hash(hash(0, globalId), branchId);
  4. }
  5. return hash;
  6. }

代码示例来源:origin: org.apache.geronimo.components/geronimo-transaction

  1. /**
  2. * Constructor taking a global id (for the main transaction)
  3. * @param globalId the global transaction id
  4. */
  5. public XidImpl(byte[] globalId) {
  6. this.formatId = FORMAT_ID;
  7. this.globalId = globalId;
  8. //this.hash = hash(0, globalId);
  9. branchId = new byte[Xid.MAXBQUALSIZE];
  10. check();
  11. }

代码示例来源:origin: org.apache.geronimo.components/geronimo-transaction

  1. private void check() {
  2. if (globalId.length > Xid.MAXGTRIDSIZE) {
  3. throw new IllegalStateException("Global id is too long: " + toString());
  4. }
  5. if (branchId.length > Xid.MAXBQUALSIZE) {
  6. throw new IllegalStateException("Branch id is too long: " + toString());
  7. }
  8. }

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-management-jtajca

  1. public static String id(Object key) {
  2. if (key instanceof XidImpl) {
  3. byte[] globalId = ((XidImpl) key).getGlobalTransactionId();
  4. StringBuilder buffer = new StringBuilder();
  5. for (byte aGlobalId : globalId) {
  6. buffer.append(Integer.toHexString(aGlobalId));
  7. }
  8. return buffer.toString().replaceAll("0*$", "");
  9. }
  10. return key.toString();
  11. }

代码示例来源:origin: org.apache.servicemix.transaction/org.apache.servicemix.transaction

  1. public Xid recover(int formatId, byte[] globalTransactionid, byte[] branchQualifier) {
  2. return new XidImpl(formatId, globalTransactionid, branchQualifier);
  3. }

代码示例来源:origin: apache/felix

  1. public int hashCode() {
  2. if (hash == 0) {
  3. hash = hash(hash(0, globalId), branchId);
  4. }
  5. return hash;
  6. }

代码示例来源:origin: org.apache.geronimo.components/geronimo-transaction

  1. public XidImpl(int formatId, byte[] globalId, byte[] branchId) {
  2. this.formatId = formatId;
  3. this.globalId = globalId;
  4. this.branchId = branchId;
  5. check();
  6. }

代码示例来源:origin: org.apache.geronimo/com.springsource.org.apache.geronimo.transaction

  1. public Xid recover(int formatId, byte[] globalTransactionid, byte[] branchQualifier) {
  2. return new XidImpl(formatId, globalTransactionid, branchQualifier);
  3. }

代码示例来源:origin: org.apache.servicemix.transaction/org.apache.servicemix.transaction

  1. public int hashCode() {
  2. if (hash == 0) {
  3. hash = hash(hash(0, globalId), branchId);
  4. }
  5. return hash;
  6. }

代码示例来源:origin: org.apache.geronimo.components/geronimo-transaction

  1. /**
  2. * Constructor for a branch id
  3. * @param global the xid of the global transaction this branch belongs to
  4. * @param branch the branch id
  5. */
  6. public XidImpl(Xid global, byte[] branch) {
  7. this.formatId = FORMAT_ID;
  8. //int hash;
  9. if (global instanceof XidImpl) {
  10. globalId = ((XidImpl) global).globalId;
  11. //hash = ((XidImpl) global).hash;
  12. } else {
  13. globalId = global.getGlobalTransactionId();
  14. //hash = hash(0, globalId);
  15. }
  16. branchId = branch;
  17. //this.hash = hash(hash, branchId);
  18. check();
  19. }

代码示例来源:origin: apache/felix

  1. public Xid recover(int formatId, byte[] globalTransactionid, byte[] branchQualifier) {
  2. return new XidImpl(formatId, globalTransactionid, branchQualifier);
  3. }

代码示例来源:origin: org.apache.geronimo/com.springsource.org.apache.geronimo.transaction

  1. public int hashCode() {
  2. if (hash == 0) {
  3. hash = hash(hash(0, globalId), branchId);
  4. }
  5. return hash;
  6. }

代码示例来源:origin: org.apache.aries.transaction/org.apache.aries.transaction.manager

  1. public Xid recover(int formatId, byte[] globalTransactionid, byte[] branchQualifier) {
  2. return new XidImpl(formatId, globalTransactionid, branchQualifier);
  3. }

代码示例来源:origin: org.apache.servicemix.transaction/org.apache.servicemix.transaction

  1. public Xid createBranch(Xid globalId, int branch) {
  2. byte[] branchId = (byte[]) baseId.clone();
  3. branchId[0] = (byte) branch;
  4. branchId[1] = (byte) (branch >>> 8);
  5. branchId[2] = (byte) (branch >>> 16);
  6. branchId[3] = (byte) (branch >>> 24);
  7. return new XidImpl(globalId, branchId);
  8. }

代码示例来源:origin: org.apache.geronimo/com.springsource.org.apache.geronimo.transaction

  1. public Xid createBranch(Xid globalId, int branch) {
  2. byte[] branchId = (byte[]) baseId.clone();
  3. branchId[0] = (byte) branch;
  4. branchId[1] = (byte) (branch >>> 8);
  5. branchId[2] = (byte) (branch >>> 16);
  6. branchId[3] = (byte) (branch >>> 24);
  7. return new XidImpl(globalId, branchId);
  8. }

代码示例来源:origin: apache/felix

  1. public Xid createBranch(Xid globalId, int branch) {
  2. byte[] branchId = (byte[]) baseId.clone();
  3. branchId[0] = (byte) branch;
  4. branchId[1] = (byte) (branch >>> 8);
  5. branchId[2] = (byte) (branch >>> 16);
  6. branchId[3] = (byte) (branch >>> 24);
  7. return new XidImpl(globalId, branchId);
  8. }

代码示例来源:origin: apache/felix

  1. public Xid createXid() {
  2. byte[] globalId = (byte[]) baseId.clone();
  3. long id;
  4. synchronized (this) {
  5. id = count++;
  6. }
  7. globalId[0] = (byte) id;
  8. globalId[1] = (byte) (id >>> 8);
  9. globalId[2] = (byte) (id >>> 16);
  10. globalId[3] = (byte) (id >>> 24);
  11. globalId[4] = (byte) (id >>> 32);
  12. globalId[5] = (byte) (id >>> 40);
  13. globalId[6] = (byte) (id >>> 48);
  14. globalId[7] = (byte) (id >>> 56);
  15. return new XidImpl(globalId);
  16. }

代码示例来源:origin: org.apache.geronimo/com.springsource.org.apache.geronimo.transaction

  1. public Xid createXid() {
  2. byte[] globalId = (byte[]) baseId.clone();
  3. long id;
  4. synchronized (this) {
  5. id = count++;
  6. }
  7. globalId[0] = (byte) id;
  8. globalId[1] = (byte) (id >>> 8);
  9. globalId[2] = (byte) (id >>> 16);
  10. globalId[3] = (byte) (id >>> 24);
  11. globalId[4] = (byte) (id >>> 32);
  12. globalId[5] = (byte) (id >>> 40);
  13. globalId[6] = (byte) (id >>> 48);
  14. globalId[7] = (byte) (id >>> 56);
  15. return new XidImpl(globalId);
  16. }

代码示例来源:origin: org.apache.servicemix.transaction/org.apache.servicemix.transaction

  1. public Xid createXid() {
  2. byte[] globalId = (byte[]) baseId.clone();
  3. long id;
  4. synchronized (this) {
  5. id = count++;
  6. }
  7. globalId[0] = (byte) id;
  8. globalId[1] = (byte) (id >>> 8);
  9. globalId[2] = (byte) (id >>> 16);
  10. globalId[3] = (byte) (id >>> 24);
  11. globalId[4] = (byte) (id >>> 32);
  12. globalId[5] = (byte) (id >>> 40);
  13. globalId[6] = (byte) (id >>> 48);
  14. globalId[7] = (byte) (id >>> 56);
  15. return new XidImpl(globalId);
  16. }

相关文章