[cdi-dev] [JBoss JIRA] Commented: (CDI-117) Add BeanManager to a ServletContext attribute
dan.j.allen at gmail.com
Mon Apr 25 17:37:50 EDT 2011
We have explored a similar ServiceLoader approach in Solder, for reference.
(Pardon the reminder if I already cited it).
Here's the implementation that puts the BeanManager in the ServletContext.
It's easy for the spec to say "you should never have to lookup the
BeanManager as you should always be able to use dependency injection."
However, the reality is, we have to adopt to the world around us. Thus,
standardizing this API would be fantastic.
On Mon, Apr 25, 2011 at 15:23, Rick Hightower <richardhightower at gmail.com>wrote:
> Andy Gibson, Rob Williams and I, implemented something like this for
> It works with Weld, OpenWebBeans and Candi.
> We have a BeanContainerManager that uses java.util.ServiceLoader.
> I think in addition to the ability to easily load a BeanManager, we need a
> simplified interface for dealing with beans. BeanManager is a bit at the SPI
> level. It needs a Facade to make it easier to use.
> Compare the BeanManager to the Spring's Application Context. I think the
> BeanManager should be more like the Spring Application Context.
> for some ideas see:
> The Spring integration piece that I wrote tries to find the BeanManager in
> JNDI and then uses the Service Locator if it does not find it in JNDI.
> I think it would be nice if there was a BeanManagerFactory that looks up
> first using JNDI, then uses a Service Locator if it can't find it in JNDI.
> Ok it is not the exact behavior, but I know what you are taking about:
> On Mon, Apr 25, 2011 at 12:38 AM, Pete Muir (JIRA) <
> jira-events at lists.jboss.org> wrote:
>> Pete Muir commented on CDI-117:
>> Cloves please file an issue for your approach.
>> > 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
>> > 
>> 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
> *Rick Hightower*
> (415) 968-9037
> Profile <http://www.google.com/profiles/RichardHightower>
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cdi-dev