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

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

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

XidFactoryImpl介绍

[英]Factory for transaction ids. The Xid is constructed of three parts:

  1. 8 byte count (LSB first)
  2. 4 byte system id
  3. 2 byte entropy
  4. 4 or 16 byte IP address of host
    [中]事务ID的工厂。Xid由三部分组成:
    1.8字节计数(LSB优先)
    1.4字节系统id
    1.2字节熵
    1.主机的4或16字节IP地址

代码示例

代码示例来源:origin: org.jencks/jencks

public static XidFactory createXidFactory() {
  XidFactory xidFactory;
  xidFactory = new XidFactoryImpl();
  return xidFactory;
}

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

public boolean matchesGlobalId(byte[] globalTransactionId) {
  if (globalTransactionId.length != Xid.MAXGTRIDSIZE) {
    return false;
  }
  for (int i = 8; i < globalTransactionId.length; i++) {
    if (globalTransactionId[i] != baseId[i]) {
      return false;
    }
  }
  // for recovery, only match old transactions
  long id = extractLong(globalTransactionId, 0);
  return (id < start);
}

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

public Xid createXid() {
  byte[] globalId = (byte[]) baseId.clone();
  long id;
  synchronized (this) {
    id = count++;
  }
  insertLong(id, globalId, 0);
  return new XidImpl(globalId);
}

代码示例来源:origin: org.jencks/jencks

public void afterPropertiesSet() throws Exception {
  if (transactionLog == null) {
    transactionLog = GeronimoDefaults.createTransactionLog(xidFactory, transactionLogDir);
    createdTransactionLog = true;
  }
  if (xidFactory == null) {
    xidFactory = new XidFactoryImpl();
  }
}

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

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);
  insertLong(start, branchId, 4);
  return new XidImpl(globalId, branchId);
}

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

public boolean matchesBranchId(byte[] branchQualifier) {
  if (branchQualifier.length != Xid.MAXBQUALSIZE) {
    return false;
  }
  long id = extractLong(branchQualifier, 4);
  if (id >= start) {
    // newly created branch, not recoverable
    return false;
  }
  for (int i = 12; i < branchQualifier.length; i++) {
    if (branchQualifier[i] != baseId[i]) {
      return false;
    }
  }
  return true;
}

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

public TransactionManagerImpl(int defaultTransactionTimeoutSeconds, XidFactory xidFactory, TransactionLog transactionLog) throws XAException {
  if (defaultTransactionTimeoutSeconds <= 0) {
    throw new IllegalArgumentException("defaultTransactionTimeoutSeconds must be positive: attempted value: " + defaultTransactionTimeoutSeconds);
  }
  this.defaultTransactionTimeoutMilliseconds = defaultTransactionTimeoutSeconds * 1000;
  if (transactionLog == null) {
    this.transactionLog = new UnrecoverableLog();
  } else {
    this.transactionLog = transactionLog;
  }
  if (xidFactory != null) {
    this.xidFactory = xidFactory;
  } else {
    this.xidFactory = new XidFactoryImpl(DEFAULT_TM_ID);
  }
  recovery = new RecoveryImpl(this.transactionLog, this.xidFactory);
  recovery.recoverLog();
}

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

public TransactionManagerImpl(int defaultTransactionTimeoutSeconds, XidFactory xidFactory, TransactionLog transactionLog) throws XAException {
  if (defaultTransactionTimeoutSeconds <= 0) {
    throw new IllegalArgumentException("defaultTransactionTimeoutSeconds must be positive: attempted value: " + defaultTransactionTimeoutSeconds);
  }
  this.defaultTransactionTimeoutMilliseconds = defaultTransactionTimeoutSeconds * 1000;
  if (transactionLog == null) {
    this.transactionLog = new UnrecoverableLog();
  } else {
    this.transactionLog = transactionLog;
  }
  if (xidFactory != null) {
    this.xidFactory = xidFactory;
  } else {
    this.xidFactory = new XidFactoryImpl(DEFAULT_TM_ID);
  }
  recovery = new RecoveryImpl(this.transactionLog, this.xidFactory);
  recovery.recoverLog();
}

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

public TransactionManagerImpl(int defaultTransactionTimeoutSeconds, XidFactory xidFactory, TransactionLog transactionLog) throws XAException {
  if (defaultTransactionTimeoutSeconds <= 0) {
    throw new IllegalArgumentException("defaultTransactionTimeoutSeconds must be positive: attempted value: " + defaultTransactionTimeoutSeconds);
  }
  this.defaultTransactionTimeoutMilliseconds = defaultTransactionTimeoutSeconds * 1000;
  if (transactionLog == null) {
    this.transactionLog = new UnrecoverableLog();
  } else {
    this.transactionLog = transactionLog;
  }
  if (xidFactory != null) {
    this.xidFactory = xidFactory;
  } else {
    this.xidFactory = new XidFactoryImpl(DEFAULT_TM_ID);
  }
  recovery = new RecoveryImpl(this.transactionLog, this.xidFactory);
  recovery.recoverLog();
}

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

