WatchKey
Interface WatchKey
public interface WatchKey
A token representing the registration of a watchable
object with a WatchService
.
A watch key is created when a watchable object is registered with a watch service. The key remains valid
until:
- It is cancelled, explicitly, by invoking its
cancel
method, or - Cancelled implicitly, because the object is no longer accessible, or
- By
closing
the watch service.
A watch key has a state. When initially created the key is said to