- 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 TypeMethodDescriptionboolean
add
(IModifiable modifiable, IChangeListener<IModifiable> listener) Adds anIModifiable
object and anIChangeListener
object to call when the modifiable object is modified.void
destroy()
Stops thisModificationWatcher
.Retrieves a key set of allIModifiable
objects currently being monitored.remove
(IModifiable modifiable) Removes all entries associated with anIModifiable
object.void
Starts watching at a givenDuration
polling rate.
-
Method Details
-
add
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
Removes all entries associated with anIModifiable
object.- Parameters:
modifiable
- anIModifiable
object- Returns:
- the
IModifiable
object that was removed, elsenull
-
start
Starts watching at a givenDuration
polling rate.- Parameters:
pollFrequency
- the polling rateDuration
-
destroy
void destroy()Stops thisModificationWatcher
. -
getEntries
Retrieves a key set of allIModifiable
objects currently being monitored.- Returns:
- a
Set
of allIModifiable
entries currently maintained
-