@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, stoppublic 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
DefaultWatchThreadregisterPath in class DefaultWatchThreaddir - The directory to watchIOException - if an error occurs.protected void closeWatchService()
DefaultWatchThreadcloseWatchService in class DefaultWatchThread