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

Stephan Knitelius (JIRA) issues at jboss.org
Wed Nov 11 16:30:00 EST 2015

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

Stephan Knitelius commented on CDI-10:

I believe this is also an issue with Vaadin CDI integration. 

At the moment all Vaadin UI components are not allowed to have a normal scope since Vaadin cannot handle CDI proxies.

Vaadin CDI has solves this, at the moment by providing all supported scopes once as  normal  scope and once as pseudo scoped. 

JavaDoc from @NormalViewScoped:
 * You cannot use this scope with Vaadin Components. Proxy Components do not 
 * work correctly within the Vaadin framework, so as a precaution the Vaadin
 * CDI plugin will not deploy if any such beans are discovered.

> 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
> 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

More information about the cdi-dev mailing list