gpt4 book ai didi

com.arjuna.ats.internal.jta.transaction.arjunacore.jca.XATerminatorImple类的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 01:15:05 28 4
gpt4 key购买 nike

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

XATerminatorImple介绍

[英]The XATerminator implementation.
[中]XATerminator实现。

代码示例

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

private static void initXATerminator()
{
  if(txType == null) {
    setTxType( guessTxType() );
  }
  TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  
  if(txType == TxType.JTA)
  {
    // we are running in JTA mode
    xaTerminator = new XATerminatorImple();
  }
  else
  {
    // it's not JTA, so it must be JTAX. However, we are in the JTA module and
    // can't link against the JTS code so we need to do it the hard way...
    try
    {
      Class clazz = Class.forName("com.arjuna.ats.internal.jta.transaction.jts.jca.XATerminatorImple");
      xaTerminator = (XATerminator)clazz.newInstance();
    }
    catch(Exception e)
    {
      jtaLogger.i18NLogger.error_transaction_arjunacore_jca_SubordinationManager_terminatorfailure(e);
    }
  }
}

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

public Xid[] getXidsToRecoverForParentNode(boolean recoverInFlight, String parentNodeName, int recoveryFlags) throws XAException {
  final Set<Xid> xidsToRecover = new HashSet<Xid>();
  if (recoverInFlight) {
    final TransactionImporter transactionImporter = SubordinationManager.getTransactionImporter();
    if (transactionImporter instanceof TransactionImporterImple) {
      final Set<Xid> inFlightXids = ((TransactionImporterImple) transactionImporter).getInflightXids(parentNodeName);
      if (inFlightXids != null) {
        xidsToRecover.addAll(inFlightXids);
      }
    }
  }
  final javax.resource.spi.XATerminator xaTerminator = SubordinationManager.getXATerminator();
  if (xaTerminator instanceof XATerminatorImple) {
    final Xid[] inDoubtTransactions = ((XATerminatorImple) xaTerminator).doRecover(null, parentNodeName);
    if (inDoubtTransactions != null) {
      xidsToRecover.addAll(Arrays.asList(inDoubtTransactions));
    }
  } else {
    final Xid[] inDoubtTransactions = xaTerminator.recover(recoveryFlags);
    if (inDoubtTransactions != null) {
      xidsToRecover.addAll(Arrays.asList(inDoubtTransactions));
    }
  }
  return xidsToRecover.toArray(NO_XIDS);
}

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

@Test
public void test () throws Exception
  XATerminatorImple term = new XATerminatorImple();
  XidImple xid = new XidImple(new Uid());
  SubordinationManager.getTransactionImporter().importTransaction(xid);
  assertTrue(term.beforeCompletion(xid));
  assertEquals(term.prepare(xid), XAResource.XA_RDONLY);
  SubordinationManager.getTransactionImporter().importTransaction(xid);
  term.commit(xid, true);
  SubordinationManager.getTransactionImporter().importTransaction(xid);
  term.rollback(xid);
  SubordinationManager.getTransactionImporter().importTransaction(xid);
  term.recover(XAResource.TMSTARTRSCAN);
    term.recover(XAResource.TMSTARTRSCAN);
  term.recover(XAResource.TMENDRSCAN);
  term.forget(xid);

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

