RESTful Web Services Framework Jersey 2.0 Released, Implementing JAX-RS 2.0 Specification
Final version of the RESTful Web Services Framework Jersey 2.0 was recently released, bringing a Client API and support for asynchronous Clients and Services. Jersey 2.0 is a reference implementation of the JAX-RS 2.0 API Specification, (JSR 339), released late May.
The Java-based framework has gone through a major refactoring to accommodate the significant changes in JAX-RS 2.0, which include:
- A Client API for communication with a RESTful or any other Web service exposed on the HTTP protocol. This new JAX-RS Client API builds on concepts in the proprietary Jersey 1.x Client API so developers familiar with the 1.x Client should find it easy to migrate to the new one.
- Hypermedia support with link-related classes to support building hyperlinks according to the HATEOAS concept, e.g. links to related resources or links for changing state of a resource.
- Filters and interceptors that make it possible to monitor and modify both incoming and outgoing messages on the client as well as on the server side. Examples of use include authentication when receiving requests and adding headers to responses.
- Asynchronous Clients and Services. On the server, throughput may be increased by using less resources; releasing the initial request thread and asynchronously handling the request and when finished, reclaiming a new thread for the response. On a client, load may be decreased similarly with a request asynchronously sent, and using a Future from the Java API waiting for a response.
Marek Potociar, one of the developers in the Jersey team, has written a number of blog-posts during the two years of work and also an overview of the 2.0 release and the major changes in it.
Other sources of information include:
- Slides from a presentation made by Arun Gupta, a well-known Java evangelist at Oracle.
- Example code as part of a series of Java EE 7 articles.
Documentation / examples with Spring DI
InfoQ Sep 01, 2015