Class Nio2ModificationWatcher
java.lang.Object
org.apache.wicket.util.watch.ModificationWatcher
org.apache.wicket.core.util.watch.Nio2ModificationWatcher
- All Implemented Interfaces:
IModificationWatcher
An extension of ModificationWatcher that removes the NotFound entries from
the MarkupCache for newly created files.
By default MarkupCache registers Markup.NO_MARKUP value for each requested but
not found markup file. Later when the user creates the markup file the MarkupCache
should be notified.
- Since:
- 7.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.wicket.util.watch.ModificationWatcher
ModificationWatcher.Entry
-
Constructor Summary
ConstructorDescriptionNio2ModificationWatcher
(Application application, Duration pollFrequency) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkCreated
(org.slf4j.Logger log) Checks for newly created files and folders.void
destroy()
protected void
entryCreated
(Path path, org.slf4j.Logger log) A callback method called when a new Path entry is createdprotected void
entryDeleted
(Path path, org.slf4j.Logger log) A callback method called when a new Path entry is deletedprotected void
entryModified
(Path path, org.slf4j.Logger log) A callback method called when a new Path entry is modifiedprotected WatchEvent.Kind[]
getWatchedKinds
(Path folder) void
Methods inherited from class org.apache.wicket.util.watch.ModificationWatcher
add, checkModified, getEntries, remove
-
Constructor Details
-
Nio2ModificationWatcher
Constructor.- Parameters:
application
- The application that manages the cachespollFrequency
- How often to check onIModifiable
s
-
-
Method Details
-
start
- Specified by:
start
in interfaceIModificationWatcher
- Overrides:
start
in classModificationWatcher
-
checkCreated
Checks for newly created files and folders. New folders are registered to be watched. New files are removed from the MarkupCache because there could beMarkup.NO_MARKUP
(Not Found) entries for them already.- Parameters:
log
- a logger that can be used to log the events
-
entryModified
A callback method called when a new Path entry is modified- Parameters:
path
- the modified pathlog
- a logger that can be used to log the events
-
entryDeleted
A callback method called when a new Path entry is deleted- Parameters:
path
- the deleted pathlog
- a logger that can be used to log the events
-
entryCreated
A callback method called when a new Path entry is created- Parameters:
path
- the new path entrylog
- a logger that can be used to log the events
-
destroy
- Specified by:
destroy
in interfaceIModificationWatcher
- Overrides:
destroy
in classModificationWatcher
-
getWatchedKinds
- Parameters:
folder
- the folder that will be watched- Returns:
- an array of watch event kinds to use for the watching of the given folder
-