TransactionImporter imp = SubordinationManager.getTransactionImporter();
XATerminatorImple xa = new XATerminatorImple();
subordinateTransaction.enlistResource(xar2);
xa.prepare(xid);
try {
  xa.commit(xid, false);
  fail("Did not expect to pass");
} catch (XAException xae) {
RecoveryManager.manager().addModule(xarm);
Xid[] xids = xa.recover(XAResource.TMSTARTRSCAN);
assertTrue(Arrays.binarySearch(xids, xid, new Comparator<Xid>() {
  @Override
xa.rollback(xid);
assertTrue(xar2.rollbackCalled());
xa.recover(XAResource.TMENDRSCAN);

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

@Test
public void testRecovery() throws Exception {
  Implementations.initialise();
  XATerminatorImple xa = new XATerminatorImple();
  Xid[] recover = xa.recover(XAResource.TMSTARTRSCAN);
  int initialLength = recover == null ? 0 : recover.length;
  xa.recover(XAResource.TMENDRSCAN);
  assertTrue(xa.beforeCompletion(xid));
  assertEquals(xa.prepare(xid), XAResource.XA_OK);
    xa.commit(xid, false);
    fail();
  } catch (XAException e) {
  Xid[] recover2 = xa.recover(XAResource.TMSTARTRSCAN);
  assertTrue(recover2.length == initialLength+1);
  try {
    xa.commit(xid, false);
    fail();
  } catch (XAException e) {
    assertTrue("Wrong errorcode" + e.errorCode, e.errorCode == XAException.XAER_RMFAIL);
  xa.recover(XAResource.TMENDRSCAN);
  RecoveryManager.manager().addModule(module);
  try {
    Xid[] recover3 = xa.recover(XAResource.TMSTARTRSCAN);
    assertTrue(recover3.length == recover2.length);

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

XATerminatorImple xaTerminator = new XATerminatorImple();
XidImple xid = new XidImple(new Uid());
XAResourceImple toCommit = new XAResourceImple(XAResource.XA_OK, XAResource.XA_OK);
  SubordinateTransaction subordinateTransaction = SubordinationManager.getTransactionImporter().importTransaction(xid);
  tm.resume(subordinateTransaction);
  subordinateTransaction.enlistResource(new XAResourceImple(XAResource.XA_RDONLY, XAResource.XA_OK));
  SubordinateTransaction subordinateTransaction = SubordinationManager.getTransactionImporter().getImportedTransaction(xid);
  tm.resume(subordinateTransaction);
  subordinateTransaction.doPrepare();
xaTerminator.doRecover(null, null);
  SubordinateTransaction subordinateTransaction = SubordinationManager.getTransactionImporter().getImportedTransaction(xid);
  tm.resume(subordinateTransaction);
  subordinateTransaction.doCommit();

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

@Test
public void testInvalid () throws Exception
  XATerminatorImple term = new XATerminatorImple();
  XidImple xid = new XidImple(new Uid());
    SubordinationManager.getTransactionImporter().importTransaction(null);
    SubordinationManager.getTransactionImporter().recoverTransaction(null);
    SubordinationManager.getTransactionImporter().getImportedTransaction(null);

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

@Test
public void testUnknownTransaction () throws Exception
  XATerminatorImple term = new XATerminatorImple();
  XidImple xid = new XidImple(new Uid());
    term.beforeCompletion(xid);
    term.prepare(xid);
    term.commit(xid, false);
    term.rollback(xid);
    term.forget(xid);

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

return doRecover(null, null);

代码示例来源:origin: org.jboss.teiid/teiid-txn-jbossts

commit(xid, false);
  return XAResource.XA_RDONLY;
case TwoPhaseOutcome.PREPARE_NOTOK:
  rollback(xid);
  throw new XAException(XAException.XA_RBROLLBACK);
case TwoPhaseOutcome.PREPARE_OK:

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

XATerminatorImple term = new XATerminatorImple();
XidImple xid = new XidImple(new Uid());
SubordinationManager.getTransactionImporter().importTransaction(xid);
  term.commit(xid, false);
  term.commit(xid, false);
term.prepare(xid);
  term.commit(xid, false);
  term.commit(xid, false);
  term.rollback(xid);
term.prepare(xid);
  term.rollback(xid);
term.prepare(xid);
  term.rollback(xid);
  term.prepare(xid);
  term.prepare(xid);
  term.prepare(xid);

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

return doRecover(null, null);

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

public Xid[] getXidsToRecoverForParentNode(boolean recoverInFlight, String parentNodeName, int recoveryFlags) throws XAException {
  final Set<Xid> xidsToRecover = new HashSet<Xid>();
  if (recoverInFlight) {
    final TransactionImporter transactionImporter = SubordinationManager.getTransactionImporter();
    if (transactionImporter instanceof TransactionImporterImple) {
      final Set<Xid> inFlightXids = ((TransactionImporterImple) transactionImporter).getInflightXids(parentNodeName);
      if (inFlightXids != null) {
        xidsToRecover.addAll(inFlightXids);
      }
    }
  }
  final javax.resource.spi.XATerminator xaTerminator = SubordinationManager.getXATerminator();
  if (xaTerminator instanceof XATerminatorImple) {
    final Xid[] inDoubtTransactions = ((XATerminatorImple) xaTerminator).doRecover(null, parentNodeName);
    if (inDoubtTransactions != null) {
      xidsToRecover.addAll(Arrays.asList(inDoubtTransactions));
    }
  } else {
    final Xid[] inDoubtTransactions = xaTerminator.recover(recoveryFlags);
    if (inDoubtTransactions != null) {
      xidsToRecover.addAll(Arrays.asList(inDoubtTransactions));
    }
  }
  return xidsToRecover.toArray(NO_XIDS);
}

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

private static void initXATerminator()
{
  if(txType == null) {
    setTxType( guessTxType() );
  }
  TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  
  if(txType == TxType.JTA)
  {
    // we are running in JTA mode
    xaTerminator = new XATerminatorImple();
  }
  else
  {
    // it's not JTA, so it must be JTAX. However, we are in the JTA module and
    // can't link against the JTS code so we need to do it the hard way...
    try
    {
      Class clazz = Class.forName("com.arjuna.ats.internal.jta.transaction.jts.jca.XATerminatorImple");
      xaTerminator = (XATerminator)clazz.newInstance();
    }
    catch(Exception e)
    {
      jtaLogger.i18NLogger.error_transaction_arjunacore_jca_SubordinationManager_terminatorfailure(e);
    }
  }
}

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

return doRecover(null, null);

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

public Xid[] getXidsToRecoverForParentNode(boolean recoverInFlight, String parentNodeName, int recoveryFlags) throws XAException {
  final Set<Xid> xidsToRecover = new HashSet<Xid>();
  if (recoverInFlight) {
    final TransactionImporter transactionImporter = SubordinationManager.getTransactionImporter();
    if (transactionImporter instanceof TransactionImporterImple) {
      final Set<Xid> inFlightXids = ((TransactionImporterImple) transactionImporter).getInflightXids(parentNodeName);
      if (inFlightXids != null) {
        xidsToRecover.addAll(inFlightXids);
      }
    }
  }
  final javax.resource.spi.XATerminator xaTerminator = SubordinationManager.getXATerminator();
  if (xaTerminator instanceof XATerminatorImple) {
    final Xid[] inDoubtTransactions = ((XATerminatorImple) xaTerminator).doRecover(null, parentNodeName);
    if (inDoubtTransactions != null) {
      xidsToRecover.addAll(Arrays.asList(inDoubtTransactions));
    }
  } else {
    final Xid[] inDoubtTransactions = xaTerminator.recover(recoveryFlags);
    if (inDoubtTransactions != null) {
      xidsToRecover.addAll(Arrays.asList(inDoubtTransactions));
    }
  }
  return xidsToRecover.toArray(NO_XIDS);
}

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

private static void initXATerminator()
{
  if(txType == null) {
    setTxType( guessTxType() );
  }
  TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  
  if(txType == TxType.JTA)
  {
    // we are running in JTA mode
    xaTerminator = new XATerminatorImple();
  }
  else
  {
    // it's not JTA, so it must be JTAX. However, we are in the JTA module and
    // can't link against the JTS code so we need to do it the hard way...
    try
    {
      Class clazz = Class.forName("com.arjuna.ats.internal.jta.transaction.jts.jca.XATerminatorImple");
      xaTerminator = (XATerminator)clazz.newInstance();
    }
    catch(Exception e)
    {
      jtaLogger.i18NLogger.error_transaction_arjunacore_jca_SubordinationManager_terminatorfailure(e);
    }
  }
}

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

return doRecover(null, null);

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

public Xid[] getXidsToRecoverForParentNode(boolean recoverInFlight, String parentNodeName, int recoveryFlags) throws XAException {
  final Set<Xid> xidsToRecover = new HashSet<Xid>();
  if (recoverInFlight) {
    final TransactionImporter transactionImporter = SubordinationManager.getTransactionImporter();
    if (transactionImporter instanceof TransactionImporterImple) {
      final Set<Xid> inFlightXids = ((TransactionImporterImple) transactionImporter).getInflightXids(parentNodeName);
      if (inFlightXids != null) {
        xidsToRecover.addAll(inFlightXids);
      }
    }
  }
  final javax.resource.spi.XATerminator xaTerminator = SubordinationManager.getXATerminator();
  if (xaTerminator instanceof XATerminatorImple) {
    final Xid[] inDoubtTransactions = ((XATerminatorImple) xaTerminator).doRecover(null, parentNodeName);
    if (inDoubtTransactions != null) {
      xidsToRecover.addAll(Arrays.asList(inDoubtTransactions));
    }
  } else {
    final Xid[] inDoubtTransactions = xaTerminator.recover(recoveryFlags);
    if (inDoubtTransactions != null) {
      xidsToRecover.addAll(Arrays.asList(inDoubtTransactions));
    }
  }
  return xidsToRecover.toArray(NO_XIDS);
}

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

private static void initXATerminator()
{
  if(txType == null) {
    setTxType( guessTxType() );
  }
  TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
  
  if(txType == TxType.JTA)
  {
    // we are running in JTA mode
    xaTerminator = new XATerminatorImple();
  }
  else
  {
    // it's not JTA, so it must be JTAX. However, we are in the JTA module and
    // can't link against the JTS code so we need to do it the hard way...
    try
    {
      Class clazz = Class.forName("com.arjuna.ats.internal.jta.transaction.jts.jca.XATerminatorImple");
      xaTerminator = (XATerminator)clazz.newInstance();
    }
    catch(Exception e)
    {
      jtaLogger.i18NLogger.error_transaction_arjunacore_jca_SubordinationManager_terminatorfailure(e);
    }
  }
}

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