Class WatchServiceFactory


  • @Requires(property="micronaut.io.watch.enabled",value="true",defaultValue="true") @Requires(condition=FileWatchCondition.class) @Requires(missingClasses="io.methvin.watchservice.MacOSXListeningWatchService")
    @Factory
    public class WatchServiceFactory
    extends java.lang.Object
    A factory that creates the default watch service.
    Since:
    1.1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.slf4j.Logger LOG  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.file.WatchService watchService()
      The default WatchService.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
    • Constructor Detail

      • WatchServiceFactory

        public WatchServiceFactory()
    • Method Detail

      • watchService

        @Bean(preDestroy="close")
        @Prototype
        @Requires(missingClasses="io.methvin.watchservice.MacOSXListeningWatchService") @Requires(property="micronaut.io.watch.enabled",value="true",defaultValue="true") @Requires(property="micronaut.io.watch.paths")
        @Primary
        public java.nio.file.WatchService watchService()
                                                throws java.io.IOException
        The default WatchService.
        Returns:
        The watch service to use.
        Throws:
        java.io.IOException - if an error occurs creating the watch service