gpt4 book ai didi

com.arjuna.ats.jta.xa.XidImple.unpackFrom()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 21:57:05 27 4
gpt4 key购买 nike

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

XidImple.unpackFrom介绍

暂无

代码示例

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

public static final Xid unpack(InputObjectState os) throws IOException {
  if (os.unpackBoolean()) {
    XidImple x = new XidImple();
    x.unpackFrom(os);
    return x;
  } else {
    try {
      byte[] b = os.unpackBytes();
      ByteArrayInputStream s = new ByteArrayInputStream(b);
      ObjectInputStream o = new ObjectInputStream(s);
      Xid x = (Xid) o.readObject();
      return x;
    } catch (Exception e) {
      jtaLogger.logger.debug("Can't unpack input object state " + os, e);
      IOException ioException = new IOException(e.toString());
      ioException.initCause(e);
      throw ioException;
    }
  }
}

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

public static final Xid unpack(InputObjectState os) throws IOException {
  if (os.unpackBoolean()) {
    XidImple x = new XidImple();
    x.unpackFrom(os);
    return x;
  } else {
    try {
      byte[] b = os.unpackBytes();
      ByteArrayInputStream s = new ByteArrayInputStream(b);
      ObjectInputStream o = new ObjectInputStream(s);
      Xid x = (Xid) o.readObject();
      return x;
    } catch (Exception e) {
      IOException ioException = new IOException(e.toString());
      ioException.initCause(e);
      throw ioException;
    }
  }
}

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

public static final Xid unpack(InputObjectState os) throws IOException {
  if (os.unpackBoolean()) {
    XidImple x = new XidImple();
    x.unpackFrom(os);
    return x;
  } else {
    try {
      byte[] b = os.unpackBytes();
      ByteArrayInputStream s = new ByteArrayInputStream(b);
      ObjectInputStream o = new ObjectInputStream(s);
      Xid x = (Xid) o.readObject();
      return x;
    } catch (Exception e) {
      jtaLogger.logger.debug("Can't unpack input object state " + os, e);
      IOException ioException = new IOException(e.toString());
      ioException.initCause(e);
      throw ioException;
    }
  }
}

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

public static final Xid unpack(InputObjectState os) throws IOException {
  if (os.unpackBoolean()) {
    XidImple x = new XidImple();
    x.unpackFrom(os);
    return x;
  } else {
    try {
      byte[] b = os.unpackBytes();
      ByteArrayInputStream s = new ByteArrayInputStream(b);
      ObjectInputStream o = new ObjectInputStream(s);
      Xid x = (Xid) o.readObject();
      return x;
    } catch (Exception e) {
      jtaLogger.logger.debug("Can't unpack input object state " + os, e);
      IOException ioException = new IOException(e.toString());
      ioException.initCause(e);
      throw ioException;
    }
  }
}

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

public static final Xid unpack(InputObjectState os) throws IOException {
  if (os.unpackBoolean()) {
    XidImple x = new XidImple();
    x.unpackFrom(os);
    return x;
  } else {
    try {
      byte[] b = os.unpackBytes();
      ByteArrayInputStream s = new ByteArrayInputStream(b);
      ObjectInputStream o = new ObjectInputStream(s);
      Xid x = (Xid) o.readObject();
      return x;
    } catch (Exception e) {
      IOException ioException = new IOException(e.toString());
      ioException.initCause(e);
      throw ioException;
    }
  }
}

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

public static final Xid unpack(InputObjectState os) throws IOException {
  if (os.unpackBoolean()) {
    XidImple x = new XidImple();
    x.unpackFrom(os);
    return x;
  } else {
    try {
      byte[] b = os.unpackBytes();
      ByteArrayInputStream s = new ByteArrayInputStream(b);
      ObjectInputStream o = new ObjectInputStream(s);
      Xid x = (Xid) o.readObject();
      return x;
    } catch (Exception e) {
      jtaLogger.logger.debug("Can't unpack input object state " + os, e);
      IOException ioException = new IOException(e.toString());
      ioException.initCause(e);
      throw ioException;
    }
  }
}

代码示例来源: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: jboss.jbossts/jbossjts

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

代码示例来源: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: org.jboss.narayana.jts/narayana-jts-idlj

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

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

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

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

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

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

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

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

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

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

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

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

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

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

public SubordinateAtomicAction(Uid actId, boolean peekXidOnly) throws ObjectStoreException, IOException {
  super(actId);
  if (peekXidOnly) {
    InputObjectState os = StoreManager.getParticipantStore().read_committed(objectUid, type());
    unpackHeader(os, new Header());
    boolean haveXid = os.unpackBoolean();
    if (haveXid) {
      _theXid = new XidImple();
      ((XidImple) _theXid).unpackFrom(os);
      _parentNodeName = os.unpackString();
    }
  } else {
    _activated = activate();
  }
}

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

/**
 * Recovery SAA. If the record is removed and peekXidOnly is true then the Xid will be null.
 *
 * @param actId
 * @param peekXidOnly
 * @throws ObjectStoreException
 * @throws IOException
 */
public SubordinateAtomicAction(Uid actId, boolean peekXidOnly) throws ObjectStoreException, IOException {
  super(actId);
  if (peekXidOnly) {
    InputObjectState os = StoreManager.getParticipantStore().read_committed(objectUid, type());
    if (os == null) {
      // This will have been logged by the ObjectStore during ShadowingStore::read_state as an INFO if there was no content
      return;
    }
    unpackHeader(os, new Header());
    boolean haveXid = os.unpackBoolean();
    if (haveXid) {
      _theXid = new XidImple();
      ((XidImple) _theXid).unpackFrom(os);
      _parentNodeName = os.unpackString();
    }
  } else {
    _activated = activate();
  }
}

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

/**
 * Recovery SAA. If the record is removed and peekXidOnly is true then the Xid will be null.
 *
 * @param actId
 * @param peekXidOnly
 * @throws ObjectStoreException
 * @throws IOException
 */
public SubordinateAtomicAction(Uid actId, boolean peekXidOnly) throws ObjectStoreException, IOException {
  super(actId);
  if (peekXidOnly) {
    InputObjectState os = StoreManager.getParticipantStore().read_committed(objectUid, type());
    if (os == null) {
      // This will have been logged by the ObjectStore during ShadowingStore::read_state as an INFO if there was no content
      return;
    }
    unpackHeader(os, new Header());
    boolean haveXid = os.unpackBoolean();
    if (haveXid) {
      _theXid = new XidImple();
      ((XidImple) _theXid).unpackFrom(os);
      _parentNodeName = os.unpackString();
    }
  } else {
    _activated = activate();
  }
}

代码示例来源: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));
  }
}

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