Pitchfork: EJB 3 Interception & Injection to WebLogic using Spring
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
There is a good thread on this on Matt's blog
There is now a really good FAQ on the Spring site on project PitchFork...
"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."
"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."
Rick Hightower (linked in),blog
JSF, Spring, and Hibernate training and consulting
Ruslan Meshenberg Sep 21, 2014