Interface IModificationWatcher

All Known Implementing Classes:
ModificationWatcher, Nio2ModificationWatcher

public interface IModificationWatcher
Monitors one or more IModifiable objects, calling a IChangeListener when a given object's modification time changes.
Author:
Juergen Donnerstag
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(IModifiable modifiable, IChangeListener<IModifiable> listener)
    Adds an IModifiable object and an IChangeListener object to call when the modifiable object is modified.
    void
    Stops this ModificationWatcher.
    Retrieves a key set of all IModifiable objects currently being monitored.
    remove(IModifiable modifiable)
    Removes all entries associated with an IModifiable object.
    void
    start(Duration pollFrequency)
    Starts watching at a given Duration polling rate.
  • Method Details

    • add

      boolean add(IModifiable modifiable, IChangeListener<IModifiable> listener)
      Adds an IModifiable object and an IChangeListener object to call when the modifiable object is modified.
      Parameters:
      modifiable - an IModifiable object to monitor
      listener - an IChangeListener to call if the IModifiable object is modified
      Returns:
      true if the set did not already contain the specified element
    • remove

      Removes all entries associated with an IModifiable object.
      Parameters:
      modifiable - an IModifiable object
      Returns:
      the IModifiable object that was removed, else null
    • start

      void start(Duration pollFrequency)
      Starts watching at a given Duration polling rate.
      Parameters:
      pollFrequency - the polling rate Duration
    • destroy

      void destroy()
      Stops this ModificationWatcher.
    • getEntries

      Retrieves a key set of all IModifiable objects currently being monitored.
      Returns:
      a Set of all IModifiable entries currently maintained