[cdi-dev] [JBoss JIRA] Commented: (CDI-117) Add BeanManager to a ServletContext attribute
abien at adam-bien.com
Mon Apr 25 03:18:25 EDT 2011
It would also make the integration with APIs like JAX-RS easier.
On 25.04.2011, at 03:33, Cloves Almeida (JIRA) wrote:
> [ https://issues.jboss.org/browse/CDI-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597712#comment-12597712 ]
> Cloves Almeida commented on CDI-117:
> This is very useful for non-servlet environment (plain JavaSE, or frameworks like Play! that does not use Servlet).
> Wouldn't it be better if the spec specified a "BeanManagerFactory" factory class that could return the proper BeanManager regardless of environment? Implementation would check JNDI, then Servlet Context, then fallback on singleton or custom lookup service.
> CDI is just too useful to be constrained on JEE/Servlet only environments.
>> Add BeanManager to a ServletContext attribute
>> Key: CDI-117
>> URL: https://issues.jboss.org/browse/CDI-117
>> Project: CDI Specification Issues
>> Issue Type: Feature Request
>> Components: Java EE integration
>> Affects Versions: 1.0
>> Reporter: Christian Kaltepoth
>> Priority: Minor
>> CDI 1.0 defines a JNDI lookup as the standard way to obtain the BeanManager for resources not managed by the CDI environment. However in a servlet environment it would be much easier to get the BeanManager from a standardized servlet context attribute. This would be also a major simplification in environments that don't support JNDI (for example GAE) or that don't allow to use the standard JNDI name for the BeanManager (for example Apache Tomcat).
>> This topic was already discussed on weld-dev about a year ago . Weld 1.0 already supports this  and OpenWebBeans also added this feature . Unfortunately Weld 1.1 changed the attribute to a Weld-specific name in  which currently leads to much confusion .
>> As both of the major CDI implementations support this feature I think it should finally be put into the spec.
>>  http://lists.jboss.org/pipermail/weld-dev/2010-March/002359.html
>>  https://issues.jboss.org/browse/WELD-202
>>  https://issues.apache.org/jira/browse/OWB-360
>>  https://jira.jboss.org/browse/WELD-679
>>  http://seamframework.org/Community/GettingBeanManagerFromServletContextWithWeld11
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
More information about the cdi-dev