users@javaee-spec.java.net

[javaee-spec users] [jsr342-experts] Re: Proposal for global CDI enablement

From: Pete Muir <pmuir_at_bleepbleep.org.uk>
Date: Thu, 20 Dec 2012 10:43:11 +0000

On 20 Dec 2012, at 01:22, Bill Shannon wrote:

> Pete Muir wrote on 12/19/12 04:57:
>>> I wouldn't want the container to know the name of beans.xml, nor the schema
>>> of beans.xml. I hope the container asks Weld to "load the configuration
>>> information for this module" and Weld does all the detection of beans.xml,
>>> parsing, etc., and then after that is prepared to answer the container's
>>> question of "what level of scanning do I need to do for this module?"
>>
>> Kinda, except that it's the container responsibility to load the beans.xml
>> file. There is no portable scanning api in Java/Java EE to allow us to detect
>> such files.
>
> Wouldn't the container just need to export a "getResource" method that
> Weld can use, if Class.getResource isn't good enough?
>

No, WEB-INF/beans.xml is not on the classpath, you must do a Jar level scan.

Anyway, we can review this architecture, it should really move to weld-dev_at_lists.jboss.org though for any discussions.

I personally like the architecture we have today, and have had no complaints from integrators about this approach.