Hi, I've attached a patch and two new classes to the GERONIMO-2816 JIRA
that provides support for the @EJB and @EJBs
annotations if anyone would like to review. The intent is to demonstrate a
final/permanent technique that can be extended and used throughout Geronimo
to support annotations for JSR-88. This patch and new code works for Tomcat
and circumvents the annotation processing that is currently in
EjbRefBuilder (which did not update the deployment descriptor with the
discovered annotations, but only updated the JNDI references). I'd
appreciate some feedback before I start propagating this technique to the
other module builders to support the remainder of the annotations. I
already have another subclass ready to support the @Resource annotations
but I didn't want to include it in this example since it doesn't
demonstrate anything different than the EJBAnnotationHelper subclass, and
I'd like to get some feedback first on the the technique. The general
technique, which we've discussed before, is pretty straightforward and is
summarized here for reference:
1 -- Discover the annotations: I had hoped that we could centralize the
discovery of annotations in the Deployer class prior to the createModule
phase of deployment, but as David Blevins pointed out this is almost
impossible. So it has to be pushed down into the installModule phase of
deployment after the necessary classloader(s) and module context(s) have
been established (see the changes for AbstractWebModuleBuilder for an
example).
2 -- Process the annotations: This just means to update the existing
deployment descriptor (or create a new one) with the discovered annotations.
3 -- Set metadata-complete in the deployment descriptor to prevent repeated
processing of annotations (see the EjbRefBuilder changes for an example)
4 -- Update the deployment descriptor in the module so that it can flow
through the remainder of the deployment process much as before (for JNDI
naming and resolution, and to remain with module in support of the JSR-77
requirements for management).
--
Thanks,
Tim McConnell
- GERONIMO-2816 patch Tim McConnell
-