public void stop() throws Exception {
        if (isValidDir) {
            LOGGER.info("Stopping dir watcher for {}",
                    dirToWatch.toAbsolutePath().normalize());

            if (watchService != null) {
                watchService.close();
            }
            if (executorService != null) {
                if (watcherFuture != null
                    && !watcherFuture.isCancelled()
                    && !watcherFuture.isDone()) {
                    watcherFuture.cancel(true);
                }
                executorService.shutdown();
            }
        }
        isRunning.set(false);
    }
Stops the object. Called <i>after</i> the application is no longer accepting requests.

@throws Exception if something goes wrong.
stroom-util/src/main/java/stroom/util/io/AbstractDirChangeMonitor.java