geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Annotation processing
Date Tue, 12 Dec 2006 17:46:49 GMT
I think we have a lot of work to do for annotation processing, and I  
don't recall seeing any discussion of the steps involved.  I haven't  
read most of the specs involved so what I say is probably full of  
errors, but this provides a great opportunity to correct me :-)

I think there are 2 kinds of annotations: some describe something  
about the class that is exposed to the outside world, such as  
@WebService, and some describe something supplied to the class from  
its environment, such as @Resource.   The @Resource type annotations  
result in something getting bound in the components java:comp/env  
jndi context, and then that thing getting assigned to the annotated  

I believe all of these need to be translated to the xml in the spec  
deployment descriptor and made available through jsr-77.  This is a  
pretty major change to jsr-77 since previously we were supposed to  
provide the dd unchanged as a string.

I think that there is no further information needed for the  
"exposing" annotations: once they are in the xml, we can just deploy  
from the xml and we're done.  However for the "resource injection"  
annotations, we still need some code to get the object out of jndi  
and put it into the field.

So, here's how I imagine this working:

Deploy time:

1. scan all the classes for annotations
2. process them into the xml descriptor
3. deploy from the modified xml descriptor, includiing constructing  
the jndi tree (as done currently)
4. add objects to inject resources

Run time:
start up just like we do now

So, I don't think we have any of this code in geronimo.  I suspect  
there is a bunch of simliar code in other projects such as openejb,  
openjpa, and cxf (at least)  How much can we crib from elsewhere?

Comments desperately needed :-)

david jencks

View raw message