|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectname.pachler.nio.file.WatchKey
public abstract class WatchKey
A WatchKey
represents a Watchable
's registration for events with a
WatchService
. It is created on registration and subsequently used to retreive
WatchEvent
s.
To stop receiving events from a WatchService
(that is, undoing registration),
use the cancel()
method. Note that this will invalidate the WatchKey
, which
should then be discarded (as it cannot be reused).
WatchService.poll()
,
WatchService.take()
,
pollEvents()
Constructor Summary | |
---|---|
protected |
WatchKey()
|
Method Summary | |
---|---|
abstract void |
cancel()
This cancels the registration with the WatchService that this WatchKey was registered with. |
abstract boolean |
isValid()
|
abstract java.util.List<WatchEvent<?>> |
pollEvents()
Returns the events that have occurred for this WatchKey. |
abstract boolean |
reset()
Resets this WatchKey (marks it as non-signalled) so that it's
corresponding WatchService can report it again via it's
WatchService.poll() and WatchService.take() methods. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected WatchKey()
Method Detail |
---|
public abstract void cancel()
public abstract boolean isValid()
public abstract java.util.List<WatchEvent<?>> pollEvents()
public abstract boolean reset()
WatchKey
(marks it as non-signalled) so that it's
corresponding WatchService
can report it again via it's
WatchService.poll()
and WatchService.take()
methods.
true
if the key could be reset, false
otherwise (typically if the corresponding WatchService
has been closed
or if the the key was not signalled).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |