Examples of shutdownNow()


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;
                }
            });
           
            this.logger.status("remoteproxytodiscovery/end");
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

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

            e.printStackTrace();
        } catch (final SecurityException e) {
            e.printStackTrace();
        } finally {
            System.out.println("Cancelling");
            newCachedThreadPool.shutdownNow();
            submit.cancel(true);
        }

        System.out.println("xx");
    }
View Full Code Here

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

                }
            }
        }
        finally
        {
            executor.shutdownNow();
        }

        assert splits.size() > 0;
        Collections.shuffle(splits, new Random(System.nanoTime()));
        return splits;
View Full Code Here

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

            session.executeAsync(insertStatement.bind(key)).addListener(progressReporter, progressReportExecutor);
        }

        // 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.ScheduledExecutorService.shutdownNow()

        // Generate the load
        for (int i = 0; i < 10000; i++)
            session.executeAsync("SELECT release_version FROM system.local");

        openConnectionsWatcherExecutor.shutdownNow();
        if (excessInflightQueriesSpotted.get()) {
            fail("Inflight queries exceeded the limit");
        }
    }
}
View Full Code Here

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

    public synchronized void cancel() {
        if (executor.isShutdown()) {
      throw new IllegalStateException(
          "Task is already cancelled");
        }
        executor.shutdownNow();
    }
      };
  }
    }
View Full Code Here

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

    // Stop executor. It was only needed to poll AE initialization status.
    // Since deploy() completed
    // the UIMA AS service either succeeded initializing or it failed. In
    // either case we no longer
    // need to poll for initialization status
    executor.shutdownNow();

    if (serviceDeployer == null || serviceDeployer.initializationFailed()) {
      currentState = ProcessState.FailedInitialization;
      System.out
          .println(">>> Failed to Deploy UIMA Service. Check UIMA Log for Details");
View Full Code Here

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

    // Wait for all the tasks to finish
    try {
      boolean stillRunning = !threadPool.awaitTermination(
          this.fileSplitTimeout, TimeUnit.MILLISECONDS);
      if (stillRunning) {
        threadPool.shutdownNow();
        // wait for the thread to shutdown completely.
        while (!threadPool.isTerminated()) {
          Thread.sleep(50);
        }
        throw new IOException("Took too long to split the" +
View Full Code Here

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

      LOG.error("Caught " + e + " during region creation");
      throw new InterruptedIOException(e.getMessage());
    } catch (ExecutionException e) {
      throw new IOException(e);
    } finally {
      regionOpenAndInitThreadPool.shutdownNow();
    }
    return regionInfos;
  }

  /*
 
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.