You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (Commented) (JIRA)" <ji...@apache.org> on 2011/10/12 22:01:18 UTC

[jira] [Commented] (OWB-622) beanmanager injection in afterBeanDiscovery method parameter

    [ https://issues.apache.org/jira/browse/OWB-622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126094#comment-13126094 ] 

Mark Struberg commented on OWB-622:
-----------------------------------

injecting a BeanManager as additional parameter in any lifecycle event (or any other event) is perfectly fine and we use this already in lots of extensions [1]. Maybe there is a certain specific problem which is different than what it seems at the first glance?

[1] https://svn.apache.org/repos/asf/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/GroupedConversationContextExtension.java
                
> beanmanager injection in afterBeanDiscovery method parameter
> ------------------------------------------------------------
>
>                 Key: OWB-622
>                 URL: https://issues.apache.org/jira/browse/OWB-622
>             Project: OpenWebBeans
>          Issue Type: Bug
>    Affects Versions: 1.1.1
>            Reporter: Romain Manni-Bucau
>            Assignee: Gurkan Erdogdu
>
> The problem is reading the spec we don't know if BeanManager can be injected through method parameter in producer/observer so it should probably be done.
> here an extract of an IRC conversation with more details:
> <rmannibucau> hi, is it possible to inject the bean manager in a method (like beforebeandiscovery) ?
> <bergmark> Specifically a lifecycle method, or a method in a CDI manager bean?
> <bergmark> I ask because you can certainly inject method params into methods in a managed bean.  I don't think you can add a bean manager param to your afterBeanDiscovery event listener, but I might be wrong.
> <bergmark> Spec seems to prove me wrong though :)
> <bergmark> 11.5 says that service providers can obtain an injected BeanManager
> <bergmark> Presumably as a field though, not as a parameter into the observer method.
> <rmannibucau> ah
> <rmannibucau> i ask because seams does it
> <rmannibucau> so it doesnt work with oprnwebbeans just because of it
> <bergmark> seam injects the BeanManager as a parameter of the method with @Observes?
> <rmannibucau> yep
> <rmannibucau> in solder-impl-3.1.0.Beta3
> <bergmark> Might be a bug then, its not clear to me what 11.5 means when it says "and obtain an injected BeanManager reference".  That isn't very clear about how.
> <bergmark> I just assumed it meant via an injected field in the service provider, but perhaps they intended that statment to apply to observer method injection as well inside service providers.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira