@Override
    public void close() {
        LOGGER.trace("Closing service registry watcher thread");
        IOUtils.closeQuietly(watchService);
        if (this.thread != null) {
            thread.interrupt();
        }
        executorService.shutdownNow();
        LOGGER.trace("Closed service registry watcher thread");
    }
Control watch operations on paths and files as a service.

@author David Rodriguez
@since 5.2.0
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/io/PathWatcherService.java