JAX-RS 2.0 and Bean Validation 1.1 First Java EE 7 JSRs to Win Public Approval
Java Enterprise Edition version 7 is well under way. Late last month JSR 339 and JSR 349 were adopted by public review ballot, making them the first two JSR's to be ratified.
Oracle's JCP Program Office identifies the full Java EE 7 JSR feature list as:
- JSR 107: JCACHE - Java Temporary Caching API
- JSR 236: Concurrency Utilities for Java EE
- JSR 338: Java Persistence 2
- JSR 346: Contexts and Dependency Injection 1.1 for Java EE
- JSR 352: Batch Applications for the Java Platform
- JSR 349: Bean Validation 1.1
- JSR 339: JAX-RS 2.0: The Java API for RESTful Web Services
InfoQ spoke to Marek Potociar, JSR 339 co spec lead about the latest version of the RESTful Java API.
Hi Marek. It looks like JSR 339 is nearing completion, and the public review has been accepted. Can you summarize the current status?
The major features (such as the client API, asynchronous server side, filters and interceptors) are already quite stable. We're still looking into polishing the details of the API, in the areas such as common configuration, link and hypermedia support or common processing exception hierarchy. Recently we decided to align our release schedule with the release of the BeanValidation 1.1 specification so that we're able to support BeanValidation integration as part of JAX-RS 2.0 release. With the change in schedule we're now also thinking about including support for the JSON Processing API (JSR 353) since JSON is together with XML a widely used media type supported by many existing RESTful services. These two are the only new major feature areas that are not fully fleshed-out yet.
As a successor to JSR 311, the original RESTful Java Spec, JSR 339 has some big shoes to fill. How do you feel about the current state?
Overall, we're happy about how much we were able to achieve in the release both in terms of new features as well as in terms of clarifying the existing API and features. We're already looking forward to releasing the final JAX-RS 2.0 version as part of the Java EE 7 release.
What will JSR 339 add to the equation for Restful Web Service Java developers?
Many of the newly standardized features were earlier provided as proprietary extensions to JAX-RS frameworks (client API and request/response filtering are good examples). While these extensions are still being used heavily by RESTful Java developers, the portability of the resulting code suffers somewhat. The new additions to JAX-RS API can be leveraged by developers to write more portable code using a set of standard APIs.
Were you able to include everything originally scheduled?
All the truly important features were included. Also, while working on JAX-RS 2.0, we made several additions to the initially scheduled feature set. As for the features that did not get in, over time we decided to drop or defer those where we felt the EG would not be able to reach a good consensus or where we needed to spend more time experimenting with proprietary APIs before we were ready to come up with a standard solution. From the major features we decided to defer tighter integration with JSR 330 (Dependency Injection), high-level client API and MVC View template frameworks integration.
Is there any hope for other languages or platforms to leverage this rich framework?
Platform-wise, the JAX-RS specification is part of Java EE, but is not as tightly coupled with the Java EE application server as other specs such as EJB. Many JAX-RS implementations, including the reference implementation provided by Jersey, can run directly on a Java SE light-weight HTTP server or any other HTTP container, such as Grizzly. Similarly, most JAX-RS frameworks are able to integrate with and run in a Servlet container. The deployment of JAX-RS applications is therefore very flexible.
Of course consuming a RESTful service, whether it is written using JAX-RS or any other framework, is language independent. There are currently no plans to port JAX-RS to other languages, so for now it remains true to its name and is strictly a Java API.
What are the next steps, will there be a next generation JSR, if so what features would be included?
After JAX-RS 2.0 is out the door, we will be collecting community feedback and may decide to do a 2.1 maintenance release within a year or so of the 2.0 release. We have also already started collecting ideas for the next major JAX-RS release. That's a mid-term plan.
All of the remaining Java EE 7 JSRs are either in "Public Review" or scheduled to complete the "Early Draft Review" stage shortly. To keep abreast of the latest status of all of the Java EE 7 JSR's, please refer to the JCP Java EE 7 JSR Blog.
Uwe Zdun, Rafael Capilla, Huy Tran, Olaf Zimmermann Mar 09, 2014
Olav Maassen, Liz Keogh & Chris Matts Mar 08, 2014