Package java.util.concurrent

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


                }
                Thread.sleep(30);
                mk.merge(branchId, null);
            }
        } finally {
            gcExecutor.shutdown();
        }
    }

    @Test
    public void putTokenImpl() throws InterruptedException, ExecutionException {
View Full Code Here


          throws IOException
      {
        server.stop();
        engine.shutdown();
        executor.shutdown();
        scheduler.shutdown();
      }

      @Override
      public void waitForStop()
          throws InterruptedException
View Full Code Here

    {
      e.printStackTrace();
    }

    zkClient.getZooKeeper().close();
    executorService.shutdown();
  }
}
View Full Code Here

    {
      e.printStackTrace();
    }

    zkClient.getZooKeeper().close();
    executorService.shutdown();
  }
}
View Full Code Here

        Thread.sleep(3000);
        // Just a System out to remind us that we should see something
        System.out.println("Should have seen an item marked overdue, now");

        // to make sure the JVM ends, we shut down any threads created by the ExecutorService.
        executorService.shutdown();
    }
}
View Full Code Here

    HttpClientFactory factory = new HttpClientFactory(FilterChains.empty(), channelFactory, false, scheduler, false);

    FutureCallback<None> callback = new FutureCallback<None>();
    factory.shutdown(callback, 60, TimeUnit.MINUTES);
    callback.get(60, TimeUnit.SECONDS);
    scheduler.shutdown();
    channelFactory.releaseExternalResources();
    Assert.assertTrue(scheduler.awaitTermination(60, TimeUnit.SECONDS));
    Assert.assertTrue(boss.awaitTermination(60, TimeUnit.SECONDS));
    Assert.assertTrue(worker.awaitTermination(60, TimeUnit.SECONDS));
  }
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) {
View Full Code Here

                mk.commit("/a/b/c/d/e", "+\"f\" : {}", mk.getHeadRevision(), null);
                Thread.sleep(3);
                mk.commit("/a/b/c/d", "-\"e\"", mk.getHeadRevision(), null);
            }
        } finally {
            gcExecutor.shutdown();
        }
    }

    /**
     * Verify garbage collection can run concurrently with branch & merge.
View Full Code Here

                }
                Thread.sleep(30);
                mk.merge(branchId, null);
            }
        } finally {
            gcExecutor.shutdown();
        }
    }

    @Test
    public void putTokenImpl() throws InterruptedException, ExecutionException {
View Full Code Here

                        clock + " unexpected drift ater 100ms: " + drift + "ms (estimated limit was " +
                                limit + "ms, measured granularity was " + (granularity / 1000f) + "ms)",
                        Math.abs(drift) <= limit);
            }
        } finally {
            executor.shutdown();
        }
    }

    private static long getGranularity(Clock clock) {
        return clock instanceof Fast
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.