Phase phase = Phase.RUNNING; while (phase != Phase.FINISHED) { // during the running phase then poll for 1 second. // once the file creation has stopped then move to the finishing // phase where we do a long poll to ensure that all events have // been read. int time = (phase == Phase.RUNNING) ? 1 : 15;
key = watcher.poll(time, TimeUnit.SECONDS); if (key == null) { if (phase == Phase.RUNNING && stopped)
phase = Phase.FINISHING; elseif (phase == Phase.FINISHING)
phase = Phase.FINISHED;
} else { // process events for (WatchEvent<?> event: key.pollEvents()) { if (event.kind() == ENTRY_CREATE) {
Path name = (Path)event.context(); boolean added = entries.add(name); if (!added) thrownew RuntimeException("Duplicate ENTRY_CREATE event");
nCreateEvents++;
} elseif (event.kind() == ENTRY_DELETE) {
Path name = (Path)event.context(); boolean removed = entries.remove(name); if (!removed) thrownew RuntimeException("ENTRY_DELETE event without ENTRY_CREATE event");
} elseif (event.kind() == OVERFLOW) {
overflow = true;
phase = Phase.FINISHED;
} else { thrownew RuntimeException("Unexpected event: " + event.kind());
}
}
key.reset();
}
}
// there should be a DELETE event for each CREATE event and so the // entries set should be empty. if (!overflow && !entries.isEmpty()) thrownew RuntimeException("Missed " + entries.size() + " DELETE event(s)");
if (failure) thrownew RuntimeException("Test failed - see log file for details");
}
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.9Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.