New-age Transactional Systems - Not Your Grandpa's OLTP
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Srini Penchikala on Feb 11, 2010
JavaEE 6 release includes Java API for RESTful Web Services (JAX-RS) support which provides a POJO based framework to build lightweight web services that conform to the Representational State Transfer (REST) style of software architecture. JAX-RS API, which is part of JSR 311, offers several annotations that can be used to expose Java class methods as web resources.
JAX-RS automatically translates between Java types and MIME media types. For example, if you mark a class method with annotation "@Produces (MediaType.TEXT_PLAIN)", JAX-RS would translate the Java type to the "text/plain" MIME type, which represents plain text, and return content of that type in the HTTP response to the client.
Java EE 6 includes the latest release of the technology, JAX-RS 1.1, which is a maintenance release that aligns JAX-RS with new features in Java EE 6. Jersey is the open source Reference Implementation for JAX-RS specification. Jersey 1.1.5 version implements JAX-RS 1.1.
The annotations add the information needed to identify resources and serve HTTP requests. Some of the annotations supported by JAX-RS are as follows:
Path: This annotation specifies a relative path for the resource. @Path identifies the URI path that a resource class or class method will serve requests for.
GET: The @GET annotation specifies that the annotated method handles HTTP GET requests. When a client directs an HTTP GET request to the URI for the web resource, the JAX-RS runtime invokes the annotated java method to handle the GET request.
POST: The @POST annotation specifies that the annotated method responds to HTTP POST requests.
Produces: This annotation specifies the MIME media types that the methods in the resource can produce and return to the client.
Consumes: The @Consumes annotation specifies the MIME media types that the methods in the resource can accept from the client. As is the case for the @Produces annotation, if you specify @Consumes on a class, it applies to all the methods in the class. If you specify @Consumes on a method, it overrides the MIME type in any @Consumes annotation that you specify for the class.
JAX-RS also has other convenient features like parameter-based annotations that can be used to extract information from a request. One of these annotations is @QueryParam, which can be used to extract query parameters from the Query component of a request URL. Other parameter-based annotations are @MatrixParam, which extracts information from URL path segments, @HeaderParam, which extracts information from HTTP headers, and @CookieParam which extracts information from the cookies declared in cookie-related HTTP headers.
There are also a number of utility classes and interfaces that further simplify actions related to building and using RESTful web services in Java. Some of these classes include:
RESTEasy framework from JBoss is another implementation of the JAX-RS specification. Apache's open source services framework CXF will also provide support for JAX-RS 1.1 as part of their version 2.3 release.
Srini Penchikala currently works as Security Architect and has 17 yrs of experience in software product management.
Improve Java Garbage Collection, Runtime Execution, and JVM visibility with Zing
Getting Started with Stratos - an Open Source Cloud Platform
Using Drools? See what you're missing! Get the Power of Drools with the Assurance of Red Hat
Monitor your Production Java App - includes JMX! Low Overhead - Free download
18 agile and lean practices for effective software development governance
We have recently implemented REST services using Jersey. Was curious if there are any distinct features in Java EE 6 Rest Support which are not in Jersey.
Hi Srini,
As you are listing some JAX-RS implementations, I'd like to mention that Restlet also has an extension supporting JAX-RS. Restlet (www.restlet.org) was the first framework truly designed with REST in mind when it launched in 2005.
The framework also comes with its own Restlet API, which has a much broader features scope and a more balanced design not focused on annotation-driven programming. We do support annotations in Restlet API 2.0, but in a lighter way. Otherwise, the Restlet API is a regular class-driven API, easy to use, test, extend and embed.
Please check this page for additional features:
www.restlet.org/about/features
The Restlet Framework is provided in five consistent editions:
- Java SE
- Java EE
- Android
- Google App Engine
- Google Web Toolkit
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Technical Lead ~ www.restlet.org
Noelios Technologies ~ www.noelios.com
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.
Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.
Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).
Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.
Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.
2 comments
Watch Thread Reply