- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {ScheduledThreadPoolExecutor s =
new ScheduledThreadPoolExecutor(corePoolSize)
ThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
String str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
- Smart code suggestions by Codota
}
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); }
private HeuristicTestData tryRemove(boolean failForget, boolean ignoreMBeanHeuristics, HeuristicTestData hd) throws MBeanException, MalformedObjectNameException { ObjectStoreEnvironmentBean osEnv = arjPropertyManager.getObjectStoreEnvironmentBean(); osEnv.setIgnoreMBeanHeuristics(ignoreMBeanHeuristics); hd.failureXAResource.setRefuseForget(hd.failureXAResource.getXid(), failForget); // remove the bean via JMX hd.resourceBean.remove(); // assert that forget was called on the resource assertEquals(1, hd.failureXAResource.getForgetCount(hd.failureXAResource.getXid())); osb.probe(); return hd; }