public class MacOSXListeningWatchService
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MacOSXListeningWatchService.CFRunLoopThread |
Constructor and Description |
---|
MacOSXListeningWatchService() |
Modifier and Type | Method and Description |
---|---|
void |
cancelled(io.methvin.watchservice.AbstractWatchKey key)
Called when the given key is cancelled.
|
protected void |
checkOpen()
Checks that the watch service is open, throwing
ClosedWatchServiceException if not. |
void |
close() |
boolean |
isOpen()
Returns whether or not this watch service is open.
|
java.nio.file.WatchKey |
poll() |
java.nio.file.WatchKey |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
io.methvin.watchservice.AbstractWatchKey |
register(WatchablePath watchable,
java.lang.Iterable<? extends java.nio.file.WatchEvent.Kind<?>> events)
Registers the given watchable with this service, returning a new watch key for it.
|
java.nio.file.WatchKey |
take() |
public io.methvin.watchservice.AbstractWatchKey register(WatchablePath watchable, java.lang.Iterable<? extends java.nio.file.WatchEvent.Kind<?>> events) throws java.io.IOException
java.io.IOException
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface java.nio.file.WatchService
public boolean isOpen()
public void cancelled(io.methvin.watchservice.AbstractWatchKey key)
@Nullable public java.nio.file.WatchKey poll()
poll
in interface java.nio.file.WatchService
@Nullable public java.nio.file.WatchKey poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
poll
in interface java.nio.file.WatchService
java.lang.InterruptedException
public java.nio.file.WatchKey take() throws java.lang.InterruptedException
take
in interface java.nio.file.WatchService
java.lang.InterruptedException
protected final void checkOpen()
ClosedWatchServiceException
if not.