@Test public void singleFixedDelayTask() throws InterruptedException, ExecutionException, TimeoutException { final Future<Integer> futureA = scheduledService.singleFixedDelayTask(1, null); final Future<Integer> futureB = scheduledService.singleFixedDelayTask(50, null); LOGGER.info("Do some other work while we wait for the tasks"); assertEquals(2, futureA.get(200, TimeUnit.MILLISECONDS).intValue()); assertEquals(51, futureB.get(200, TimeUnit.MILLISECONDS).intValue()); }
public Future<Integer> singleFixedDelayTask(final int value, final String errorMessage) { LOGGER.info("longCallableTask scheduled"); return executor.schedule( longCallableTask(value, 10, errorMessage), 100, TimeUnit.MILLISECONDS); }
ManagedScheduledService { public Future<Integer> singleFixedDelayTask(final int value, final String errorMessage) { LOGGER.info("longCallableTask scheduled"); return executor.schedule( longCallableTask(value, 10, errorMessage), 100, TimeUnit.MILLISECONDS); } }
ManagedScheduledService { public Future<Integer> singleFixedDelayTask(final int value, final String errorMessage) { LOGGER.info("longCallableTask scheduled"); return executor.schedule( longCallableTask(value, 10, errorMessage), 100, TimeUnit.MILLISECONDS); }  }
ManagedScheduledService { public Future<Integer> singleFixedDelayTask(final int value, final String errorMessage) { LOGGER.info("longCallableTask scheduled"); return executor.schedule( longCallableTask(value, 10, errorMessage), 100, TimeUnit.MILLISECONDS); }  Future<Integer> singleFixedDelayTask(final int value,
                                                final String errorMessage); ScheduledFuture<?> periodicFixedDelayTask(final int value,
                                                     final String errorMessage,
                                                     final CountDownLatch countDownLatch); }
ManagedScheduledService { public Future<Integer> singleFixedDelayTask(final int value, final String errorMessage) { LOGGER.info("longCallableTask scheduled"); return executor.schedule( longCallableTask(value, 10, errorMessage), 100, TimeUnit.MILLISECONDS); }  Future<Integer> singleFixedDelayTask(final int value,
                                                final String errorMessage); ScheduledFuture<?> periodicFixedDelayTask(final int value,
                                                     final String errorMessage,
                                                     final CountDownLatch countDownLatch);  }