ScheduledFuture<?> startCondorMonitorFuture = scheduler.scheduleWithFixedDelay(startCondorMonitor, 1, 2, TimeUnit.MINUTES); Runnable stopCondorMonitor = new StopCondorMonitor(scheduler, startCondorMonitor, startCondorMonitorFuture); scheduler.scheduleAtFixedRate(stopCondorMonitor, 5, 3, TimeUnit.MINUTES); scheduler.awaitTermination(5, TimeUnit.DAYS);