public TransactionManagerImpl(int defaultTransactionTimeoutSeconds, XidFactory xidFactory, TransactionLog transactionLog) throws XAException {
  if (defaultTransactionTimeoutSeconds <= 0) {
    throw new IllegalArgumentException("defaultTransactionTimeoutSeconds must be positive: attempted value: " + defaultTransactionTimeoutSeconds);
  }
  this.defaultTransactionTimeoutMilliseconds = defaultTransactionTimeoutSeconds * 1000;
  if (transactionLog == null) {
    this.transactionLog = new UnrecoverableLog();
  } else {
    this.transactionLog = transactionLog;
  }
  if (xidFactory != null) {
    this.xidFactory = xidFactory;
  } else {
    this.xidFactory = new XidFactoryImpl(DEFAULT_TM_ID);
  }
  recovery = new RecoveryImpl(this);
  recovery.recoverLog();
}

代码示例来源:origin: org.infinispan/infinispan-core

@Inject
public void init(GlobalConfiguration globalCfg) {
 final String bufferClassName = "org.objectweb.howl.log.BlockLogBuffer";
 final int bufferSizeKBytes = 1;
 final boolean checksumEnabled = true;
 final boolean adler32Checksum = true;
 final int flushSleepTimeMilliseconds = 50;
 final String logFileExt = "log";
 final String logFileName = "transaction";
 final int maxBlocksPerFile = -1;
 final int maxLogFiles = 2;
 final int minBuffers = 4;
 final int maxBuffers = 0;
 final int threadsWaitingForceThreshold = -1;
 final String logFileDir = System.getProperty("java.io.tmpdir");
 try {
   transactionLog = new HOWLLog(bufferClassName, bufferSizeKBytes, checksumEnabled, adler32Checksum,
      flushSleepTimeMilliseconds, logFileDir, logFileExt, logFileName, maxBlocksPerFile, maxBuffers,
      maxLogFiles, minBuffers, threadsWaitingForceThreshold, new XidFactoryImpl(), null);
   ((HOWLLog) transactionLog).doStart();
 } catch (Exception e) {
   throw new RuntimeException(e);
 }
}

代码示例来源:origin: org.apache.aries.tx-control/tx-control-service-xa

this.config = config;
this.localResourceSupport = getLocalResourceSupport();
xidFactory = new XidFactoryImpl();
log = getLog(ctx);

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core

SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoXAResourceWrapper());
xidFactory = new XidFactoryImpl(tmId == null ? DEFAULT_TM_ID: tmId);
txLog = new HOWLLog(bufferClassName == null ? "org.apache.howl.log.BlockLogBuffer" : bufferClassName,
    bufferSizeKb == 0 ? DEFAULT_BUFFER_SIZE : bufferSizeKb,

代码示例来源:origin: com.tomitribe.tribestream/tribestream-metrics-core

SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoTransactionManagerFactory.GeronimoXAResourceWrapper());
xidFactory = new XidFactoryImpl(tmId == null ? new byte[]{71, 84, 77, 73, 68} : tmId);
txLog = new HOWLLog(bufferClassName == null ? "org.objectweb.howl.log.BlockLogBuffer" : bufferClassName, bufferSizeKb == 0 ? 32 : bufferSizeKb,
    checksumEnabled, adler32Checksum, flushSleepTimeMilliseconds, logFileDir, logFileExt, logFileName, maxBlocksPerFile,

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

XidFactory xidFactory = new XidFactoryImpl(pid.getBytes());

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

XidFactory xidFactory = new XidFactoryImpl(pid.getBytes());

代码示例来源:origin: org.apache.openejb/openejb-core

SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoXAResourceWrapper());
xidFactory = new XidFactoryImpl(tmId == null ? DEFAULT_TM_ID : tmId);
txLog = new HOWLLog(bufferClassName == null ? "org.objectweb.howl.log.BlockLogBuffer" : bufferClassName,
  bufferSizeKb == 0 ? DEFAULT_BUFFER_SIZE : bufferSizeKb,

代码示例来源:origin: org.apache.tomee/openejb-core

SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoXAResourceWrapper());
xidFactory = new XidFactoryImpl(tmId == null ? DEFAULT_TM_ID : tmId);
txLog = new HOWLLog(bufferClassName == null ? "org.objectweb.howl.log.BlockLogBuffer" : bufferClassName,
    bufferSizeKb == 0 ? DEFAULT_BUFFER_SIZE : bufferSizeKb,

相关文章

微信公众号

最新文章

更多

XidFactoryImpl类方法