Jetty Logo
Version: 9.4.5.v20170502
Contact the core Jetty developers at www.webtide.com

private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services for sponsored feature development

Java WatchService

Remedy

The JVM WatchService is in place to monitor objects like a directory for changes, and then update it’s contents and notify the application of those changes. This service is useful for features like Hot Deployment. When a change is detected, the WatchService will enter a "quiet time" where it is waiting for the change (or changes) to be made and completed before notifying the application of the change.

Example: A new war file is copied into /webapps. The WatchService can (depending on implementation) see that the file was created (which is registered as an event!, and that its growing in size (another event). With the quiet time, each of the events are gated behind that timeout before the aggregated events are sent to the application.

While some operating systems such as Windows have a native value for this quiet time, not all do, notably OSX. At the core this is a limitation of the JVM’s FileSystem-specific implementation, but one that has been raised to the attention of the project.

Remedy

To help offset the delay in systems like OSX, Jetty defaults the value for non-native implementations to a time of 5000ms. Using values lower than 5000ms is not recommended and has shown to frequently fail.

See an error or something missing? Contribute to this documentation at Github!(Generated: 2017-05-02)