Package java.util.concurrent

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


  public void shutdown() {
    ScheduledExecutorService es = this.executorService;
    if (es != null) {
      es.shutdown();
      try {
        es.awaitTermination(5000L, TimeUnit.MILLISECONDS);
      } catch (InterruptedException e) {
        throw new RuntimeException("Error shutting down the file cache", e);
      }
    }
  }
View Full Code Here


    public void stop() {
        final ScheduledExecutorService scheduler = this.scheduler.get();
        if (scheduler != null && this.scheduler.compareAndSet(scheduler, null)) {
            scheduler.shutdown();
            try {
                if (!scheduler.awaitTermination(10000, MILLISECONDS)) {
                    java.util.logging.Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Pool scheduler termination timeout expired");
                }
            } catch (InterruptedException e) {
                //Ignore
            }
View Full Code Here

        // Finish the executor
        executor.shutdown();

        // Waits for the finalization of the executor
        try {
            executor.awaitTermination(1, TimeUnit.DAYS);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        // Writes the finalization message
View Full Code Here

    public void stop() {
        final ScheduledExecutorService scheduler = this.scheduler.get();
        if (scheduler != null && this.scheduler.compareAndSet(scheduler, null)) {
            scheduler.shutdown();
            try {
                if (!scheduler.awaitTermination(10000, MILLISECONDS)) {
                    java.util.logging.Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Pool scheduler termination timeout expired");
                }
            } catch (InterruptedException e) {
                //Ignore
            }
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.