gpt4 book ai didi

com.arjuna.ats.jta.xa.XidImple类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 23:47:05 34 4
gpt4 key购买 nike

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

XidImple介绍

[英]Implementation of javax.transaction.xa.Xid.
[中]javax的实现。交易xa。希德。

代码示例

代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta

public Transaction getTransaction(Xid xid) throws XAException {
  // first see if the xid is a root coordinator
  return TransactionImple.getTransaction(new XidImple(xid).getTransactionUid());
}

代码示例来源:origin: org.jboss.jbossts/jbossjta

/**
 * Is the specified object equal to this one?
 * 
 * @param obj
 *            The object to test.
 * @return true if they are equal, false otherwise.
 */
public boolean equals(final Object obj) {
  if (obj instanceof Xid) {
    return equals((Xid) obj);
  }
  return false;
}

代码示例来源:origin: org.jboss.narayana.jta/jta

@Override
public int getFormatId() {
  return xidImple.getFormatId();
}
@Override

代码示例来源:origin: org.jboss.jbossts/jbossjta

public XidImple(Xid xid) {
  _theXid = null;
  copy(xid);
  
  hashCode = getHash(_theXid) ;
}

代码示例来源:origin: jbosstm/narayana

XidImple xid1 = new XidImple();
AtomicAction A = new AtomicAction();
assertEquals(xid1.getFormatId(), -1);
xid1 = new XidImple(A);
XidImple xid2 = new XidImple(new Uid());
assertFalse(xid1.isSameTransaction(xid2));
XidImple xid3 = new XidImple(xid1);
assertTrue(xid3.isSameTransaction(xid1));
assertTrue(xid1.getFormatId() != -1);
assertTrue(xid1.getBranchQualifier().length > 0);
assertTrue(xid1.getGlobalTransactionId().length > 0);
assertEquals(xid1.getTransactionUid(), A.get_uid());
assertTrue(XATxConverter.getNodeName(xid1.getXID()).equals(TxControl.getXANodeName()));
assertTrue(xid1.getXID() != null);
assertTrue(xid1.equals(xid3));
assertFalse(xid1.equals(x));

代码示例来源:origin: jbosstm/narayana

@Test
  public void testPackUnpack () throws Exception
  {
    XidImple xid1 = new XidImple(new Uid());
    OutputObjectState os = new OutputObjectState();
    
    assertTrue(xid1.packInto(os));
    
    InputObjectState is = new InputObjectState(os);
    
    XidImple xid2 = new XidImple();
    
    assertTrue(xid2.unpackFrom(is));
    
    assertTrue(xid1.equals(xid2));
    
    os = new OutputObjectState();
    
    XidImple.pack(os, xid1);
    
    is = new InputObjectState(os);
    
    xid2 = (XidImple) XidImple.unpack(is);
    
    assertTrue(xid1.equals(xid2));
  }
}

代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj

protected HeaderState unpackHeader(InputObjectState os) throws IOException {
  wasInvoked = true;
  if (os.unpackBoolean())
    new XidImple().unpackFrom(os);
  return super.unpackHeader(os);
}

代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta

public static final void pack(OutputObjectState os, Xid xid)
    throws IOException {
  if (xid instanceof XidImple) {
    XidImple x = (XidImple) xid;
    os.packBoolean(true);
    if (!x.packInto(os))
      throw new IOException(jtaLogger.i18NLogger.get_xid_packerror());
  } else {
    os.packBoolean(false);
    ByteArrayOutputStream s = new ByteArrayOutputStream();
    ObjectOutputStream o = new ObjectOutputStream(s);
    o.writeObject(xid);
    o.close();
    os.packBytes(s.toByteArray());
  }
}

代码示例来源:origin: org.jboss.jbossts/jbossjta

throws IOException
XidImple.pack(os, xid);
if (recoverableXAConnection != null)

代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj

tsLogger.logger.trace("unpack: " + commitMarkableJndiName);
xid = XidImple.unpack(os);
if (tsLogger.logger.isTraceEnabled()) {
  tsLogger.logger.trace("unpack: " + xid);

代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj

public boolean restoreState(InputObjectState os) {
  InputObjectState copy = new InputObjectState(os);
  try {
    heuristic = copy.unpackInt();
    committed = copy.unpackBoolean();
    xidImple = new XidImple(XidImple.unpack(copy));
    return super.restoreState(os);
  } catch (IOException e) {
    return false;
  }
}

代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta

private XidImple convertXid(Xid xid)
{
  if (xid != null && xid.getFormatId() == XATxConverter.FORMAT_ID) {
    XidImple toImport = new XidImple(xid);
    XATxConverter.setSubordinateNodeName(toImport.getXID(), TxControl.getXANodeName());
    return new SubordinateXidImple(toImport);
  } else {
    return new XidImple(xid);
  }
}

代码示例来源:origin: org.jboss.narayana.jts/narayana-jts-idlj

public ServerTransaction (Uid actUid, Xid xid)
{
  super(actUid, null);
  subordinate = true;
  
  // convert to internal format (makes saving/restoring easier)
  
  _theXid = new XidImple(xid);
}

代码示例来源:origin: jboss.jbossts/jbossjts

/**
 * Generate the hash code for the xid.
 * @param xid The xid.
 * @return The hash code.
 */
private static int getHash(final XID xid)
{
  if (xid == null)
  {
    return 0 ;
  }
  final int hash = generateHash(xid.formatID, xid.data, 0, xid.gtrid_length) ;
  return generateHash(hash, xid.data, xid.gtrid_length, xid.bqual_length) ;
}

代码示例来源:origin: jboss.jbossts/jbossjts

public boolean restore_state (InputObjectState os, int t)
{
  try
  {
    boolean haveXid = os.unpackBoolean();
    
    if (haveXid)
    {
      _theXid = new XidImple();
      
      ((XidImple) _theXid).unpackFrom(os);
    }
  }
  catch (IOException ex)
  {
    return false;
  }
  
  return super.restore_state(os, t);
}

代码示例来源:origin: jboss.jbossts/jbossjts

public XidImple (Xid xid)
{
  _theXid = null;
  copy(xid);
  hashCode = getHash(_theXid) ;
}

代码示例来源:origin: org.jboss.narayana.jta/jta

public static final void pack(OutputObjectState os, Xid xid)
    throws IOException {
  if (xid instanceof XidImple) {
    XidImple x = (XidImple) xid;
    os.packBoolean(true);
    if (!x.packInto(os))
      throw new IOException(jtaLogger.i18NLogger.get_xid_packerror(xid));
  } else {
    os.packBoolean(false);
    ByteArrayOutputStream s = new ByteArrayOutputStream();
    ObjectOutputStream o = new ObjectOutputStream(s);
    o.writeObject(xid);
    o.close();
    os.packBytes(s.toByteArray());
  }
}

代码示例来源:origin: org.jboss.narayana.jta/jta

throws IOException
XidImple.pack(os, xid);
if (recoverableXAConnection != null)

代码示例来源:origin: org.jboss.narayana.jta/jta

tsLogger.logger.trace("unpack: " + commitMarkableJndiName);
xid = XidImple.unpack(os);
if (tsLogger.logger.isTraceEnabled()) {
  tsLogger.logger.trace("unpack: " + xid);

代码示例来源:origin: org.jboss.jbossts.jta/narayana-jta

public boolean contains (Xid xid)
{
  XidImple xidImple = new XidImple(xid);
  return _whenFirstSeen.containsKey(xidImple);
}

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