Examples of shutdownNow()


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

        }

        mockJSON.reset();
        mockXML.reset();

        executor.shutdownNow();
    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
View Full Code Here

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

         });
      }

      executor.shutdown();
      executor.awaitTermination(20, TimeUnit.SECONDS);
      executor.shutdownNow();

      assertEquals(NUMBER_OF_THREADS * REQUESTS_PER_THREAD, successCounter.get());

   }
}
View Full Code Here

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

        }

        // Wait for all inserts to happen and stop connections and progress tracking
        pendingInserts.await();
        openConnectionsWatcherExecutor.shutdownNow();
        progressReportExecutor.shutdownNow();

        if (negativeOpenConnectionCountSpotted.get()) {
            fail("Negative value spotted for open connection count");
        }
    }
View Full Code Here

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

      }

      executor.shutdown();
      executor.awaitTermination(20, TimeUnit.SECONDS);
      executor.shutdownNow();

      assertEquals(NUMBER_OF_THREADS * REQUESTS_PER_THREAD, successCounter.get());

   }
}
View Full Code Here

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

        Thread.sleep(1000L);

        assertFalse("The main() method did not measurement the load values", TestLS.measurementTime == 0);
        // There's no point in testing further, since we're really testing the
        // parse() method.  We'll do that in testParse().
        es.shutdownNow();

        // TODO: Need to figure out how to test this
//        try {
//            LoadSensorManager.main(new String[0]);
//            fail("The main() method did not fail on no args");
View Full Code Here

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

                throw new AssertionError(e);
            } catch (Exception e) {
                throw new IOException(e);
            }
        } finally {
            executor.shutdownNow();
            while (true) {
                Pair next = queue.poll();
                if (next == null) {
                    break;
                }
View Full Code Here

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

            ExecutorService executor = Executors.newFixedThreadPool(threads, DAEMON_THREAD_FACTORY);
            try {
                BatchFileCacheRepository repo = new ConcurrentBatchFileCacheRepository(unit, executor);
                return repo.resolve(libraryPaths);
            } finally {
                executor.shutdownNow();
            }
        } else {
            return new NullBatchFileCacheRepository().resolve(libraryPaths);
        }
    }
View Full Code Here

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

            executor.shutdown();
            if (executor.awaitTermination(30, TimeUnit.SECONDS) == false) {
                throw new TimeoutException();
            }
        } finally {
            executor.shutdownNow();
        }
        for (Future<Path> future : futures) {
            future.get();
        }
    }
View Full Code Here

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

                e.printStackTrace();
            } finally {
                AccessController.doPrivileged(new PrivilegedAction<Object>() {
                    public Object run() {
                        future.cancel(true);
                        cachePool.shutdownNow();
                        return null;
                    }
                });
            }
            return null;
View Full Code Here

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

                    long end = System.nanoTime();
                    long elapsed = TimeUnit.NANOSECONDS.toMillis(end - start);
                    System.out.println("elapsed ms: " + elapsed);

                    for (Worker worker : workers) worker.stop();
                    executor.shutdownNow();

                    // Perform one request to get the result
                    ContentExchange exchange2 = new ContentExchange(true);
                    exchange2.setMethod(HttpMethods.GET);
                    exchange2.setURL(urls[0] + "?action=result");
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.