[cdi-dev] PFD submission

Pete Muir pmuir at redhat.com
Mon Feb 25 10:30:54 EST 2013


On 22 Feb 2013, at 22:02, Mark Struberg <struberg at yahoo.de> wrote:

> 
> 
>> This change is in, and if you upgrade a schema to 1.1, by default, 
> it won't pick up classes without a bean defining annotation. This is 
> mostly covered in 12.1 and 12.4, the rest of the changes for this were 
> largely cosmetic or the section in chapter 2 defining a bean defining 
> annotation.
> 
> Hmm, I don't read 12.1 that way.  There is no single mentioning of 'Dependent' nor Scope in the whole paragraph 12! The only 'loose' grip I could find is
> 
>> Explicit bean archives may contain classes which are not deployed as beans...
>> Implicit bean archives are likely to contain classes which are not deployed as beans.
> 
> But this way to unspecific for a spec imo. 'may contain' is just not enough as there is no single word about _how_ those beans shall be treated and what makes them not being picked up.

Yeah, that is just a very vague statement. I was tempted to just delete that paragraph. I could still do, if it's just misleading.

The meat is earlier: 

12.1: 

> An implicit bean archive is an archive:
> 
> 	• which contains one or more beans with a bean defining annotation, and,
> 
> 	• does not contain a beans.xml with the bean-discovery-mode of none.

So, we know that any bean archive that contains no beans.xml, but classes with a bean defining annotation, is an "implicit bean archive".

>From 12.4

"First the container must discover types. The container discovers: … each Java class interface, or enum with a bean defining annotation in an implicit bean archive."

IOW, in an implicit bean archive, only types with a bean defining annotation are discovered

and then from 2.5:

"Any scope type, which has an associated context (as defined in [contexts]), is a bean defining annotation. Any bean which has scope type is said to have a bean defining annotation. "

So we can see that only beans with a scope type have bean defining annotations.

Putting this together, we get that any archive is, effectively, an implicit bean archive (it just needs one class with a scope on it, in it), and that in these implicit bean archives, classes without bean defining annotations aren't picked up.

We also have that, by default, beans.xml with a 1.1 schema is required to specify a bean-discovery-mode, and we recommend using the mode "annotated", which actually makes the bean archive an implicit bean archive, not an explicit bean archive (which 12.1 says is only the case with a 1.1 schema if bean-discovery-mode is "all").

> 
> 
> Also there is still an explicit defaulting to @Dependent scope in 2.4.4
>> If the bean does not declare any stereotype with a declared default scope, the default scope for the bean is @Dependent. 
> 
> There is also a mentioning of a 'bean-discovery-mode' but no whatsoever description what it means nor which values are allowed and how they behave. 

Please look at the xsd, which is delivered along with the spec, which defines this. I can add some more of this to the spec if you like?

> 
> I know the time is running out and you had a lot of other commitments,

I still do ;-)

> but I fear we have to fix a few things before we ship the final version.

Sure, please continue to raise any comments here. We'll do what we can.

> How much time is until the final deadline? 

PFD is Wednesday, there is approx a month after that 'til Final, but that month we can only make blocker/critical fixes to the spec, or stuff raised by the impl/tck team.



> 
> LieGrue,
> strub
> 
> 
> 
>> ________________________________
>> From: Pete Muir <pmuir at redhat.com>
>> To: Mark Struberg <struberg at yahoo.de> 
>> Cc: "cdi-dev at lists.jboss.org" <cdi-dev at lists.jboss.org> 
>> Sent: Friday, February 22, 2013 10:22 PM
>> Subject: Re: [cdi-dev] PFD submission
>> 
>> 
>> On 22 Feb 2013, at 21:01, Mark Struberg <struberg at yahoo.de> wrote:
>> 
>>> Beans without any explicit scope still get picked up as @Dependent. 
>>> I thought this was agreed to get dropped if beans.xml version=1.1 ?
>> 
>> This change is in, and if you upgrade a schema to 1.1, by default, it won't pick up classes without a bean defining annotation. This is mostly covered in 12.1 and 12.4, the rest of the changes for this were largely cosmetic or the section in chapter 2 defining a bean defining annotation.
>> 
>>> 
>>> There are quite a few other wording and formatting changes which got added by bulk
>> 
>> I don't think there are any "bulk" changes (except Martin's patch to give every section an id), though I'm not quite sure what a "bulk" change is. All of the changes I've put have addressed specific issues.
>> 
>>> and make it hard to check for the differences since the last time I checked (and the EG didn't meet  since 2 months ago).
>> 
>> Yes unfortunately my availability has been very patchy to work on the spec of late, for which I can only apologise. I am actively looking at ways to improve this for the next version of CDI (as we are now approaching the end of CDI 1.1, it's unlikely I can get anything sorted out before then). I'll let the list know as soon as I have anything definite in this area.
>> 
>> As usual, please do bring stuff up on the mailing list :-)
>> 
>>> 
>>> LieGrue,
>>> strub
>>> 
>>> 
>>> From: Pete Muir <pmuir at redhat.com>
>>> To: "cdi-dev at lists.jboss.org" <cdi-dev at lists.jboss.org> 
>>> Sent: Friday, February 22, 2013 8:44 PM
>>> Subject: [cdi-dev] PFD submission
>>> 
>>> All,
>>> 
>>> We need to submit the PFD on Wednesday next week.
>>> 
>>> Please review the attached copy of the spec, it contains the current spec, with the proposed changes I sent out earlier, along with excludes in XML.
>>> 
>>> There isn't much more to add now, just a few bits of tidying up, which I'lll aim to do on Monday.
>>> 
>>> 
>>> Please get any issues to me asap.
>>> 
>>> Pete
>>> _______________________________________________
>>> 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