There were a few of us that wanted to push back on the WebTier EG around
annotation support over the fact that there wasn't a clear API
provided-- yet oddly enough, everyone is ending up with basically the
same API :-)
My hope is that the WebBeans JSR can bring some solidarity around this
through an injection API which other 'legacy' APIs can simply defer to
(Similar to ELResolver).
It is tricky from a JSF standpoint, especially with session clustering--
but would WeakReference with your own ReferenceQueue fix this problem of
associating the @PreDestroy event?
-- Jacob
Remy Maucherat wrote:
Bernd Bohmann wrote:
The AnnotationProcessor/InjectionProvider are very similar. I don't
like to define a new myfaces Interface for this use case. I would
prefer the org.apache.AnnotationProcessor because is not tomcat
specific and an apache implementation. Until we find a final solution
we should only copy the code.
I just had a look at InjectionProvider, and somehow the API is
identical to AnnotationProcessor. It did not start that way, and I did
not look at InjectionProvider at all (so I suppose it means the API
makes sense :D). The interface is used by Catalina (the Servlet
container) and also Jasper (Jasper gets the implementation using a
specific context attribute).
Unfortunately, I don't see a way to do non proprietary
annotation/injection processing, since the component that has to do it
(JSP or JSF) cannot possibly get the configuration (which could define
overrides, etc). Since I suppose you'll want to support all
containers, that's a problem. (It would have been solved if the
servlet spec had defined an interface like InjectionProvider in
javax.servlet, of course.)
It's no problem to use the annotation name instead of using the
class. But personal i prefer the class.
Rémy