@Replaces(value=DefaultWatchThread.class) @Parallel @Requires(property="micronaut.io.watch.enabled",value="true",defaultValue="true") @Requires(condition=FileWatchCondition.class) @Requires(classes={io.methvin.watchservice.MacOSXListeningWatchService.class,com.sun.jna.Library.class}) @Singleton public class MacOsWatchThread extends DefaultWatchThread
DefaultWatchThread
for Mac OS X to use native file watch.Constructor and Description |
---|
MacOsWatchThread(ApplicationEventPublisher eventPublisher,
FileWatchConfiguration configuration,
java.nio.file.WatchService watchService)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeWatchService()
Closes the watch service.
|
protected java.nio.file.WatchKey |
registerPath(java.nio.file.Path dir)
Registers a patch to watch.
|
close, getWatchService, isRunning, start, stop
public MacOsWatchThread(ApplicationEventPublisher eventPublisher, FileWatchConfiguration configuration, java.nio.file.WatchService watchService)
eventPublisher
- The event publisherconfiguration
- the configurationwatchService
- the watch service@NonNull protected java.nio.file.WatchKey registerPath(@NonNull java.nio.file.Path dir) throws java.io.IOException
DefaultWatchThread
registerPath
in class DefaultWatchThread
dir
- The directory to watchjava.io.IOException
- if an error occurs.protected void closeWatchService()
DefaultWatchThread
closeWatchService
in class DefaultWatchThread