Package io.micronaut.scheduling.io.watch
Class FileWatchConfiguration
- java.lang.Object
-
- io.micronaut.scheduling.io.watch.FileWatchConfiguration
-
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@ConfigurationProperties("micronaut.io.watch") @Requires(property="micronaut.io.watch.paths") public class FileWatchConfiguration extends java.lang.Object implements io.micronaut.core.util.ToggleableConfiguration for the file watch service.- Since:
- 1.1.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringENABLEDSetting to enable and disable server watch.static java.lang.StringPATHSThe watch paths.static java.lang.StringPREFIXThe prefix to use to configure the watch service.static java.lang.StringRESTARTSetting to enable and disable restart.
-
Constructor Summary
Constructors Constructor Description FileWatchConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.time.DurationgetCheckInterval()The interval to wait between checks.java.util.List<java.nio.file.Path>getPaths()The paths to watch.booleanisEnabled()booleanisRestart()Should the server be shutdown when a watch event fires.voidsetCheckInterval(java.time.Duration checkInterval)Sets the interval to wait between file watch polls.voidsetEnabled(boolean enabled)Whether watch is enabled.voidsetPaths(java.util.List<java.nio.file.Path> paths)Sets the watch paths to use.voidsetRestart(boolean restart)Set whether restart is enabled.
-
-
-
Field Detail
-
PREFIX
public static final java.lang.String PREFIX
The prefix to use to configure the watch service.- See Also:
- Constant Field Values
-
PATHS
public static final java.lang.String PATHS
The watch paths.- See Also:
- Constant Field Values
-
ENABLED
public static final java.lang.String ENABLED
Setting to enable and disable server watch.- See Also:
- Constant Field Values
-
RESTART
public static final java.lang.String RESTART
Setting to enable and disable restart.- See Also:
- Constant Field Values
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceio.micronaut.core.util.Toggleable
-
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:
isRestart()
-
setEnabled
public void setEnabled(boolean enabled)
Whether watch is enabled.- Parameters:
enabled- True if is enabled
-
getPaths
public java.util.List<java.nio.file.Path> getPaths()
The paths to watch.- Returns:
- A lists of
Pathobjects
-
setPaths
public void setPaths(@NonNull java.util.List<java.nio.file.Path> paths)Sets the watch paths to use.- Parameters:
paths- The watch paths
-
getCheckInterval
@NonNull public java.time.Duration getCheckInterval()
The interval to wait between checks.- Returns:
- The interval to wait.
-
setCheckInterval
public void setCheckInterval(@NonNull java.time.Duration checkInterval)Sets the interval to wait between file watch polls.- Parameters:
checkInterval- The check interval
-
-