Example usage for org.apache.commons.jci.monitor FilesystemAlterationObserver checkAndNotify

List of usage examples for org.apache.commons.jci.monitor FilesystemAlterationObserver checkAndNotify

Introduction

In this page you can find the example usage for org.apache.commons.jci.monitor FilesystemAlterationObserver checkAndNotify.

Prototype

void checkAndNotify();

Source Link

Usage

From source file:org.apache.accumulo.start.classloader.AccumuloFilesystemAlterationMonitor.java

public void run() {
    log.debug("fam running");

    while (true) {
        if (!running) {
            break;
        }//from   ww w .  ja  v a  2  s.c  om

        final Map currentObservers = observers;

        for (Iterator it = currentObservers.values().iterator(); it.hasNext();) {
            final FilesystemAlterationObserver observer = (FilesystemAlterationObserver) it.next();
            observer.checkAndNotify();
        }

        if (!running)
            break;
        try {
            Thread.sleep(delay);
        } catch (final InterruptedException e) {
        }
    }

    log.debug("fam exiting");
}