Class FileWatchConfiguration
java.lang.Object
io.micronaut.scheduling.io.watch.FileWatchConfiguration
- All Implemented Interfaces:
Toggleable
@ConfigurationProperties("micronaut.io.watch")
@Requires(property="micronaut.io.watch.paths")
public class FileWatchConfiguration
extends Object
implements Toggleable
Configuration for the file watch service.
- Since:
- 1.1.0
- Author:
- graemerocher
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe interval to wait between checks.getPaths()The paths to watch.booleanbooleanShould the server be shutdown when a watch event fires.voidsetCheckInterval(Duration checkInterval) Sets the interval to wait between file watch polls.voidsetEnabled(boolean enabled) Whether watch is enabled.voidSets the watch paths to use.voidsetRestart(boolean restart) Set whether restart is enabled.
-
Field Details
-
PREFIX
-
PATHS
-
ENABLED
-
RESTART
-
-
Constructor Details
-
FileWatchConfiguration
public FileWatchConfiguration()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceToggleable- Returns:
- Whether the component is enabled
-
isRestart
public boolean isRestart()Should the server be shutdown when a watch event fires. Note that if set to true an external process likegradle run --continuousor Kubernetes replication controller is required to restart the container.- Returns:
- Is restart enabled. Defaults to false.
-
setRestart
public void setRestart(boolean restart) Set whether restart is enabled.- Parameters:
restart- True if restart is to be enabled- See Also:
-
setEnabled
public void setEnabled(boolean enabled) Whether watch is enabled.- Parameters:
enabled- True if is enabled
-
getPaths
-
setPaths
-
getCheckInterval
The interval to wait between checks.- Returns:
- The interval to wait.
-
setCheckInterval
Sets the interval to wait between file watch polls.- Parameters:
checkInterval- The check interval
-