David Jencks wrote:
I personally think the AnnotationProcessor is a very questionable idea
and hope no one uses it. However, it is pretty common now. The point
of the adapter is to show that tomcat can still support people who want
to integrate via something like AnnotationProcessor. I certainly don't
think tomcat should be using a AnnotationProcessor wrapped in a
LifecycleProvider. I was basically trying to show that tomcat could
work through an interface like LifecycleProvider, and that it would
provide uniformity that is currently lacking, not trying to show a
great new implementation of the interface.
-- a little history and context --
I work on geronimo, and I started by getting annotation/injection
support to work on our app client container and jetty integration, using
some ideas I cribbed from OpenEjb and Xbean. With all of these projects
it was a really natural fit to have an object creation service that,
when given a class name, handed you back a fully baked object. The code
tended to get simpler and more straightforward. Then I looked at
MyFaces and realized that they could also simplify their code by using
an object creation service where you say
getLifecycleProvider().newInstance(className);
rather than continual repetition of
Object o = clazz.newInstance();
getAnnotationProcessor().inject(o);
getAnnotationProcessor().postConstruct(o);
At this point, I don't like the patch much either. I am not convinced by
the proposed API (and the idea of an API change in 6.0.x) which is a bit
more intrusive (a LifecycleProvider now would have to be given to Jasper
for it to work), and how it is better than the "continual" (but
explicit; quotes because it doesn't exactly happen that often)
repetition where it does matter (as far as I can tell, not all the
objects that may be instantiated may be annotated).
At least one RI in JEE land (JSF) has independently adopted the same
AnnotationProcessor interface that is in use in Tomcat. I see you like
the LifecycleProvider API better, but are there really things you cannot
do (or are hard to do) with the AnnotationProcessor API ? That would be
the bar that would have to be cleared IMO to justify a change.
They agreed.
Then I looked at Tomcat. I found that there was a lot of attention paid
to all sorts of things such as security settings and whether the class
was in tomcat for servlets, but no such attention paid for filters or
listeners. I wondered if this was an oversight.... I guess I should
Tomcat does not ship security sensitive filters and listeners, but has
some funny servlets. For sure I will not want to be performing all these
expensive checks for all instantiations, such as tags.
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]