Posted by Alex Blewitt on Oct 08, 2009
InfoQ covered the move of Jetty to Eclipse earlier in the year; and whilst Jetty 6.0 will still be supported, new features are being targeted at 7.0. Both Jetty 6.0 and 7.0 are based on the Servlet 2.5 API; the experimental Jetty 8.0 is tracking the Servlet 3.0 API which is expected to be finalised next year.
One of the key features of Jetty 6.0 was the introduction of Continuations at the Servlet layer, which allows long-lived client connections (such as those used by CometD, also known as the Bayeux protocol). InfoQ previously covered the Jetty 6.0 release and demos of continuations show how they can be used to scale up the number of concurrent users without compromising the number of threads (and associated overhead).
The success of this technique led to Jetty's proposal of asynchronous servlets in the Servlet 3.0 draft specification. Jetty 7.0 implements these continuations in such a way that they can run unchanged on Servlet 3.0 implementations, and fall back (to non-asynchronous, blocking) in non-Jetty Servlet 2.5 implementations.
Since the move to Eclipse, the code has been refactored (the
The porting document describes the differences in the packages; since a number of class names have changed, there is an automated tool that can convert configuration files to use the new names for Jetty 7.0. Future upgrades (e.g. to Jetty 8.0) will be much more seamless, since the packages won't undergo a future rename or repackaging.
The cometd-jetty project, based on the older Jetty 6.0, has been deprecated in favour of cometd-java based on Jetty 7.0, and which now lives at CometD.org. A demo is available which shows the benefit of asynchronous continuations by providing a number of AJAX clients, which create long-lived connections to the back-end server but without increasing load.
The current version of Hightide is available to download is currently based on Jetty 6.0, but a revised version including Jetty 7.0 will be available in the near future.
Jetty is available under a dual-license including Apache License 2.0 as well as the Eclipse Public License 1.0 from www.eclipse.org/jetty. In addition, Jetty packages are also available from Codehaus for other platforms, like RPMs and Debs packages for Linux systems.