Package java.util.concurrent

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


        assertEquals("", 1D, inst.getSamplers().get("a").get("1").getValue(), 0.01D);
        assertEquals("", 2D, inst.getSamplers().get("a").get("2").getValue(), 0.02D);
        assertEquals("", 5D, inst.getSamplers().get("b").get("1").getValue(), 0.5D);

        scheduledExecutorService.shutdownNow();
    }

    public void testAll() throws Exception {
        Instrumentation inst = new Instrumentation();
        inst.addVariable("a", "1", new Instrumentation.Variable<Long>() {
View Full Code Here


      }
      catch (SQLException e) {
         Assert.fail("Should not have timed out: " + e.getMessage());
      }
      finally {
         scheduler.shutdownNow();
         ds.close();
      }
   }

   @Test
View Full Code Here

      }
      catch (SQLException e) {
         Assert.fail("Should not have timed out.");
      }
      finally {
         scheduler.shutdownNow();
         ds.close();
      }
   }

   @Test
View Full Code Here

      }
      catch (SQLException e) {
         Assert.fail("Should not have timed out.");
      }
      finally {
         scheduler.shutdownNow();
         ds.close();
      }
   }

   @Test
View Full Code Here

        executor.shutdown();
        try {
            // Wait for all remaining background threads to terminate
            if (!executor.awaitTermination(10, TimeUnit.SECONDS)) {
                log.warn("Attempting to forcibly shutdown runaway threads");
                executor.shutdownNow();
            }
        } catch (InterruptedException e) {
            log.warn("Interrupted while waiting for background threads", e);
        }
View Full Code Here

        executor.shutdown();
        try {
            // Wait for all remaining background threads to terminate
            if (!executor.awaitTermination(10, TimeUnit.SECONDS)) {
                log.warn("Attempting to forcibly shutdown runaway threads");
                executor.shutdownNow();
            }
        } catch (InterruptedException e) {
            log.warn("Interrupted while waiting for background threads", e);
        }
View Full Code Here

    private void stop() {
        ScheduledExecutorService executor = this.executor;
        if (executor == null) {
            return;
        }
        executor.shutdownNow();
        this.executor = null;
    }

    private class NotifyingTask implements Runnable {
        public void run() {
View Full Code Here

        assertEquals("", 1D, inst.getSamplers().get("a").get("1").getValue(), 0.01D);
        assertEquals("", 2D, inst.getSamplers().get("a").get("2").getValue(), 0.02D);
        assertEquals("", 5D, inst.getSamplers().get("b").get("1").getValue(), 0.5D);

        scheduledExecutorService.shutdownNow();
    }

    public void testAll() throws Exception {
        Instrumentation inst = new Instrumentation();
        inst.addVariable("a", "1", new Instrumentation.Variable<Long>() {
View Full Code Here

      if (scheduler != null) {
        if (log.isDebugEnabled())
          log.debug("Shutting down scheduler");
        try {
          ScheduledExecutorService exe = scheduler.getScheduledExecutor();
          List<Runnable> runables = exe.shutdownNow();
          if (log.isDebugEnabled())
            log.debug("Scheduler - shutdown: {} queued: {}", exe.isShutdown(), runables.size());
          if (scheduler != null) {
            scheduler.shutdown();
            scheduler = null;
View Full Code Here

      if (executor != null) {
        if (log.isDebugEnabled())
          log.debug("Shutting down executor");
        try {
          ThreadPoolExecutor exe = executor.getThreadPoolExecutor();
          List<Runnable> runables = exe.shutdownNow();
          if (log.isDebugEnabled())
            log.debug("Executor - shutdown: {} queued: {}", exe.isShutdown(), runables.size());
          if (executor != null) {
            executor.shutdown();
            executor = null;
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.