Mitch Pronschinske is a Senior Content Analyst at DZone. That means he writes and searches for the finest developer content in the land so that you don't have to. He often eats peanut butter and bananas, likes to make his own ringtones, enjoys card and board games, and is married to an underwear model. Mitch is a DZone Zone Leader and has posted 2576 posts at DZone. You can read more from them at their website. View Full User Profile

Resin and the Web Profile are Meant for Each Other

02.19.2010
| 6958 views |
  • submit to reddit
'Lightweight' is the term that Caucho's Resin developers live by.  You won't commonly see application server developers who write low level facilities like bytecode analyzers in order to minimize their memory footprint,  but Caucho does.  As one of the few remaining independent open source organizations, Caucho is a company that's full of programmers who take a developer-centric approach when building their tools.  Emil Ong, a Caucho evangelist, recently talked to DZone about where the company has been, and where it's going.  Early on in its eleven-year history, Ong said that Resin was mainly recognized as a high-performance Servlet Container, but now it is recognized as a fully functional application server that focuses on optimizations for developer productivity.  That developer-centric mission is the reason why Caucho is enamored with the productivity enhancements in Java EE 6.  Caucho was one of the earliest adopters of the CDI (JSR 299) spec with their CanDI implementation, and now they're working on implementing the JEE6 Web Profile.

The JEE6 Web Profile specification makes it very easy for Resin to maintain it's lightweight nature and still deliver a fully standards compliant application server.  Before the introduction of Profiles, Java EE was a ballooning platform with an increasing number of APIs.  App servers would end up being very heavy in order to support all those standard APIs, and many applications didn't even use most of them.  The Web Profile, in contrast, implements a sub-set of APIs that are used most often in web development.  It leaves out certain APIs that aren't used as often in web applications such as JAX-WS, JAX-RS, and JAXB to name a few.  However, there's nothing standing in the way of a vendor who wants add the APIs and features they want, and Resin developers did choose to add a few APIs on top of the Web Profile ones.  

In previous versions of Resin, the developers chose to focus primarily on the Servlet API while still supporting an annotation-driven model in EJB 3/JPA and retaining lightweight alternatives to RMI/CORBA like Hessian.  Thanks to Profiles, Resin has been able to expand its features while maintaining a low memory footprint.  With the JEE 6 Web Profile, Caucho is providing independent implementations for managed beans, interceptors, CDI, Servlet 3/JSP and EJB 3.1 Lite.  Resin also has its own high-performance JTA compatible transaction manager, a lightweight JMS implementation, and Hessian.  On top of those core APIs, Caucho will add reference implementations for Facelets, JSF 2.0, JPA 2.0, and bean validation.

CDI (Contexts and Dependency Injection) portable extensions are another reason why Resin is lightweight.   Caucho, along with Apache and JBoss, was an early adopter of CDI, and many parts of the Resin application server itself have been written using Caucho's CDI implementation: CanDI.  Emil Ong said that it's not just an add-on to the server, but instead it is integrated throughout the server.  Caucho is considering many CDI portable extensions via CanDI.  These additions to Resin could include APIs for Struts 2, Wicket, iBATIS, Quartz and more.  CanDI could also be used to enable the use of EJB annotations like @TransactionAttribute, @Schedule, @Asynchronous, @RolesAllowed, @RunAs, @Lock, @Startup, and @Remote outside EJBs.  CanDI already includes excellent out-of-container testing support for both JUnit and TestNG.  

When people think of the most cutting-edge, fully standard application servers, Caucho wants to be mentioned alongside JBoss AS and GlassFish as a serious contender.  Currently, Resin is the only major application server that is solely focused on the Web Profile.  The new Java standard gives Caucho what they've always insisted upon - tighter control over the code to prevent bloat and keep things 'lightweight.'