Package java.util.concurrent

Examples of java.util.concurrent.ThreadPoolExecutor.shutdown()


  static byte[] zero = "0".getBytes();
 
  @Override
  public void visit(State state, Properties props) throws Exception {
    ThreadPoolExecutor threadPool = Setup.getThreadPool(state);
    threadPool.shutdown();
    int lastSize = 0;
    while (!threadPool.isTerminated()) {
      int size = threadPool.getQueue().size() + threadPool.getActiveCount();
      log.info("Waiting for " + size + " nodes to complete");
      if (size != lastSize)
View Full Code Here


                boolean tasksCompleted = false;
                try {
                    // sample all resources with threadpool
                    final List<Future<AsynSamplerResultHolder>> retExec = exec.invokeAll(liste);
                    // call normal shutdown (wait ending all tasks)
                    exec.shutdown();
                    // put a timeout if tasks couldn't terminate
                    exec.awaitTermination(AWAIT_TERMINATION_TIMEOUT, TimeUnit.SECONDS);
                    CookieManager cookieManager = getCookieManager();
                    // add result to main sampleResult
                    for (Future<AsynSamplerResultHolder> future : retExec) {
View Full Code Here

            Assert.assertEquals(0, countDownLatch.getCount());
            Assert.assertTrue(futureFrameworkEvent.isDone());
        }
        finally
        {
            pool.shutdown();
        }
    }

    @Test
    public void testGetWithTimeout() throws Exception
View Full Code Here

            Assert.assertEquals(0, countDownLatch.getCount());
            Assert.assertTrue(futureFrameworkEvent.isDone());
        }
        finally
        {
            pool.shutdown();
        }
    }

    @Test
    public void testTimeout() throws Exception
View Full Code Here

            Assert.assertEquals(1, countDownLatch.getCount());
            Assert.assertFalse(futureFrameworkEvent.isDone());
        }
        finally
        {
            pool.shutdown();
        }
    }
}
View Full Code Here

        {
            sr.unregister();

            eventAdmin.stop();

            executor.shutdown();
            scheduledExecutor.shutdown();
        }
    }

    @Test
View Full Code Here

        {
            sr.unregister();

            eventAdmin.stop();

            executor.shutdown();
            scheduledExecutor.shutdown();
        }
    }

    @Test
View Full Code Here

        {
            sr.unregister();

            eventAdmin.stop();

            executor.shutdown();
            scheduledExecutor.shutdown();
        }
    }
}
View Full Code Here

            assertEquals(NUM_MESSAGES, count.get());
        }
        finally
        {
            logServiceImpl.stop();
            executor.shutdown();
        }
    }
}
View Full Code Here

            framework.waitForStop(0);
        }
        finally
        {
            pool.shutdown();
        }

        try
        {
            framework.waitForStop(-1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.