geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Wilkins <gr...@webtide.com>
Subject Re: Annotation processing
Date Wed, 13 Dec 2006 09:53:34 GMT
David Blevins wrote:
>
> I took a quick look at Jetty and Tomcat source.  Tomcat has some
> complete looking code for injection via JNDI, except it seems it only
> supports using annotations as the source of injection data, nothing for
> xml as the source.
>
> http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/DefaultAnnotationProcessor.java?view=markup
>
>
> Jetty doesn't seem to have anything in this area.  I looked for any
> references to javax.annotation and didn't find any.  Greg, any thoughts
> on what your plans are in this area?

Jan,

any thoughts on what your plans are in this area?

...

We do plan to support this, but it is rather painful and
intrusive to do.     The injecting the resources is not the problem
it is finding them that is an issue.   It appears that we must
get more involved in the classloading to find which classes should
be scanned for annotations.  The code I have seen for this has
hacky special cases of jar not to scan etc etc.

Either way, the scanning is something that in a JEE container
is something that is going to be done for other reasons and
the last thing we want is every component trying to
specialize classloading so it can separately scan all
the loaded classes.

So what we hope to provide is a mechanism to inject
(this should be done shortly) and a pluggable mechanism
for discovery of annotations.  We will have our own simple
implementation, but ideally the integration with geronimo would share
the scanning that would be occurring for EJB3 etc. etc.

What are you currently planning for EJB3 annotations?

cheers





> On Dec 12, 2006, at 4:20 PM, David Blevins wrote:
> 
>> On Dec 12, 2006, at 3:14 PM, David Jencks wrote:
>>> On Dec 12, 2006, at 1:07 PM, David Blevins wrote:
>>>>> 4. add objects to inject resources
>>>>
>>>> Here's where I get confused.  Add objects to inject resources into
>>>> what?  The confusing part is that injection is done on instances of
>>>> components (servlets, ejbs).  Maybe the Tomcat/Jetty integrations
>>>> are a lot tighter than I thought they were.  Are we actually
>>>> creating servlet and filter instances themselves?
>>>
>>> Definitely not for tomcat.  For jetty these are created by a
>>> ServletHolder, which is wrapped into a gbean, so we could modify the
>>> object creation code.  I imagine there's some similar way to
>>> customize tomcat, but I have no idea what it might be.
>>>
>>> In any case, my goal of using verbiage sufficiently general to be
>>> difficult to argue with failed :-).   I have no idea what is needed
>>> nor how to do this.  Do you have any advice?
>>
>> :)
>>
>> I have to imagine that both Jetty and Tomcat already have their own
>> code for injecting the items from JNDI using the standard names [1],
>> so if simply had some way to tell either of them which jndi names go
>> with which fields we'd be good to go.
>>
>> [1]  Granted the spec doesn't require you to inject straight from
>> JNDI, but injection was intended to be done this way when the specs
>> were written (even SessionContext is now in JNDI) and I'd be really
>> surprised if there was anyone out there doing it differently.
>>
>> I'd be interested in what Jetty and Tomcat have in this regard.
>>
> 
> I took a quick look at Jetty and Tomcat source.  Tomcat has some
> complete looking code for injection via JNDI, except it seems it only
> supports using annotations as the source of injection data, nothing for
> xml as the source.
>  
> http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/util/DefaultAnnotationProcessor.java?view=markup
> 
> 
> Jetty doesn't seem to have anything in this area.  I looked for any
> references to javax.annotation and didn't find any.  Greg, any thoughts
> on what your plans are in this area?
> 
> -David
> 
> 
> 


Mime
View raw message