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:

  1. It is cancelled, explicitly, by invoking its cancel method, or
  2. Cancelled implicitly, because the object is no longer accessible, or
  3. By closing the watch service.

A watch key has a state. When initially created the key is said to