Package org.apache.wicket.util.watch
Interface IModificationWatcher
-
- All Known Implementing Classes:
ModificationWatcher
public interface IModificationWatcher
Monitors one or moreIModifiableobjects, calling aIChangeListenerwhen a given object's modification time changes.- Author:
- Juergen Donnerstag
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadd(IModifiable modifiable, IChangeListener<IModifiable> listener)Adds anIModifiableobject and anIChangeListenerobject to call when the modifiable object is modified.voiddestroy()Stops thisModificationWatcher.Set<IModifiable>getEntries()Retrieves a key set of allIModifiableobjects currently being monitored.IModifiableremove(IModifiable modifiable)Removes all entries associated with anIModifiableobject.voidstart(Duration pollFrequency)Starts watching at a givenDurationpolling rate.
-
-
-
Method Detail
-
add
boolean add(IModifiable modifiable, IChangeListener<IModifiable> listener)
Adds anIModifiableobject and anIChangeListenerobject to call when the modifiable object is modified.- Parameters:
modifiable- anIModifiableobject to monitorlistener- anIChangeListenerto call if theIModifiableobject is modified- Returns:
trueif the set did not already contain the specified element
-
remove
IModifiable remove(IModifiable modifiable)
Removes all entries associated with anIModifiableobject.- Parameters:
modifiable- anIModifiableobject- Returns:
- the
IModifiableobject that was removed, elsenull
-
start
void start(Duration pollFrequency)
Starts watching at a givenDurationpolling rate.- Parameters:
pollFrequency- the polling rateDuration
-
destroy
void destroy()
Stops thisModificationWatcher.
-
getEntries
Set<IModifiable> getEntries()
Retrieves a key set of allIModifiableobjects currently being monitored.- Returns:
- a
Setof allIModifiableentries currently maintained
-
-