Class AbstractResourceWatcher<Listener>

All Implemented Interfaces:
Direct Known Subclasses:

public abstract class AbstractResourceWatcher<Listener>
extends java.lang.Object
implements ResourceWatcher
Abstract resource watcher framework, which handles adding and removing listeners and calling resource observer.
  • Constructor Summary

    Constructor Description
  • Method Summary

    Modifier and Type Method Description
    void addListener​(Listener listener)
    Registers new listener
    void checkAndNotify()
    Called periodically by ResourceWatcherService so resource watcher can check the resource
    protected abstract void doCheckAndNotify()
    Will be called periodically
    protected abstract void doInit()
    Will be called once on initialization
    void init()
    Called once when the resource watcher is added to ResourceWatcherService
    protected java.util.List<Listener> listeners()
    Returns a list of listeners
    void remove​(Listener listener)
    Unregisters a listener

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait