@Immutable public final class NopWatchService extends Object implements WatchService
WatchService
implementation
As its name tells, this implementation will never return any WatchKey
s. This means that if you try and take()
from it, you will
sleep forever until the watch service is closed, and will be greeted with a
ClosedWatchServiceException
.
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface WatchService
IOException
public WatchKey poll()
poll
in interface WatchService
public WatchKey poll(long timeout, TimeUnit unit) throws InterruptedException
poll
in interface WatchService
InterruptedException
public WatchKey take() throws InterruptedException
take
in interface WatchService
InterruptedException
public Path getPath()