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