Example #1
0
 public void initializeTaskMonitor() {
   if (taskMonitor == null) {
     final ExecutorService workerExec = Executors.newFixedThreadPool(workerConfig.getNumThreads());
     final PathChildrenCache pathChildrenCache =
         new PathChildrenCache(
             curatorFramework, workerCuratorCoordinator.getTaskPathForWorker(), false);
     taskMonitor =
         new TaskMonitor(
             pathChildrenCache,
             curatorFramework,
             workerCuratorCoordinator,
             taskToolbox,
             workerExec);
     lifecycle.addManagedInstance(taskMonitor);
   }
 }