[cdi-dev] explicit bean archives discovery-mode 'annotated'

Antoine Sabot-Durand antoine at sabot-durand.net
Thu Mar 5 10:06:01 EST 2015


> Le 5 mars 2015 à 15:20, Mark Struberg <struberg at yahoo.de> a écrit :
> 
> 
>> Am 05.03.2015 um 14:14 schrieb Antoine Sabot-Durand <antoine at sabot-durand.net>:
>> 
>>> Le 5 mars 2015 à 09:28, Mark Struberg <struberg at yahoo.de> a écrit :
>>> 
>>> Well, the terms ‚explicit‘ and ‚implicit‘ BDA are blurry as well. I _explicitly_ add a beans.xml with version=1.1 and bean-discovery-mode=„annotated“ and still it is an ‚implicit‘ BDA according to those definitions. Not very self-explaining but anyway. Has not much to do with the current topic as well, so not sure why you mentioned it?
>>> 
>> 
>> It’s the other way around. Implicit bean archive behave as if they have a beans.xml with version 1.1 and “annotated” bean-discovery mode.
> 
> 
> Sorry Antoine, what I wrote is imo correct according to the correct spec wording.
> 
> Please read 12.1:
> 
> "An explicit bean archive is an archive which contains a beans.xml file:
> • with a version number of 1.1 (or later), with the bean-discovery-mode of all, or,
> • with no version number, or,
> • that is an empty file.“
> 
> The important part is „with the bean-discovery-mode of ALL“. So if it does have a different bean-discovery-mode (here: annotated) then it is NOT an explicit bean archive and is falls under the subsumption of the follow up paragraph:
> "An implicit bean archive is any other archive which contains one or more bean classes "
> 
> 
> 
> So according to the current wording (has been there that way since CDI-1.1) a jar with a beans.xml with bean-discovery-mode=„annotated“ is an ‚implicit bean archive‘. Maybe ‚annotated‘ is just missing in the first sentence?
> 


We are saying the same. what’s your point here ?


> 
>> Yes, that’s why you shouldn’t use annotated discovery mode if you want to do serious stuff in CDI.
> 
> Well that’s the same like saying „sorry folks, we fucked it up. Use something different.“ :)

Yes, but if you re-read CDI-377 you’ll notice that the problematic linked annotated has already consumed a lot of precious time to a lot of people.

> The main reason for all this is to reduce the amount of beans by not picking up every damn class on the classpath as @Dependent scoped bean.

No, the main reason for annotated mode is to activate CDI automatically in Java EE 7 without messing with class not thought for CDI.

> 
> LieGrue,
> strub
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.jboss.org/pipermail/cdi-dev/attachments/20150305/758c73ae/attachment.bin 


More information about the cdi-dev mailing list