[webbeans-issues] [JBoss JIRA] Commented: (WBRI-329) Move EJB injection to InjectionTarget

Pete Muir (JIRA) jira-events at lists.jboss.org
Fri Aug 7 06:35:29 EDT 2009


    [ https://jira.jboss.org/jira/browse/WBRI-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12479450#action_12479450 ] 

Pete Muir commented on WBRI-329:
--------------------------------

Ah, I missed a sentence out, I think. My suggestion is that for existing EE components (such as EJBs, servlets etc.) which the EE spec defines injection for, that Web Beans doesn't perform EE-style injection on these classes. Web Beans will only do CDI-style injection on these classes. 

CDI also allows other non-contextual instances (for example a Wicket component) and CDI style managed beans to receive EE-style injections (which no EE container supports today AFAIK). For CDI-style managed beans and other (not EE component) non-contextual instances, Web Beans would perform EE-style injection using the existing SPI.

This, to me, seems the least intrusive path to go, whilst fully supporting the spec.

As for your proposed SPI change around injection, yes I can see that the increase in flexibility offered might be useful. I would actually not limit this callback to "doEEStyleInjection", but simply make it a generic callback - inject(instance) - which can be used by any environment which wishes to perform other injection. This has come up as a requirement for JBoss AS for example. My only concern is that this places a fair amount of additional work on integrators over the simple "resolve" methods, so we need to provide a similar, simple mechanism that doesn't involve integrators having to scan the class for property and field annotations, build a caching system etc. Possibly we can make this an "either-or" approach, though that is generally an ugly semantic to express in an API.

The argument about "iterate over every field" isn't really valid, Web Beans has to examine every field anyway (for example field injection, producer fields) so there is no overhead here, and we use an optimized approach already. I doubt a container can optimize this more.

> Move EJB injection to InjectionTarget
> -------------------------------------
>
>                 Key: WBRI-329
>                 URL: https://jira.jboss.org/jira/browse/WBRI-329
>             Project: Web Beans
>          Issue Type: Bug
>          Components: Enterprise Beans, Glassfish integration
>         Environment: 1.0.0.PREVIEW2.SP2 in 7/30/09 GlassFish V3 workspace
>            Reporter: Ken Saks
>             Fix For: 1.0.0.CR1
>
>
> Currently we perform 299 style injection into EJBs via an interceptor, I would prefer to move this to use the InjectionTarget SPI.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the weld-issues mailing list