[JBoss JIRA] (CDI-10) Add ability to access a bean instance from a proxy
by Bauke Scholtz (JIRA)
[ https://issues.jboss.org/browse/CDI-10?page=com.atlassian.jira.plugin.sys... ]
Bauke Scholtz edited comment on CDI-10 at 3/12/16 3:18 PM:
-----------------------------------------------------------
I understand that, but those beans are not part of public API. It's an implementation detail and not supposed to be intercepted/injected/whatever by enduser.
Arjan Tijms suggested a potential alternate solution: a producer with a package private qualifier. I will try that sooner or later. Update: it was quite convoluted and inefficient. In the end I went for "plain" protected methods along a disclaimer in javadoc.
Nonetheless, ability to unwrap the CDI proxy via native API is still much appreciated :)
was (Author: bauke):
I understand that, but those beans are not part of public API. It's an implementation detail and not supposed to be intercepted/injected/whatever by enduser.
Arjan Tijms suggested a potential alternate solution: a producer with a package private qualifier. I will try that sooner or later.
Nonetheless, ability to unwrap the CDI proxy via native API is still much appreciated :)
> 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)
8 years, 6 months
[JBoss JIRA] (CDI-10) Add ability to access a bean instance from a proxy
by Bauke Scholtz (JIRA)
[ https://issues.jboss.org/browse/CDI-10?page=com.atlassian.jira.plugin.sys... ]
Bauke Scholtz edited comment on CDI-10 at 3/12/16 11:21 AM:
------------------------------------------------------------
I understand that, but those beans are not part of public API. It's an implementation detail and not supposed to be intercepted/injected/whatever by enduser.
Arjan Tijms suggested a potential alternate solution: a producer with a package private qualifier. I will try that sooner or later.
Nonetheless, ability to unwrap the CDI proxy via native API is still much appreciated :)
was (Author: bauke):
I understand that, but those beans are not part of public API. It's an implementation detail and not supposed to be intercepted/injected/whatever by enduser.
Arjan Tijms suggested a potential alternate solution: a producer with a package private qualifier. I will try that sooner or later.
> 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)
8 years, 6 months
[JBoss JIRA] (CDI-10) Add ability to access a bean instance from a proxy
by Bauke Scholtz (JIRA)
[ https://issues.jboss.org/browse/CDI-10?page=com.atlassian.jira.plugin.sys... ]
Bauke Scholtz edited comment on CDI-10 at 3/12/16 11:20 AM:
------------------------------------------------------------
I understand that, but those beans are not part of public API. It's an implementation detail and not supposed to be intercepted/injected/whatever by enduser.
Arjan Tijms suggested a potential alternate solution: a producer with a package private qualifier. I will try that sooner or later.
was (Author: bauke):
I understand that, but those beans are not part of public API. It's an implementation detail and not supposed to be intercepted/injected/whatever by enduser.
Arjan Tijms suggested an alternate solution: a producer with a package private qualifier. I will try that sooner or later.
> 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)
8 years, 6 months
[JBoss JIRA] (CDI-10) Add ability to access a bean instance from a proxy
by Bauke Scholtz (JIRA)
[ https://issues.jboss.org/browse/CDI-10?page=com.atlassian.jira.plugin.sys... ]
Bauke Scholtz edited comment on CDI-10 at 3/12/16 11:20 AM:
------------------------------------------------------------
I understand that, but those beans are not part of public API. It's an implementation detail and not supposed to be intercepted/injected/whatever by enduser.
Arjan Tijms suggested an alternate solution: a producer with a package private qualifier. I will try that sooner or later.
was (Author: bauke):
I understand that, but those beans are not part of public API. It's an implementation detail and not supposed to be intercepted/injected/whatever by enduser.
> 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)
8 years, 6 months
[JBoss JIRA] (CDI-10) Add ability to access a bean instance from a proxy
by Bauke Scholtz (JIRA)
[ https://issues.jboss.org/browse/CDI-10?page=com.atlassian.jira.plugin.sys... ]
Bauke Scholtz commented on CDI-10:
----------------------------------
I understand that, but those beans are not part of public API. It's an implementation detail and not supposed to be intercepted/injected/whatever by enduser.
> 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)
8 years, 6 months
[JBoss JIRA] (CDI-10) Add ability to access a bean instance from a proxy
by Mark Struberg (JIRA)
[ https://issues.jboss.org/browse/CDI-10?page=com.atlassian.jira.plugin.sys... ]
Mark Struberg commented on CDI-10:
----------------------------------
I fear it does _not_ work with neither ;)
Just try it with an intercepted bean and you'll see what I mean.
> 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)
8 years, 6 months
[JBoss JIRA] (CDI-10) Add ability to access a bean instance from a proxy
by Bauke Scholtz (JIRA)
[ https://issues.jboss.org/browse/CDI-10?page=com.atlassian.jira.plugin.sys... ]
Bauke Scholtz commented on CDI-10:
----------------------------------
Perhaps not as per the spec, but it works fine in both Weld and OWB. Thanks for the heads up though, I may need to rethink the approach.
> 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)
8 years, 6 months
[JBoss JIRA] (CDI-10) Add ability to access a bean instance from a proxy
by Mark Struberg (JIRA)
[ https://issues.jboss.org/browse/CDI-10?page=com.atlassian.jira.plugin.sys... ]
Mark Struberg commented on CDI-10:
----------------------------------
Have not read through all the comments, but context.get(bean) will only give you the 'Contextual Instance', means the singleton in the context. But that might already be wrapped with an Interceptor/Decorator proxy, so you don't have guaranteed access to the native class neither :/
> 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)
8 years, 6 months