Message-ID: <279764285.6139.1369546753641.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_6138_521970040.1369546753641" ------=_Part_6138_521970040.1369546753641 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Pitchfork is an add-on for the Spring Framework performing JSR-250 depen= dency injection, annotation processing and EJB 3.0-style interception, deve= loped jointly by Interface21 and BEA Systems.
It is simple to use in conjunction with Jetty.
At the time of writing, the integration with Pitchfork is checked in to = jetty svn trunk, but will be released with 6.1.0 final. Until then, it will= be first necessary to checkout and buil= d jetty.
Once jetty is built, make a new directory:
ing. Copy the jar from
into it. Also copy all of the jars from the Pitchfork download into it.
The JEE tutorial from Sun will take you th= rough how to create EJB3 classes.
Here's an extremely simple example of a stateless session bean showing s= ome of the JEE-style annotations:=20
We would declare this class in a
META-INF/spring-ejb-jar.xml file. That file can reside in a jar if you're packaging your ejbs into ja=
rs, or you can make a
WEB-INF/classes/META-INF/ directory if y=
our ejbs are just part of your webapp.
The spring-ejb-jar.xml file for the above bean looks like:
Next, you can make some classes that use @EJB notation to inject referen=
ces to your beans. Here's another stupidly simple class that uses the
In order to have Pitchfork notice that the
com.acme.EchoTest class wants a reference to the
com.acme.EchoBean ejb, we dec=
lare it in the Spring
Notice the very important second line with id jeeEjbPostProcesso= r. This line tells Pitchfork to look at all other <bean> dec= larations and perform any necessary resource injections on them.
To complete the webapp, here's a trivial jsp:
When you deploy it and surf to it, you'll see something like this:
Hello Thu Dec 07 12:14:16 CET 2006
A maven project that builds a deployble webapp for the example we've bee= n looking at is attache= d to this page.------=_Part_6138_521970040.1369546753641--