public.javadoc.org.spincast.plugins.hotswap.fileswatcher.HotSwapFilesModificationsListener.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
HotSwapFilesModificationsListener (org.spincast:spincast-framework 1.0.0 API)
org.spincast.plugins.hotswap.fileswatcher
Interface HotSwapFilesModificationsListener
-
public interface HotSwapFilesModificationsListener
A listener for file(s) that are watched for
modifications.
-
-
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type
Method and Description
void
fileModified(File modifiedFile)
Called when the watched file(s) are modified.
Set<FileToWatch>
getFilesToWatch()
The file(s) to watch.
boolean
isEnabled()
Should this listener be enabled?
-
-
Method Detail
-
isEnabled
boolean isEnabled()
Should this listener be enabled?
You often want to use such file modifications
listeners only during development, for autoreload
purposes. In production, you would disable it.
When this method return false
, the
listener is not registered, at all.
A common pattern for this method is to use:
return getSpincastConfig().isDevelopmentMode();
-
getFilesToWatch
Set<FileToWatch> getFilesToWatch()
The file(s) to watch.
-
fileModified
void fileModified(File modifiedFile)
Called when the watched file(s) are modified.
Receives the file that was modified.
The method is called in a new Thread.
Copyright © 2019. All rights reserved.