InfoQ

News

Pitchfork: EJB 3 Interception & Injection to WebLogic using Spring

Posted by Floyd Marinescu on May 23, 2006 04:04 PM

Community
Java
Topics
JCP Standards ,
AOP ,
Transactions Processing
Tags
Spring ,
BEA ,
EJB ,
WebLogic
Last week it was announced that the EJB 3 implementation in the BEA WebLogic EJB 3 Tech Preview was being built with Spring, using a joint project called Pitchfork, led by Spring framework founder Rod Johnson and WebLogic core engineer Michael Chen. The use of Spring to do injection and interception, as well as the integration with Kodo allowed BEA to get its Tech Preview out faster. Pitchfork can also be re-used by other appserver vendors or open source projects that want to offer EJB 3 interception and dependency injection.

Pitchfork will be released under Apache license and is available for download. InfoQ spoke with Rod Johnson recently about the project and got more details about the project's internals and what it might mean for the community.

The project builds on the Spring IOC container to deliver the @Resource style injection in JSR 250 as well as lifecycle implementations. It also provides EJB-style interception, done with Spring AOP.  In the solution, every EJB corresponds to a Spring bean definition which is extended with a new JSR 250 metadata object.  The role of the WLS container when it starts up is to create a Spring container with the additional metadata. Then when it wants to get an EJB instance it asks the Spring container which injects the EJB with the metadata it needs as well as sets up any interception required. 

According to Rod:
Spring effectively delivers the delta between EJB 2 and EJB 3 (other than the persistence). All the existing stuff that was in EJB 2 such as transaction management, etc, BEA is doing using WebLogic code.  But the actual bean instance benefits from Spring backed services. The WebLogic EJB container thus internally uses the Spring container internally to do its injection and interception.
An important side benefit for BEA WebLogic users will be the ability to go beyond the EJB spec with extensions provided by Spring, such as full use of Spring AOP and AspectJ integration, and more advanced DI capabilities, all while maintaining portability of your code, as  demonstrated by Christian Dupuis.

Pitchfork is not specifically tied to WebLogic, and could also be used with a JPA provider on Tomcat to get much of the EJB 3 complete programming model.  However, according to Rod, such an integration wouldn’t be compliant, Pitchfork is meant to be used in the context of an application server.  

It is likely that other appserver vendors or open source containers such as OpenEJB (used by Geronimo) will also be looking at using Spring to speed up their own EJB 3 support.
Good stuff... keep it coming by Rick Hightower Posted May 24, 2006 5:07 PM
There is a good thread on this on Matt's blog by Rick Hightower Posted Jun 1, 2006 12:27 AM
There is now a really good FAQ on the Spring site on project PitchFork... by Rick Hightower Posted Jun 1, 2006 12:30 AM
Re: There is now a really good FAQ on the Spring site on project PitchFork. by Rick Hightower Posted Jun 1, 2006 12:32 AM
  1. Back to top

    Good stuff... keep it coming

    May 24, 2006 5:07 PM by Rick Hightower

    My response: http://www.jroller.com/page/RickHigh?entry=infoq_project_pitchfork_ejb3_support

  2. Back to top

    There is a good thread on this on Matt's blog

    Jun 1, 2006 12:27 AM by Rick Hightower

    http://www.jroller.com/page/raible?entry=ejb3_running_in_tomcat_as#comments

  3. The FAQ has things that are no where else. I shed a lot of light on project PitchFork for me. http://www.interface21.com/pitchfork/pitchfork-faq.html "We have not changed our views, for example, on the EJB 3 interception model, which fails to achieve any of the goals of true AOP and is, in our opinion actively bad, as it is both invasive and weak." 1 "We believe that any statements to the effect that "EJB 3 can substitute for Spring" are a false play. A cosmetic revision of the EJB spec, which fails to address many fundamental issues in that spec, discussed in numerous places, does not invalidate the world's most popular application programming framework, which is arguably used today much more widely than EJB." 1 Rick Hightower (linked in),blog JSF, Spring, and Hibernate training and consulting

  4. When I wrote: I shed a lot of light on project PitchFork for me. I meant: It shed a lot of light on project PitchFork for me.

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.