Class EventDispatcher

  • All Implemented Interfaces:
    Runnable

    public class EventDispatcher
    extends Object
    implements Runnable
    The EventDispatcher holds a queue of all events collected by the watcher but not yet processed. It runs on its own thread and is responsible for calling all the registered listeners. Since file system events can spawn too fast, this implementation works as buffer for fast spawning events. The watcher is now responsible for collecting and pushing events in this queue.
    • Constructor Detail

      • EventDispatcher

        public EventDispatcher​(Map<Path,​List<WatchEventListener>> listeners)
        Instantiates a new event dispatcher.
        Parameters:
        listeners - the listeners