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
ConstructorsConstructorDescriptionMacOsWatchThread(io.micronaut.context.event.ApplicationEventPublisher eventPublisher, io.micronaut.scheduling.io.watch.FileWatchConfiguration configuration, WatchService watchService) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected @NonNull WatchKeyregisterPath(@NonNull Path dir) Methods inherited from class io.micronaut.scheduling.io.watch.DefaultWatchThread
close, getWatchService, isRunning, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 publisherconfiguration- the configurationwatchService- the watch service
-
-
Method Details
-
registerPath
- Overrides:
registerPathin classio.micronaut.scheduling.io.watch.DefaultWatchThread- Throws:
IOException
-
closeWatchService
protected void closeWatchService()- Overrides:
closeWatchServicein classio.micronaut.scheduling.io.watch.DefaultWatchThread
-