Package io.micronaut.scheduling.io.watch
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe interval to wait between checks.getPaths()
The paths to watch.boolean
boolean
Should the server be shutdown when a watch event fires.void
setCheckInterval
(@NonNull Duration checkInterval) Sets the interval to wait between file watch polls.void
setEnabled
(boolean enabled) Whether watch is enabled.void
Sets the watch paths to use.void
setRestart
(boolean restart) Set whether restart is enabled.
-
Field Details
-
PREFIX
The prefix to use to configure the watch service.- See Also:
-
PATHS
The watch paths.- See Also:
-
ENABLED
Setting to enable and disable server watch.- See Also:
-
RESTART
Setting to enable and disable restart.- See Also:
-
-
Constructor Details
-
FileWatchConfiguration
public FileWatchConfiguration()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in 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 --continuous
or 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
The paths to watch.- Returns:
- A lists of
Path
objects
-
setPaths
Sets the watch paths to use.- Parameters:
paths
- The watch paths
-
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
-