gpt4 book ai didi

org.bytesoft.transaction.supports.resource.XAResourceDescriptor.getIdentifier()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 15:47:05 25 4
gpt4 key购买 nike

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

XAResourceDescriptor.getIdentifier介绍

暂无

代码示例

代码示例来源:origin: liuyangming/ByteTCC

if (CommonResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x1;
  identifierByteArray = descriptor.getIdentifier().getBytes();
} else if (RemoteResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x2;
  identifierByteArray = descriptor.getIdentifier().getBytes();
} else if (LocalXAResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x3;
  identifierByteArray = descriptor.getIdentifier().getBytes();

代码示例来源:origin: liuyangming/ByteTCC

String identifier = descriptor.getIdentifier();
applicationEnlisted = true;

代码示例来源:origin: liuyangming/ByteTCC

public void onEnlistResource(Xid xid, XAResource xares) {
  String resourceKey = null;
  if (XAResourceDescriptor.class.isInstance(xares)) {
    XAResourceDescriptor descriptor = (XAResourceDescriptor) xares;
    resourceKey = descriptor.getIdentifier();
  } else if (XAResourceArchive.class.isInstance(xares)) {
    XAResourceArchive resourceArchive = (XAResourceArchive) xares;
    XAResourceDescriptor descriptor = resourceArchive.getDescriptor();
    resourceKey = descriptor == null ? null : descriptor.getIdentifier();
  }
  CompensableLogger compensableLogger = this.beanFactory.getCompensableLogger();
  if (this.transactionContext.isCompensating()) {
    // this.archive.setCompensableXid(xid); // preset the compensable-xid.
    this.archive.setCompensableResourceKey(resourceKey);
    compensableLogger.updateCompensable(this.archive);
  } else {
    for (int i = 0; i < this.currentArchiveList.size(); i++) {
      CompensableArchive compensableArchive = this.currentArchiveList.get(i);
      compensableArchive.setTransactionXid(xid);
      compensableArchive.setTransactionResourceKey(resourceKey);
      XidFactory transactionXidFactory = this.beanFactory.getTransactionXidFactory();
      TransactionXid globalXid = transactionXidFactory.createGlobalXid(xid.getGlobalTransactionId());
      TransactionXid branchXid = transactionXidFactory.createBranchXid(globalXid);
      compensableArchive.setCompensableXid(branchXid); // preset the compensable-xid.
      compensableLogger.createCompensable(compensableArchive);
    }
  }
}

代码示例来源:origin: liuyangming/ByteTCC

XAResourceDescriptor descriptor = archive.getDescriptor();
String descriptorType = descriptor.getClass().getName();
String descriptorKey = descriptor.getIdentifier();

代码示例来源:origin: liuyangming/ByteTCC

current.getDescriptor().getIdentifier());
} catch (XAException ex) {
  switch (ex.errorCode) {
        current.getDescriptor().getIdentifier(), ex);
    logger.warn("{}| error occurred while confirming remote branch: {}, transaction may has been completd!",
        ByteUtils.byteArrayToString(branchXid.getGlobalTransactionId()),
        current.getDescriptor().getIdentifier(), ex);
    break;
  case XAException.XAER_RMFAIL:
        current.getDescriptor().getIdentifier(), ex);
    break;
  case XAException.XAER_NOTA:
        current.getDescriptor().getIdentifier(), ex);
    break;
  case XAException.XA_RBCOMMFAIL:
        current.getDescriptor().getIdentifier(), ex);
  logger.warn("{}| error occurred while confirming remote branch: {}!",
      ByteUtils.byteArrayToString(branchXid.getGlobalTransactionId()),
      current.getDescriptor().getIdentifier(), rex);
} finally {
  if (current.isCompleted()) {

代码示例来源:origin: liuyangming/ByteTCC

} else if (this.transactionContext.isStatefully()) {
  XAResourceDescriptor xaResource = resourceArchive.getDescriptor();
  RemoteNode oldNode = CommonUtils.getRemoteNode(xaResource.getIdentifier());
  RemoteNode newNode = CommonUtils.getRemoteNode(descriptor.getIdentifier());
  boolean nodeEquals = oldNode == null && newNode == null ? false

代码示例来源:origin: liuyangming/ByteTCC

String descriptorKey = descriptor.getIdentifier();

代码示例来源:origin: liuyangming/ByteTCC

RemoteAddr expectAddr = CommonUtils.getRemoteAddr(participant.getIdentifier());
if (remoteAddr.equals(expectAddr)) {
  if (invoker.isAvailable()) {

代码示例来源:origin: liuyangming/ByteTCC

current.getDescriptor().getIdentifier());
} catch (XAException xaex) {
  switch (xaex.errorCode) {

代码示例来源:origin: liuyangming/ByteJTA

private XAResourceArchive getEnlistedResourceArchive(XAResourceDescriptor descriptor) {
  if (RemoteResourceDescriptor.class.isInstance(descriptor)) {
    RemoteSvc remoteSvc = CommonUtils.getRemoteSvc(descriptor.getIdentifier()); // dubbo: old identifier
    return this.remoteParticipantMap.get(remoteSvc);
  } else {
    return this.nativeParticipantMap.get(descriptor.getIdentifier());
  }
}

代码示例来源:origin: liuyangming/ByteJTA

private void putEnlistedResourceArchive(XAResourceArchive archive) {
  XAResourceDescriptor descriptor = archive.getDescriptor();
  String identifier = descriptor.getIdentifier();
  if (RemoteResourceDescriptor.class.isInstance(descriptor)) {
    RemoteSvc remoteSvc = CommonUtils.getRemoteSvc(identifier);
    this.remoteParticipantMap.put(remoteSvc, archive);
  } else {
    this.nativeParticipantMap.put(identifier, archive);
  }
}

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

if (CommonResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x1;
  identifierByteArray = descriptor.getIdentifier().getBytes();
} else if (RemoteResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x2;
  identifierByteArray = descriptor.getIdentifier().getBytes();
} else if (LocalXAResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x3;
  identifierByteArray = descriptor.getIdentifier().getBytes();

代码示例来源:origin: liuyangming/ByteJTA

if (CommonResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x1;
  identifierByteArray = descriptor.getIdentifier().getBytes();
} else if (RemoteResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x2;
  identifierByteArray = descriptor.getIdentifier().getBytes();
} else if (LocalXAResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x3;
  identifierByteArray = descriptor.getIdentifier().getBytes();

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

if (CommonResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x1;
  identifierByteArray = descriptor.getIdentifier().getBytes();
} else if (RemoteResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x2;
  identifierByteArray = descriptor.getIdentifier().getBytes();
} else if (LocalXAResourceDescriptor.class.isInstance(descriptor)) {
  typeByte = (byte) 0x3;
  identifierByteArray = descriptor.getIdentifier().getBytes();

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

public void onEnlistResource(Xid xid, XAResource xares) {
  String resourceKey = null;
  if (XAResourceDescriptor.class.isInstance(xares)) {
    XAResourceDescriptor descriptor = (XAResourceDescriptor) xares;
    resourceKey = descriptor.getIdentifier();
  } else if (XAResourceArchive.class.isInstance(xares)) {
    XAResourceArchive resourceArchive = (XAResourceArchive) xares;
    XAResourceDescriptor descriptor = resourceArchive.getDescriptor();
    resourceKey = descriptor == null ? null : descriptor.getIdentifier();
  }
  CompensableLogger compensableLogger = this.beanFactory.getCompensableLogger();
  if (this.transactionContext.isCompensating()) {
    this.archive.setCompensableXid(xid);
    this.archive.setCompensableResourceKey(resourceKey);
    compensableLogger.updateCompensable(this.archive);
  } else {
    for (int i = 0; i < this.currentArchiveList.size(); i++) {
      CompensableArchive compensableArchive = this.currentArchiveList.get(i);
      compensableArchive.setTransactionXid(xid);
      compensableArchive.setTransactionResourceKey(resourceKey);
      compensableLogger.createCompensable(compensableArchive);
    }
  }
}

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

public boolean delistResource(XAResourceDescriptor descriptor, int flag) throws IllegalStateException, SystemException {
  String identifier = descriptor.getIdentifier();
  RemoteCoordinator transactionCoordinator = this.beanFactory.getTransactionCoordinator();
  String self = transactionCoordinator.getIdentifier();
  String parent = String.valueOf(this.transactionContext.getPropagatedBy());
  if (StringUtils.equalsIgnoreCase(identifier, self) || CommonUtils.instanceEquals(parent, identifier)) {
    return true;
  }
  XAResourceArchive archive = this.participantMap.get(identifier);
  if (archive == null) {
    throw new SystemException();
  }
  try {
    return this.delistResource(archive, flag);
  } finally {
    this.resourceListenerList.onDelistResource(archive.getXid(), descriptor);
  }
}

代码示例来源:origin: org.bytesoft/bytejta-supports-dubbo

XAResourceArchive archive = participantList.get(j);
XAResourceDescriptor descriptor = archive.getDescriptor();
String identifier = descriptor.getIdentifier();
String[] values = identifier == null ? new String[0] : identifier.split("\\s*:\\s*");
String targetAddr = values.length == 3 ? values[0] : null;

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

XAResourceArchive element = participants.get(i);
XAResourceDescriptor descriptor = element.getDescriptor();
String identifier = StringUtils.trimToEmpty(descriptor.getIdentifier());

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

XAResourceArchive participantArchive = participantList.get(i);
XAResourceDescriptor descriptor = participantArchive.getDescriptor();
String identifier = descriptor.getIdentifier();

代码示例来源:origin: liuyangming/ByteJTA

String identifier = participant.getIdentifier();
RemoteAddr remoteAddr = CommonUtils.getRemoteAddr(identifier);
if (invokerAddr.equals(remoteAddr) == false) {

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com