public abstract WatchKey poll (long timeout, TimeUnit unit) throws InterruptedException

Retrieves and removes the next watch key, waiting if necessary up to the specified wait time if none are yet present.

Parameters:
timeout     how to wait before giving up, in units of unit
unit     a TimeUnit determining how to interpret the timeout parameter

Returns:  the next watch key, or null

Exceptions:
ClosedWatchServiceException     if this watch service is closed, or it is closed while waiting for the next key
InterruptedException     if interrupted while waiting