Package io.higson.runtime.sync
Class RuntimeWatcher
java.lang.Object
io.higson.runtime.sync.BaseWatcher
io.higson.runtime.sync.RuntimeWatcher
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
FunctionRuntimeWatcher,ParamRuntimeWatcher
- Author:
- przemek hertel
-
Field Summary
FieldsModifier and TypeFieldDescriptionAll elements read from cache just before cache sync.All elements read from database just before cache sync.protected WatcherEventListenerprotected List<WatcherEvent>protected Dateprotected DateFields inherited from class io.higson.runtime.sync.BaseWatcher
config, log, running -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddoWatch()get all cached elementsgets all synchronized components from specific tableabstract ElementTypereturns type that watcher is monitoringabstract Dategets largest last update sync dateabstract voidinvalidate(int id) removes element in cacheprotected booleanabstract voidreload(int id) the implementation makes the decision whether the supplied element (id) should be reloaded or notvoidsetEventListener(WatcherEventListener listener) Methods inherited from class io.higson.runtime.sync.BaseWatcher
getConfig, getWatcherName, initWatcher, isRunning, print, print, run, setConfig, start, stop, watch
-
Field Details
-
timestamp
-
eventListener
-
events
-
lastUpdate
-
allFresh
All elements read from database just before cache sync. -
allCached
All elements read from cache just before cache sync.
-
-
Constructor Details
-
RuntimeWatcher
public RuntimeWatcher()
-
-
Method Details
-
doWatch
public void doWatch()- Specified by:
doWatchin classBaseWatcher
-
checkPossibleModification
public void checkPossibleModification() -
setEventListener
-
possibleModification
protected boolean possibleModification() -
getLastUpdate
gets largest last update sync date- Returns:
- largest lastUpdate Date
-
getAllLastUpdates
gets all synchronized components from specific table -
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
returns type that watcher is monitoring- Returns:
- ElementType object
- See Also:
-