Package java.util.concurrent

Examples of java.util.concurrent.ExecutorService.awaitTermination()


                }
            });

            latch.await();
            executors.shutdown();
            executors.awaitTermination(300, TimeUnit.SECONDS);

            assertEquals("Client did not see all server transition into rebalancing state",
                         rebalancingStarted.get(),
                         true);
            assertEquals("Not enough time to begin proxy writing", proxyWritesDone.get(), true);
View Full Code Here


            badKeyReaderService.shutdown();
            badKeyReaderService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
            logger.info("Bad key reader service has shutdown.");

            consistencyFixWorkers.shutdown();
            consistencyFixWorkers.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
            logger.info("All workers have shutdown.");

            // Poison the bad key writer to have it exit.
            badKeyQOut.put(new BadKeyStatus());
            badKeyWriterService.shutdown();
View Full Code Here

                }
            });

            latch.await();
            executors.shutdown();
            executors.awaitTermination(300, TimeUnit.SECONDS);

            // check No Exception
            if(exceptions.size() > 0) {
                for(Exception e: exceptions) {
                    e.printStackTrace();
View Full Code Here

                }
            });

            latch.await();
            executors.shutdown();
            executors.awaitTermination(300, TimeUnit.SECONDS);

            assertEquals("Client did not see all server transition into rebalancing state",
                         rebalancingStarted.get(),
                         true);
            assertEquals("Not enough time to begin proxy writing", proxyWritesDone.get(), true);
View Full Code Here

                    }
                }
            });

            executors.shutdown();
            executors.awaitTermination(300, TimeUnit.SECONDS);

            // check No Exception
            if(exceptions.size() > 0) {
                for(Exception e: exceptions) {
                    e.printStackTrace();
View Full Code Here

      }
    });
    threadPool.shutdown();
    while (threadPool.isTerminated() == false)
    {
      threadPool.awaitTermination(5, TimeUnit.MINUTES);
    }

    assertFalse(error[0]);

  }
View Full Code Here

    }

    threadPool.shutdown();
    while (threadPool.isTerminated() == false)
    {
      threadPool.awaitTermination(5, TimeUnit.MINUTES);
    }
    if (errors.isEmpty() == false)
    {
      Log log = LogFactory.getLog(GoldTestBase.class);
      for (Throwable throwable : errors)
View Full Code Here

        for (int threadIndex = 0; threadIndex < MAX_THREADS; threadIndex++) {
            executorService.execute(new TraitRulesThread(threadIndex, MAX_REPETITIONS, kbase.newStatefulKnowledgeSession()));
        }

        executorService.shutdown();
        executorService.awaitTermination(MAX_WAIT_SECONDS, TimeUnit.SECONDS);
        final List<Runnable> queuedTasks = executorService.shutdownNow();

        assertEquals(0, queuedTasks.size());
        assertEquals(true, executorService.isTerminated());
    }
View Full Code Here

    for (Future<?> passResult : passResults) {
      passResult.get();
    }

    executorService.shutdown();
    executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);

    if (COMPUTE_TRANSITION_STATS && SHOW_TRANSITION_STATS_PER_FILE) {
      computeTransitionStatistics();
    }
View Full Code Here

        updateChecksum(checksum, fileChecksum);
      }
    }

    executorService.shutdown();
    executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);

        System.out.format("%d. Total parse time for %d files (%d KB, %d tokens%s): %.0fms%n",
              currentPass + 1,
                          inputCount,
                          inputSize / 1024,
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.