Codota Logo
JTAActionBean
Code IndexAdd Codota to your IDE (free)

How to use
JTAActionBean
in
com.arjuna.ats.internal.jta.tools.osb.mbean.jta

Best Java code snippets using com.arjuna.ats.internal.jta.tools.osb.mbean.jta.JTAActionBean (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: org.jboss.narayana.jts/narayana-jts-idlj

@Override
protected LogRecordWrapper createParticipant(AbstractRecord rec, ParticipantStatus listType) {
  if (rec instanceof ExtendedResourceRecord)
    return new XAResourceRecordBean(this, rec, listType);
  return super.createParticipant(rec, listType);
}
origin: org.jboss.narayana.jts/narayana-jts-idlj

  @Override
  public void register() {
    super.register();

    // for each ExtendedResourceRecord see if there is a corresponding XARecoveryResource entry in the local store
    for (LogRecordWrapper participant : getParticipants()) {
      if (participant instanceof XAResourceRecordBean) {
        // this is an ExtendedResourceRecord
        XAResourceRecordBean xarrb = (XAResourceRecordBean) participant;

        // see if there is a corresponding JTSXAResourceRecordWrapper for this participant
        XARecoveryResourceMBean jtsxaResourceRecordWrapper = findJTSXAResourceRecordWrapper(xarrb);

        if (jtsxaResourceRecordWrapper != null && jtsxaResourceRecordWrapper instanceof JTSXAResourceRecordWrapper)
          xarrb.setJtsXAResourceRecord((JTSXAResourceRecordWrapper) jtsxaResourceRecordWrapper);
      }
    }
  }
}
origin: jbosstm/narayana

private HeuristicTestData getHeuristic() throws Exception
{
  FailureXAResource failureXAResource = new FailureXAResource(FailureXAResource.FailLocation.commit); // generates a heuristic on commit
  TransactionImple tx = new TransactionImple(1000000000);
  XAResourceRecordBeanMBean resourceBean = getHeuristicMBean(osb, tx, failureXAResource);
  JTAActionBean txnMBean = getTransactionBean(osb, tx, true);
  Set<ObjectName> participants;
  String resourceBeanName;
  String txnBeanName;
  assertNotNull(txnMBean);
  assertNotNull(resourceBean);
  txnBeanName = String.format("jboss.jta:type=ObjectStore,itype=%s,uid=%s",
      txnMBean.type(), txnMBean.getId().replace(':', '_'));
  resourceBeanName = String.format("%s,puid=%s",
      txnBeanName, resourceBean.getId().replace(':', '_'));
  participants = JMXServer.getAgent().queryNames(resourceBeanName, null);
  assertEquals(1, participants.size());
  return new HeuristicTestData(tx, failureXAResource, txnMBean, resourceBean, participants.iterator().next(),
      txnBeanName, resourceBeanName);
}
origin: jbosstm/narayana

/**
 * Test removing a transaction with heuristic participants fails if the ignores heuristics property is false
 */
@Test
public void testTxnRemoveFails () throws Exception
{
  // generate a heuristic
  HeuristicTestData hd = getHeuristic();
  // ignore forget failures during MBean remove opertaions
  arjPropertyManager.getObjectStoreEnvironmentBean().setIgnoreMBeanHeuristics(false);
  // tell the heuristic resource to fail forget calls
  hd.setRefuseForget(true);
  // invoke the MBean remove operation on the transaction
  hd.txnMBean.remove();
  osb.probe();
  // verify that the txn is still instrumented
  assertEquals(1, hd.getTransactionObjectNames().size());
}
origin: jbosstm/narayana

  private XAResourceRecordBeanMBean getHeuristicMBean(ObjStoreBrowser osb, TransactionImple tx, FailureXAResource failureXAResource) throws Exception {
    generateHeuristic(tx, failureXAResource);

    osb.probe();
    // there should be one MBean corresponding to the Transaction
    JTAActionBean actionBean = getTransactionBean(osb, tx, true);

    assertNotNull(actionBean);

    // and the transaction should contain only one participant (namely the FailureXAResource that generated the heuristic):
    Collection<LogRecordWrapper> participants = actionBean.getParticipants();

    assertEquals(1, participants.size());
    assertNotNull(failureXAResource.getXid());

    LogRecordWrapper participant = participants.iterator().next();

    assertTrue(participant.isHeuristic());
    assertTrue(participant instanceof XAResourceRecordBeanMBean);

    return (XAResourceRecordBeanMBean) participant;
  }
}
origin: jbosstm/narayana

/**
 * Test removing a transaction with heuristic participants succeeds if the ignores heuristics property is true
 */
@Test
public void testTxnRemovePasses () throws Exception
{
  // generate a heuristic
  HeuristicTestData hd = getHeuristic();
  // ignore forget failures during MBean remove opertaions
  arjPropertyManager.getObjectStoreEnvironmentBean().setIgnoreMBeanHeuristics(true);
  // tell the heuristic resource to fail forget calls
  hd.setRefuseForget(true);
  // invoke the MBean remove operation on the transaction
  hd.txnMBean.remove();
  osb.probe();
  // verify that the txn is no longer instrumented
  assertEquals(0, hd.getTransactionObjectNames().size());
}
com.arjuna.ats.internal.jta.tools.osb.mbean.jtaJTAActionBean

Most used methods

  • createParticipant
  • getId
  • getParticipants
  • register
  • remove
  • type

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • setContentView (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • BoxLayout (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now