gpt4 book ai didi

com.arjuna.ats.internal.jta.resources.arjunacore.XAOnePhaseResource.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 01:33:05 26 4
gpt4 key购买 nike

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

XAOnePhaseResource.<init>介绍

[英]Default constructor for deserialising resource.
[中]反序列化资源的默认构造函数。

代码示例

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

/**
 * Attempt to create an AbstractRecord wrapping the given XAResource. Return null if this fails, or
 * is diallowed by the current configuration of multiple last resource behaviour.
 *
 * @param xaRes
 * @param params
 * @param xid
 * @return
 */
private AbstractRecord createRecord(XAResource xaRes, Object[] params, Xid xid)
{
  final AbstractRecord record;
  if ((xaRes instanceof LastResourceCommitOptimisation)
      || ((LAST_RESOURCE_OPTIMISATION_INTERFACE != null) && LAST_RESOURCE_OPTIMISATION_INTERFACE
      .isInstance(xaRes)))
  {
    record = new LastResourceRecord(new XAOnePhaseResource(xaRes, xid, params));
  }
  else
  {
    record = new XAResourceRecord(this, xaRes, xid, params);
  }
  return record;
}

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

/**
 * Attempt to create an AbstractRecord wrapping the given XAResource. Return null if this fails, or
 * is diallowed by the current configuration of multiple last resource behaviour.
 *
 * @param xaRes
 * @param params
 * @param xid
 * @return
 */
private AbstractRecord createRecord(XAResource xaRes, Object[] params, Xid xid)
{
  final AbstractRecord record;
  if ((xaRes instanceof LastResourceCommitOptimisation)
      || ((LAST_RESOURCE_OPTIMISATION_INTERFACE != null) && LAST_RESOURCE_OPTIMISATION_INTERFACE
      .isInstance(xaRes)))
  {
    record = new LastResourceRecord(new XAOnePhaseResource(xaRes, xid, params));
  }
  else
  {
    record = new XAResourceRecord(this, xaRes, xid, params);
  }
  return record;
}

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

return new LastResourceRecord(new XAOnePhaseResource(xaRes, xid, params));

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

return new LastResourceRecord(new XAOnePhaseResource(xaRes, xid, params));

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

return new LastResourceRecord(new XAOnePhaseResource(xaRes, xid, params));

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

return new LastResourceRecord(new XAOnePhaseResource(xaRes, xid, params));

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

return new LastResourceRecord(new XAOnePhaseResource(xaRes, xid, params));

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

@Test
public void testInvalid ()
{
  XAOnePhaseResource xares = new XAOnePhaseResource();
  
  assertEquals(xares.commit(), TwoPhaseOutcome.ONE_PHASE_ERROR);
  assertEquals(xares.rollback(), TwoPhaseOutcome.FINISH_ERROR);
}

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

@Test
public void testCommit ()
{
  SampleOnePhaseResource res = new SampleOnePhaseResource();
  XidImple xid = new XidImple(new Uid());
  XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);
  
  assertEquals(xares.commit(), TwoPhaseOutcome.FINISH_OK);
  assertTrue(res.onePhaseCalled());
}

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

@Test
  public void testPackUnpack () throws Exception
  {
    DummyXA res = new DummyXA(false);
    XidImple xid = new XidImple(new Uid());
    XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);
    OutputObjectState os = new OutputObjectState();
    
    xares.pack(os);
    
    InputObjectState is = new InputObjectState(os);
    
    xares.unpack(is);
  }
}

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

@Test
public void testCommitHeuristic ()
{
  SampleOnePhaseResource res = new SampleOnePhaseResource(SampleOnePhaseResource.ErrorType.heurcom);
  XidImple xid = new XidImple(new Uid());
  XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);
  assertEquals(xares.commit(), TwoPhaseOutcome.FINISH_OK);
  assertTrue(res.forgetCalled());
}

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

@Test
public void testCommitHeuristic ()
{
  SampleOnePhaseResource res = new SampleOnePhaseResource(ErrorType.heurcom);
  XidImple xid = new XidImple(new Uid());
  XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);
  
  assertEquals(xares.commit(), TwoPhaseOutcome.FINISH_OK);
  assertTrue(res.forgetCalled());
}

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

@Test
public void testPackUnpackError () throws Exception
{
  SampleOnePhaseResource res = new SampleOnePhaseResource();
  XidImple xid = new XidImple(new Uid());
  XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);
  OutputObjectState os = new OutputObjectState();
  
  try
  {
    xares.pack(os);
    
    fail();
  }
  catch (final IOException ex)
  {           
  }
}

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

@Test
  public void testRollbackHeuristic ()
  {
    SampleOnePhaseResource res = new SampleOnePhaseResource(SampleOnePhaseResource.ErrorType.heurrb);
    XidImple xid = new XidImple(new Uid());
    XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);

    assertEquals(xares.commit(), TwoPhaseOutcome.ONE_PHASE_ERROR);
    assertTrue(res.forgetCalled());
  }
}

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

@Test
public void testRollbackHeuristic ()
{
  SampleOnePhaseResource res = new SampleOnePhaseResource(ErrorType.heurrb);
  XidImple xid = new XidImple(new Uid());
  XAOnePhaseResource xares = new XAOnePhaseResource(res, xid, null);
  
  assertEquals(xares.commit(), TwoPhaseOutcome.ONE_PHASE_ERROR);
  assertTrue(res.forgetCalled());
}

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

@Test
public void testFailure () throws Exception
{
  SampleOnePhaseResource res = new SampleOnePhaseResource(ErrorType.heurmix);
  XAOnePhaseResource xares = new XAOnePhaseResource(res, new XidImple(new Uid()), null);
  
  assertEquals(xares.commit(), TwoPhaseOutcome.HEURISTIC_HAZARD);
  
  res = new SampleOnePhaseResource(ErrorType.rmerr);
  xares = new XAOnePhaseResource(res, new XidImple(new Uid()), null);
  
  assertEquals(xares.commit(), TwoPhaseOutcome.ONE_PHASE_ERROR);
  
  res = new SampleOnePhaseResource(ErrorType.nota);
  xares = new XAOnePhaseResource(res, new XidImple(new Uid()), null);
  
  assertEquals(xares.commit(), TwoPhaseOutcome.HEURISTIC_HAZARD);
  
  res = new SampleOnePhaseResource(ErrorType.inval);
  xares = new XAOnePhaseResource(res, new XidImple(new Uid()), null);
  
  assertEquals(xares.commit(), TwoPhaseOutcome.HEURISTIC_HAZARD);
  
  res = new SampleOnePhaseResource(ErrorType.proto);
  xares = new XAOnePhaseResource(res, new XidImple(new Uid()), null);
  
  assertEquals(xares.commit(), TwoPhaseOutcome.ONE_PHASE_ERROR);
}

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

@Test
public void test () throws Exception
{
  DummyRecoverableXAConnection rc = new DummyRecoverableXAConnection();
  Object[] obj = new Object[1];
  SampleOnePhaseResource res = new SampleOnePhaseResource();
  
  obj[XAResourceRecord.XACONNECTION] = rc;
  
  XAOnePhaseResource xares = new XAOnePhaseResource(res, new XidImple(new Uid()), obj);
  
  OutputObjectState os = new OutputObjectState();
  
  xares.pack(os);
  
  InputObjectState is = new InputObjectState(os);
  
  xares.unpack(is);
}

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