Java Reference
In-Depth Information
tion to indicate their URI, and a set of annotations are provided that map to each of the HTTP
methods ( @GET , @PUT , etc.).
Jersey
The Jersey project is Sun's reference implementation of JAX-RS 1.0. The project aims primar-
ily to make it easy for REST developers to build web services using Java. Jersey is also sched-
uled to ship within Glassfish and will be formally incorporated as a standard part of the Java
EE platform in Java EE 6.
Jersey also provides support for Spring and Google Guice.
NOTE
While Jersey provides a client API, this is notpart of the JAX-RS specification.
RESTEasy
This is a JBoss project that implements JAX-RS. RESTEasy is portable (it runs in any servlet
container) and provides a client API that allows you to map outbound HTTP requests to re-
mote servers with JAX-RS annotations.
The project also provides a RESTful facade to JMS, which is very interesting.
You can get RESTEasy from http://wiki.jboss.org/wiki/RESTeasyJAXRS .
RESTpack
The open source Mule ESB ( http://www.mulesource.org ) also distributes Jersey within its
RESTpack download. It provides connectors for Jersey, Restlet, and Apache Abdera (which
is an implementation of the Atom Publishing Protocol) to help you get REST applications go-
ing.
REST in Java
In the last section, we noted a few examples of REST framework implementations. These
frameworks are useful in jump-starting your applications, and we'll look at JAX-RS rather
closely in this chapter. Because REST is an architectural style, you don't need a framework to
use it, and just because you're using a framework doesn't mean you're adhering to the prin-
ciples.
Search WWH ::




Custom Search