[cdi-dev] ProcessAnnotatedType & Bean Discovery mode

Matej Novotny manovotn at redhat.com
Mon Jul 24 06:38:05 EDT 2017


What case exactly do you think Weld does incorrectly?

If you have beans.xml `all` with `<trimm/>`, you should be firing PAT for all. That's what me and Martin said.

Matej

----- Original Message -----
> From: "John Ament" <john.ament at spartasystems.com>
> To: "Antoine Sabot-Durand" <asd at redhat.com>, "Martin Kouba" <mkouba at redhat.com>
> Cc: "cdi-dev" <cdi-dev at lists.jboss.org>
> Sent: Monday, July 24, 2017 12:09:16 PM
> Subject: Re: [cdi-dev] ProcessAnnotatedType & Bean Discovery mode
> 
> 
> 
> Then that means Weld is doing it wrong (firing PAT for all classes).
> 
> 
> 
> 
> John
> 
> From: Antoine Sabot-Durand <asd at redhat.com>
> Sent: Monday, July 24, 2017 4:31 AM
> To: Martin Kouba
> Cc: John Ament; cdi-dev
> Subject: Re: [cdi-dev] ProcessAnnotatedType & Bean Discovery mode
> Yes it’s the correct interpretation.
> Confusion may come from the fact that we first considered to specify this
> feature the other way around (discover all types on implicites bean archive
> but only keep classes with BDA for bean discovery). We switched to this
> approach because we thought it was better for backward compatibility.
> 
> Antoine
> 
> > Le 24 juil. 2017 à 08:27, Martin Kouba <mkouba at redhat.com> a écrit :
> > 
> > Hi John,
> > 
> > I think OWB interpretation is correct.
> > 
> > In an implicit bean archive (implicit = bean archive with
> > bean-discovery-mode=annotated) PAT is only fired for discovered types
> > and the container only discovers each class with a bean defining
> > annotation.
> > 
> > For trimmed bean archive - only explicit bean archives may be marked as
> > 'trimmed'. PAT is fired there but if it does not have a bean defining
> > annotation it's removed from the set of discovered types, i.e. no bean
> > is created.
> > 
> > Martin
> > 
> > Dne 23.7.2017 v 14:32 John Ament napsal(a):
> >> Hi,
> >> 
> >> 
> >> An issue popped up in OWB wanted to get the EG's perspective on this.
> >> 
> >> 
> >> I have a given bean archive, with a class in it (no bean defining
> >> annotations). My interpretation of [1] and [2] is that this class is
> >> fired as a ProcessAnnotatedType, regardless of what is in beans.xml. In
> >> OWB, if I do bean-discovery-mode=annotated it does not get fired, but if
> >> it is all, even with a <trim/> a PAT gets fired. However it seems that
> >> it should get fired before anything is even considered about the class,
> >> and whether it has annotations.
> >> 
> >> 
> >> [1]:
> >> https://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#process_annotated_type
> 
> 	
> Contexts and Dependency Injection for the Java EE platform
> docs.jboss.org
> A well-defined lifecycle for stateful objects bound to lifecycle contexts,
> where the set of contexts is extensible. A sophisticated, typesafe
> dependency injection ...
> 
> 
> >> 
> >> [2]:
> >> https://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#process_annotated_type
> >> 
> >> 
> >> John
> >> 
> >> 
> >> ------------------------------------------------------------------------
> >> NOTICE: This e-mail message and any attachments may contain
> >> confidential, proprietary, and/or privileged information which should be
> >> treated accordingly. If you are not the intended recipient, please
> >> notify the sender immediately by return e-mail, delete this message, and
> >> destroy all physical and electronic copies. Thank you.
> >> 
> >> 
> >> _______________________________________________
> >> cdi-dev mailing list
> >> cdi-dev at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/cdi-dev
> 
> 	
> cdi-dev Info Page - lists.jboss.org Mailing Lists
> lists.jboss.org
> List to discuss the development of CDI (the specification) To see the
> collection of prior postings to the list, visit the cdi-dev Archives.
> 
> 
> >> 
> >> Note that for all code provided on this list, the provider licenses the
> >> code under the Apache License, Version 2 (
> >> http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas
> >> provided on this list, the provider waives all patent and other
> >> intellectual property rights inherent in such information.
> >> 
> > 
> > --
> > Martin Kouba
> > Senior Software Engineer
> > Red Hat, Czech Republic
> > _______________________________________________
> > cdi-dev mailing list
> > cdi-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/cdi-dev
> > 
> > Note that for all code provided on this list, the provider licenses the
> > code under the Apache License, Version 2 (
> > http://www.apache.org/licenses/LICENSE-2.0.html ). For all other ideas
> > provided on this list, the provider waives all patent and other
> > intellectual property rights inherent in such information.
> 
> 
> NOTICE: This e-mail message and any attachments may contain confidential,
> proprietary, and/or privileged information which should be treated
> accordingly. If you are not the intended recipient, please notify the sender
> immediately by return e-mail, delete this message, and destroy all physical
> and electronic copies. Thank you.
> 
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
> 
> Note that for all code provided on this list, the provider licenses the code
> under the Apache License, Version 2
> (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other intellectual
> property rights inherent in such information.



More information about the cdi-dev mailing list