Tim McConnell wrote:
Hi, I still think there needs to be a general consensus for the handling
of annotations in Geronimo. So, to better explain this design proposal I've
created a few simple UML diagrams that demonstrates how it might work
with one of the Geronimo builders--i.e. Tomcat.
Here's the link to the URL diagrams:
http://cwiki.apache.org/GMOxDEV/jsr-88-12.html
-- The first is just a diagram of the pertinent high-level use cases for
JSR-88 1.2
-- The second is an interaction diagram of deployment at a very
high-level as it currently works for Tomcat
-- The third is the proposed interaction diagram of how deployment will
generally flow with annotations. Namely:
-- Geronimo will find/discover all the annotations in the
artifact being deployed prior to the createModule invocation on the
TomcatBuilder
-- Geronimo will then update the deployment descriptor tags in
the XML accordingly and then set the Metadata-Complete tag
-- Finally, during installation of module, Geronimo will invoke
Tomcat's AnnotationProcessor implementation and pass it the array of
annotations that have been discovered, and Tomcat's AnnotationProcessor
will handle handle those runtime-type annotations (e.g., PreDestory,
PostConstruct, etc...) without corresponding deployment descriptor tags.
Note also that Tomcat's AnnotationProcessor handles the resource
injection as well.
-- The fourth is just a class diagram (not yet complete) that shows the
new Geronimo annotation classes
This looks like a good approach to me for Tomcat given that they have
their own AnnotationProcessor implementation.
Questions:
-- Is this a pattern that can be consistently used for other builders as
well like Jetty, Axis, OpenEJB, Web Services, etc ??
-- Is it reasonable to assume that these other components will have
their own AnnotationProcessor implementation (like Tomcat) that can be
invoked by Geronimo during deployment ??
I don't know enough about the plans to support annotations for these
other components to give you the answer your looking for. Based upon
your investigation does it seem plausible that Jetty, Axis, etc.. will
support annotations in the same way via implementing their own
AnnotationProcessor? In either case, perhaps it would be best to
assume this approach for now so that we can integrate annotation support
for Tomcat and then determine if we need to re-evaluate the overall
structure later based upon the other components.
Thanks for digging into this Tim!
Joe