[JBoss JIRA] (CDI-714) No way to access the underlying bean in a producer when using BeanConfigurator

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[JBoss JIRA] (CDI-714) No way to access the underlying bean in a producer when using BeanConfigurator

JIRA issues@jboss.org

    [ https://issues.jboss.org/browse/CDI-714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457947#comment-13457947 ]

Martin Kouba commented on CDI-714:
----------------------------------

That's a good point. However, note that configurators were not designed to completely replace the original methods and to cover every possible case but to help with most common tasks. In this case, it seems the only way to use the {{getInjectableReference()}} workaround would be to lookup the bean inside the callback function.

> No way to access the underlying bean in a producer when using BeanConfigurator
> ------------------------------------------------------------------------------
>
>                 Key: CDI-714
>                 URL: https://issues.jboss.org/browse/CDI-714
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>            Reporter: John Ament
>
> I was reusing an example the Weld guys pointed me at.  
> {code}
> InjectionPoint ip = (InjectionPoint)bm.getInjectableReference(new EmptyInjectionPoint(be...), cc);
> {code}
> The problem is that I'm using the configurator to create the bean, and the resulting function for the producer doesn't have access to the bean that was created.
> {code}
> abd.addBean()
>                     .addQualifiers(new ClaimLiteral("", Claims.UNKNOWN))
>                     .addType(type)
>                     .scope(Dependent.class)
>                     .createWith(ClaimProducer.INSTANCE);
> {code}
> So because of this, I have no way to get the injection point.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.