/** * Startup the watchdir service. */ private void startupWatchdir() throws Exception { File dirToWatch; if (this.configuration.getProcessConfigDirOrFile().isFile()) { dirToWatch = new File(FilenameUtils.getFullPath(this.configuration.getProcessConfigDirOrFile().getAbsolutePath())); } else { dirToWatch = this.configuration.getProcessConfigDirOrFile(); } // start the watcher this.watcher = new WatchDir(dirToWatch, this); this.watcher.start(); }
private synchronized void stopServices() throws LifecycleException { try { // Shutdown the scheduler serverScheduler.stop(); for (ThreadPoolExecutor executor : queryExecutorRepository.getExecutors()) { shutdownAndAwaitTermination(executor, 10, SECONDS); } for (ThreadPoolExecutor executor : resultExecutorRepository.getExecutors()) { shutdownAndAwaitTermination(executor, 10, SECONDS); } // Shutdown the file watch service if (watcher != null) { watcher.stopService(); watcher = null; log.debug("Shutdown watch service"); } // Shutdown the outputwriters stopWriterAndClearMasterServerList(); } catch (Exception e) { throw new LifecycleException(e); } }
/** * Startup the watchdir service. */ private void startupWatchdir() throws Exception { File dirToWatch; if (this.configuration.getProcessConfigDirOrFile().isFile()) { dirToWatch = new File(FilenameUtils.getFullPath(this.configuration.getProcessConfigDirOrFile().getAbsolutePath())); } else { dirToWatch = this.configuration.getProcessConfigDirOrFile(); } // start the watcher this.watcher = new WatchDir(dirToWatch, this); this.watcher.start(); }
watcher.stopService(); watcher = null; log.debug("Shutdown watch service");