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 Details

  • Constructor Details

    • FileWatchConfiguration

      public FileWatchConfiguration()
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Toggleable
      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 like gradle 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

      public List<Path> getPaths()
      The paths to watch.
      Returns:
      A lists of Path objects
    • setPaths

      public void setPaths(@NonNull @NonNull List<Path> paths)
      Sets the watch paths to use.
      Parameters:
      paths - The watch paths
    • getCheckInterval

      @NonNull public @NonNull Duration getCheckInterval()
      The interval to wait between checks.
      Returns:
      The interval to wait.
    • setCheckInterval

      public void setCheckInterval(@NonNull @NonNull Duration checkInterval)
      Sets the interval to wait between file watch polls.
      Parameters:
      checkInterval - The check interval