[cdi-dev] Scope of what bean archives an extension applies to

Pete Muir pmuir at redhat.com
Mon Mar 10 07:25:51 EDT 2014


The only real reference is 11.5

"The container instantiates a single instance of each extension at the beginning of the application initialization process and maintains a reference to it until the application shuts down. The container delivers event notifications to this instance by calling its observer methods.

For each service provider, the container must provide a bean of scope @ApplicationScoped and qualifier at Default, supporting injection of a reference to the service provider instance. The bean types of this bean include the class of the service provider and all superclasses and interfaces.”

This is a known place in the spec where more detail should be provided and there should be a (number of) open CDI issue(s).

On 24 Feb 2014, at 10:09, Antoine Sabot-Durand <antoine at sabot-durand.net> wrote:

> Hi John,
> 
> Yes it doesn’t seem to be explicitly written (I’m still looking) but reading at the beginning of chapter 12, it’s implicit that there’s one container that do one bean discovery and fire on set of events for type discovered. So IMO, it's implicit that extensions are not limited to their current archive and have the same « visibility » level than the CDI container : i.e. the current application.
> This said, it couldn’t hurt to write it explicitly.
> 
> Antoine
> 
> Le 22 févr. 2014 à 21:51, John D. Ament <john.d.ament at gmail.com> a écrit :
> 
>> Hi all,
>> 
>> Quick question.  This is mostly from playing around with Weld SE
>> 2.1.2, so I'm not sure if my question is going to be Weld SE specific
>> or be generally applied.
>> 
>> Looking through the spec, I did not see any obvious indications of
>> this.  What is the scope of the application of an Extension class?
>> Suppose I had a JAR file that had
>> META-INF/services/javax.enterprise.inject.spi.Extension with the
>> contents of some extension class.  Should the application of that
>> extension class apply to all JARs within the same classpath?  If that
>> extension were listed in a WAR file, would it apply to the WAR and all
>> JAR modules?
>> 
>> John
>> _______________________________________________
>> cdi-dev mailing list
>> cdi-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/cdi-dev
> 
> 
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev




More information about the cdi-dev mailing list