@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,
WatchService watchService)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeWatchService()
Closes the watch service.
|
protected WatchKey |
registerPath(Path dir)
Registers a patch to watch.
|
close, getWatchService, isRunning, start, stop
public MacOsWatchThread(ApplicationEventPublisher eventPublisher, FileWatchConfiguration configuration, WatchService watchService)
eventPublisher
- The event publisherconfiguration
- the configurationwatchService
- the watch service@NonNull protected WatchKey registerPath(@NonNull Path dir) throws IOException
DefaultWatchThread
registerPath
in class DefaultWatchThread
dir
- The directory to watchIOException
- if an error occurs.protected void closeWatchService()
DefaultWatchThread
closeWatchService
in class DefaultWatchThread