Class MacOsWatchThread

java.lang.Object
io.micronaut.scheduling.io.watch.DefaultWatchThread
io.micronaut.scheduling.io.watch.osx.MacOsWatchThread
All Implemented Interfaces:
io.micronaut.context.LifeCycle<io.micronaut.scheduling.io.watch.DefaultWatchThread>, Closeable, AutoCloseable

@Replaces(io.micronaut.scheduling.io.watch.DefaultWatchThread.class) @Parallel @Requires(property="micronaut.io.watch.enabled",value="true",defaultValue="true") @Requires(condition=io.micronaut.scheduling.io.watch.FileWatchCondition.class) @Requires(classes={io.methvin.watchservice.MacOSXListeningWatchService.class,com.sun.jna.Library.class}) @Singleton public class MacOsWatchThread extends io.micronaut.scheduling.io.watch.DefaultWatchThread
Replaces the DefaultWatchThread for Mac OS X to use native file watch.
Since:
1.1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    MacOsWatchThread(io.micronaut.context.event.ApplicationEventPublisher eventPublisher, io.micronaut.scheduling.io.watch.FileWatchConfiguration configuration, WatchService watchService)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected @NonNull WatchKey
    registerPath(@NonNull Path dir)
     

    Methods inherited from class io.micronaut.scheduling.io.watch.DefaultWatchThread

    close, getWatchService, isRunning, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.context.LifeCycle

    refresh
  • Constructor Details

    • MacOsWatchThread

      public MacOsWatchThread(io.micronaut.context.event.ApplicationEventPublisher eventPublisher, io.micronaut.scheduling.io.watch.FileWatchConfiguration configuration, WatchService watchService)
      Default constructor.
      Parameters:
      eventPublisher - The event publisher
      configuration - the configuration
      watchService - the watch service
  • Method Details

    • registerPath

      @NonNull protected @NonNull WatchKey registerPath(@NonNull @NonNull Path dir) throws IOException
      Overrides:
      registerPath in class io.micronaut.scheduling.io.watch.DefaultWatchThread
      Throws:
      IOException
    • closeWatchService

      protected void closeWatchService()
      Overrides:
      closeWatchService in class io.micronaut.scheduling.io.watch.DefaultWatchThread