On Apr 4, 2007, at 2:12 AM, Manu George wrote:
Hi,
Is dependency injection/annotation processing in Interceptors
working? If so which class is the code in?
It's not working just yet. The trick is that the interceptor shares
the JNDI ENC of the bean, which would mean that the JNDI ENC
resulting from processing the Interceptor's annotations would have to
be added to the JNDI ENC of every bean that that interceptor may be
used on, only we don't fully process interceptor bindings till far
after the JNDI ENC info objects are created.
We have two flavors of choices as far as I can see. We either add
some kind of logic to figure out which interceptors apply to a bean
and then process it's annotations over and over again into the jaxb
jndi section of each affected bean -- that would be a real pain and
hard to follow. Or we just give each Interceptor it's own JNDI ENC
anyway and follow a simple "check the bean's enc first, then check
the interceptors enc if we didn't find it in the bean enc" type of
algorithm when we inject on the interceptor instance.
The second one would be my choice. Main reason being one of the
things that will likely be added to the next EJB spec is ejb-jar
scoped JNDI (just as we have in our JIRA) and the injection algorithm
of "first bean-scoped enc, then ejb-jar-scoped enc" will have to be
added anyway.
-David