Package java.util.concurrent

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


                    assertThat(EfficientString.fromString(str), is(e));
                }
            });
        }

        executorService.shutdown();
        executorService.awaitTermination(2, TimeUnit.SECONDS);
        // check greater than so that it won't clash with concurrent executions of other tests in surefire
        assertThat(EfficientString.nextIndex()-startIndex, Matchers.greaterThan(total/factor));
    }
View Full Code Here


    final THsHaServer server = new THsHaServer(args);
   
    Runtime.getRuntime().addShutdownHook(new Thread() {
      public void run() {
        service_handler.shutdown();
        scheduExec.shutdown();
        server.stop();
      }

    });
    LOG.info("Starting BlueWhale server...");
View Full Code Here

        assertEquals("result count", itemSize, pool.getResultCount());
        for (int i = 0; i < itemSize; i++) {
            TestItem item = items.get(i);
            assertEquals("item(" + i + ") result", Integer.toString(i), pool.getResult(item));
        }
        executor.shutdown();
    }

    private static class TestItem implements DependencyPool.Item<TestItem, Integer, String> {
        private final DependencyPool<Integer, TestItem, String> pool;
        private final Integer key;
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

            @Override
            public String call() throws Exception {
                return mk.commit("/", "+\"b\" : {}", revisionId, null);
            }
        }, delay, TimeUnit.MILLISECONDS);
        executorService.shutdown();
        return future;
    }
}
View Full Code Here

        assertEquals("result count", itemSize, pool.getResultCount());
        for (int i = 0; i < itemSize; i++) {
            TestItem item = items.get(i);
            assertEquals("item(" + i + ") result", Integer.toString(i), pool.getResult(item));
        }
        executor.shutdown();
    }

    private static class TestItem implements DependencyPool.Item<TestItem, Integer, String> {
        private final DependencyPool<Integer, TestItem, String> pool;
        private final Integer key;
View Full Code Here

                    Debug.logInfo("Duplicate webapp mount; not loading : " + appInfo.getName() + " / " + appInfo.getLocation(), module);
                }
            }
            ExecutionPool.getAllFutures(futures);
        } finally {
            executor.shutdown();
        }
    }

    public void stop() throws ContainerException {
        try {
View Full Code Here

        assertTrue("Should be invoked", task.await());

        manager.stop();
        manager.removeTimerListener(task);
        executor.shutdown();
    }

    private class MyTask implements TimerListener {

        private CountDownLatch latch = new CountDownLatch(1);
View Full Code Here

        } finally {
            myTimer.removeTimerListener(test);
        }

        myTimer.stop();
        executorService.shutdown();
    }

    private class TestLoadAware implements TimerListener {

        int counter;
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.