BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News RESTful Web Services Framework Jersey 2.0 Released, Implementing JAX-RS 2.0 Specification

RESTful Web Services Framework Jersey 2.0 Released, Implementing JAX-RS 2.0 Specification

Leia em Português

Lire ce contenu en français

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.

Jersey 2.0 is a major refactoring which has resulted in many incompatibilities between 1.x and 2.0. The team has therefore added a section on migration in the documentation.

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.

The team has switched to git as primary VCS and moved the project repository to GitHub, with a hope that this will simplify contribution from the community to the project.

Rate this Article

Adoption
Style

BT