[cdi-dev] [JBoss JIRA] (CDI-10) Add ability to access a bean instance from a proxy

Antoine Sabot-Durand (JIRA) issues at jboss.org
Tue Sep 6 10:47:01 EDT 2016


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

Antoine Sabot-Durand commented on CDI-10:
-----------------------------------------

During F2F meeting 2016, we discussed addition of methods to Beabmanager retrieve the Bean, Contextual instance and original class for a given instance.
Solution should be retrieving the Bean from an instance. Bean provides class, and allows context lookup to retrieve the contextual instance.

> Add ability to access a bean instance from a proxy
> --------------------------------------------------
>
>                 Key: CDI-10
>                 URL: https://issues.jboss.org/browse/CDI-10
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Beans
>    Affects Versions: 1.0
>            Reporter: Stuart Douglas
>             Fix For: 2.0 (discussion)
>
>
> There are occasions when it would be useful to access a bean instance directly from a proxy. This could be achieved by making all proxies assignable to an interface (say BeanProxy) that provides a getBeanInstance() method. 
> Client code that needs access to the actual instance can check if the object is assignable to the BeanProxy interface and then call getBeanInstance() to get the actual instance if required.
> This is something that is probably more useful to extension writers than the end user, but there have already been a few requests on the weld forum about this so it is probably worth considering.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the cdi-dev mailing list