[JBoss JIRA] Commented: (CDI-10) Add ability to access a bean instance from a proxy
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/CDI-10?page=com.atlassian.jira.plugin.sys... ]
Stuart Douglas commented on CDI-10:
-----------------------------------
Say we have a bean:
@SessionScoped
class MyBean {
private String field;
}
It may be that a portable extension needs to read the value of field, but atm that is not possible, as the proxies field will be read instead. I propose that we allow something like this:
MyBean proxy = injectedProxyInstance;
MyBean underlying = ((BeanProxy)injectedProxyInstance).getUnderlyingBean();
I am not really sure that this is such a good idea any more, but this was the original intent.
> 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: TBD
>
>
> 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 is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months
[JBoss JIRA] Updated: (CDI-74) State explicitely that Decorators
by Pete Muir (JIRA)
[ https://issues.jboss.org/browse/CDI-74?page=com.atlassian.jira.plugin.sys... ]
Pete Muir updated CDI-74:
-------------------------
Summary: State explicitely that Decorators (was: State explicitely that Decorators and Interceptors of must be implemented via subclassing)
Description:
Subclassing should be mandatory for Decorators of managed beans which are not session beans (no restrictions in the case of the latter).
This ensures that:
- fields on pseudo scoped managed beans are accessible
- there's no restriction on what kinds of constructors may a managed bean have
- no extra bean instances are created when a managed bean is created
was:
Subclassing should be mandatory for Decorators and Interceptors of managed beans which are not session beans (no restrictions in the case of the latter).
This ensures that:
- fields on pseudo scoped managed beans are accessible
- there's no restriction on what kinds of constructors may a managed bean have
- no extra bean instances are created when a managed bean is created
Component/s: (was: Interceptors)
> State explicitely that Decorators
> ---------------------------------
>
> Key: CDI-74
> URL: https://issues.jboss.org/browse/CDI-74
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Decorators
> Affects Versions: 1.0
> Reporter: Marius Bogoevici
> Fix For: TBD
>
>
> Subclassing should be mandatory for Decorators of managed beans which are not session beans (no restrictions in the case of the latter).
> This ensures that:
> - fields on pseudo scoped managed beans are accessible
> - there's no restriction on what kinds of constructors may a managed bean have
> - no extra bean instances are created when a managed bean is created
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months
[JBoss JIRA] Updated: (CDI-18) Global enablement of interceptors, decorators and alternatives
by Pete Muir (JIRA)
[ https://issues.jboss.org/browse/CDI-18?page=com.atlassian.jira.plugin.sys... ]
Pete Muir updated CDI-18:
-------------------------
Summary: Global enablement of interceptors, decorators and alternatives (was: cleanup Bean Archive behaviour (BDA) of interceptors, decorators and alternatives)
> Global enablement of interceptors, decorators and alternatives
> --------------------------------------------------------------
>
> Key: CDI-18
> URL: https://issues.jboss.org/browse/CDI-18
> Project: CDI Specification Issues
> Issue Type: Feature Request
> Components: Beans, Decorators, Interceptors, Packaging and Deployment
> Affects Versions: 1.0
> Reporter: Mark Struberg
> Priority: Critical
> Fix For: TBD
>
>
> Currently the spec defines that <interceptors>, <decorators> and <alternatives> affect only the Bean Archives where they are configured in (via beans.xml).
> Thus if you e.g. enable an Alternative in a WEB-INF/beans.xml, it does NOT count for the jars in it's WEB-INF/lib folder!
> This is pretty unhandy because you would need to repackage all your jars in your WEB-INF/lib folder and add/expand the <alternatives> sections in their beans.xml.
> Needless to say that this is not only hard to do in a company build but is also impossibly to handle at deploy time in an OSGi environment!
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months