Many developers have asked about the relationship between JAX-RS (Java API for Restful Web Services) and Enterprise JavaBeans. The good news is that in Java EE 6, session beans can be implemented as JAX-RS resource or provider classes. The two work very well together thanks to JAX-RS flexibility in handling many kinds of resource classes, the EJB 3.1 no-interface view, and the ability to package enterprise beans directly in a .war.

One simple class functions as both a full-fledged JAX-RS resource and a stateless or singleton session bean. It can take advantage of all JAX-RS and EJB 3.1 functionality, including injection of JAX-RS context information, container-managed transactions, simple access to other managed EE resources such as JPA persistence contexts, etc.

See Paul Sandoz's blog for more details and a pointer to an early access implementation.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by Ken Saks