Class RuntimeWatcher

java.lang.Object
io.higson.runtime.sync.BaseWatcher
io.higson.runtime.sync.RuntimeWatcher
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
FunctionRuntimeWatcher, ParamRuntimeWatcher

public abstract class RuntimeWatcher extends BaseWatcher implements Runnable
Author:
przemek hertel
  • Field Details

    • timestamp

      protected Date timestamp
    • eventListener

      protected WatcherEventListener eventListener
    • events

      protected List<WatcherEvent> events
    • lastUpdate

      protected Date lastUpdate
    • allFresh

      protected List<Trackable> allFresh
      All elements read from database just before cache sync.
    • allCached

      protected List<Trackable> allCached
      All elements read from cache just before cache sync.
  • Constructor Details

    • RuntimeWatcher

      public RuntimeWatcher()
  • Method Details

    • doWatch

      public void doWatch()
      Specified by:
      doWatch in class BaseWatcher
    • checkPossibleModification

      public void checkPossibleModification()
    • setEventListener

      public void setEventListener(WatcherEventListener listener)
    • possibleModification

      protected boolean possibleModification()
    • getLastUpdate

      public abstract Date getLastUpdate()
      gets largest last update sync date
      Returns:
      largest lastUpdate Date
    • getAllLastUpdates

      public abstract List<Trackable> getAllLastUpdates()
      gets all synchronized components from specific table
      Returns:
      list of Trackable components
      See Also:
    • getAllCached

      public abstract List<Trackable> getAllCached()
      get all cached elements
      Returns:
      all cached objects
    • invalidate

      public abstract void invalidate(int id)
      removes element in cache
      Parameters:
      id - of element to remove
    • reload

      public abstract void reload(int id)
      the implementation makes the decision whether the supplied element (id) should be reloaded or not
      Parameters:
      id - of element whose change was detected
    • getElementType

      public abstract ElementType getElementType()
      returns type that watcher is monitoring
      Returns:
      ElementType object
      See Also: