<font size=2 face="sans-serif">Hi Martin,</font>
<br><font size=2 face="sans-serif">My comments in </font><font size=2 color=blue face="sans-serif">blue</font><font size=2 face="sans-serif">.</font>
<br>
<br><font size=2 face="sans-serif">Many thanks,<br>
Emily<br>
===========================<br>
Emily Jiang<br>
WebSphere Application Server Liberty Profile development, CDI Development
Lead</font>
<br><font size=2 face="sans-serif">&nbsp;<br>
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN<br>
Phone: &nbsp;+44 (0)1962 816278 &nbsp;Internal: 246278<br>
<br>
Email: emijiang@uk.ibm.com <br>
Lotus Notes: Emily Jiang/UK/IBM@IBMGB<br>
</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Martin Kouba &lt;mkouba@redhat.com&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Emily Jiang/UK/IBM@IBMGB,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">cdi-dev-bounces@lists.jboss.org,
cdi-dev@lists.jboss.org</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">10/08/2015 07:52</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [cdi-dev]
Clarification on the difference on Vetoed and exclude filters regarding
Java EE component classes</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">cdi-dev-bounces@lists.jboss.org</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Dne 7.8.2015 v 10:29 Emily Jiang napsal(a):<br>
&gt; Thanks Martin for your reply! Your reply confirmed my understanding
of<br>
&gt; @Vetoed.<br>
&gt;<br>
&gt; What is the expected behaviour if I exclude my JavaEE component class
in<br>
&gt; the filter under beans.xml? Will this cause the JavaEE component class<br>
&gt; being ignored by CDI or this should have the same effect as being<br>
&gt; annotated as @Vetoed?<br>
<br>
This should have the same effect as @Vetoed.<br>
</font></tt><tt><font size=2 color=blue>&lt;ej&gt;</font></tt>
<br><tt><font size=2 color=blue>In this case, the session 12.4.1 Type discovery
should be enhanced,</font></tt>
<br>
<br><font size=2 color=blue face="Arial">that is not excluded from discovery
by an <i>exclude filter </i>as defined in <i>Section 12.4.2, “Exclude</i></font>
<br><font size=2 color=blue face="Arial"><i>filters”</i>.</font><tt><font size=2 color=blue>
</font></tt>
<br>
<br><tt><font size=2 color=blue>should be changed to</font></tt>
<br>
<br><font size=2 color=blue face="Arial">that is not excluded from discovery
by an <i>exclude filter </i>as defined in <i>Section 12.4.2, “Exclude</i></font>
<br><font size=2 color=blue face="Arial"><i>filters”</i>or annotated with
@Vetoed (class level or package level).</font>
<br><tt><font size=2 color=blue>&lt;ej&gt;</font></tt><tt><font size=2><br>
&gt;<br>
&gt; &quot;In the 12.4.2, it states: If the filter is active, and: ....
then we<br>
&gt; say that the type is excluded from discovery.&quot;<br>
&gt;<br>
&gt; Does the above discovery mean both type and bean discovery or just
bean<br>
&gt; discovery? If it means both type and bean discovery, the classes should<br>
&gt; be ignored by CDI. Please confirm.<br>
</font></tt><tt><font size=2 color=blue><br>
</font></tt><tt><font size=2>@Veto, ProcessAnnotatedType.veto() and exclude
filters are tied to Type <br>
discovery. Moreover, the Java EE components (like servlets) are not CDI
<br>
beans and may not be vetoed at all.</font></tt>
<br><tt><font size=2 color=blue>&lt;ej&gt;<br>
I think the @Vetoed is useful in the explicit bean discovery mode to exclude
the JavaEE component classes from considering as beans. In the implicit
bean archive, they are not beans anyway.</font></tt>
<br>
<br><tt><font size=2 color=blue>I have still further question on the following
spec sections.</font></tt>
<br>
<br>
<br><font size=4 color=blue face="Arial"><b>12.4.1. Type discovery</b></font>
<br><font size=2 color=blue face="Arial">First the container must discover
types. The container discovers:</font>
<br><font size=2 color=blue face="Arial">• each Java class, interface
(excluding the special kind of interface declaration <i>annotation type</i>)</font>
<br><font size=2 color=blue face="Arial">or enum deployed in an explicit
bean archive, and</font>
<br><font size=2 color=blue face="Arial">• each Java class with a bean
defining annotation in an implicit bean archive.</font>
<br><font size=2 color=blue face="Arial">• each session bean</font>
<br><font size=2 color=blue face="Arial">that is not excluded from discovery
by an <i>exclude filter </i>as defined in <i>Section 12.4.2, “Exclude</i></font>
<br><font size=2 color=blue face="Arial"><i>filters”</i>.</font>
<br><font size=4 color=blue face="Arial"><b>12.4.3. Bean discovery</b></font>
<br><font size=2 color=blue face="Arial"><b>For every type in the set of
discovered types (as defined in <i>Section 12.4.1, “Type discovery”</i>),
the</b></font>
<br><font size=2 color=blue face="Arial"><b>container must:</b></font>
<br><font size=2 color=blue face="Arial">• inspect the type metadata to
determine if it is a bean or other Java EE component class</font>
<br><font size=2 color=blue face="Arial">supporting injection, and then</font>
<br><font size=2 color=blue face="Arial">• detect definition errors by
validating the class and its metadata, and then</font>
<br><font size=2 color=blue face="Arial">• if the class is a managed bean,
session bean, or other Java EE component class supporting</font>
<br><font size=2 color=blue face="Arial">injection, fire an event of type
</font><tt><font size=1 color=blue>ProcessInjectionPoint </font></tt><font size=2 color=blue face="Arial">for
each injection point in the class, as</font>
<br><font size=2 color=blue face="Arial">defined in <i>Section 11.5.7,
“</i></font><tt><font size=1 color=blue><i>ProcessInjectionPoint </i></font></tt><font size=2 color=blue face="Arial"><i>event”</i>,
and then</font>
<br><font size=2 color=blue face="Arial">• if the class is a managed bean,
session bean, or other Java EE component class supporting</font>
<br><font size=2 color=blue face="Arial">injection, fire an event of type
</font><tt><font size=1 color=blue>ProcessInjectionTarget</font></tt><font size=2 color=blue face="Arial">,
as defined in <i>Section 11.5.8,</i></font>
<br><font size=2 color=blue face="Arial"><i>“</i></font><tt><font size=1 color=blue><i>ProcessInjectionTarget
</i></font></tt><font size=2 color=blue face="Arial"><i>event”</i>, and
then</font>
<br>
<br>
<br><font size=2 color=blue face="sans-serif">The Bean discovery stage
seems to suggest it only consider the types discovered in the type discovery.
Considering a @Vetoed JavaEE component class or such class in an implicit
bean archive, it won't be processed in the bean discovery stage as it opts
out from type discovery. Neither processInjectionPoint nor ProcessInjectionTarget
events can be fired. I think it is wrong.</font>
<br>
<br>
<br><tt><font size=2>Another query: would the Spec require JavaEE component
classes to support injection in an non bean archive? </font></tt>
<br><font size=2 color=blue face="sans-serif">&lt;/ej&gt;</font><tt><font size=2><br>
&gt;<br>
&gt; Many thanks,<br>
&gt; Emily<br>
&gt; ===========================<br>
&gt; Emily Jiang<br>
&gt; WebSphere Application Server Liberty Profile development, CDI<br>
&gt; Development Lead<br>
&gt;<br>
&gt; MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN<br>
&gt; Phone: &nbsp;+44 (0)1962 816278 &nbsp;Internal: 246278<br>
&gt;<br>
&gt; Email: emijiang@uk.ibm.com<br>
&gt; Lotus Notes: Emily Jiang/UK/IBM@IBMGB<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; From: Martin Kouba &lt;mkouba@redhat.com&gt;<br>
&gt; To: Emily Jiang/UK/IBM@IBMGB, cdi-dev@lists.jboss.org,<br>
&gt; Date: 07/08/2015 03:40<br>
&gt; Subject: Re: [cdi-dev] Clarification on the difference on Vetoed and<br>
&gt; exclude filters regarding Java EE component classes<br>
&gt; Sent by: cdi-dev-bounces@lists.jboss.org<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Dne 6.8.2015 v 15:55 Emily Jiang napsal(a):<br>
&gt; &nbsp;&gt; In the section 3.6. Java EE components of CDI 1.2 specification,
it has<br>
&gt; &nbsp;&gt; the following statement:<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; /It is safe to annotate Java EE components with //@Vetoed
//to prevent<br>
&gt; &nbsp;&gt; them being considered beans./<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; According to my understanding, the JavaEE component classes
with @Vetoed<br>
&gt; &nbsp;&gt; should still support injections and *ProcessInjectionTarget*events<br>
&gt; &nbsp;&gt; should still be fired.<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; In the 12.4.2, it states:<br>
&gt; &nbsp;&gt; /If the filter is active, and: .... then we say that the
type is<br>
&gt; &nbsp;&gt; excluded from discovery./<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; Does this mean if a JavaEE component class is excluded
from the scan in<br>
&gt; &nbsp;&gt; the beans.xml, its CDI involvement should be ignored (@Inject
would be<br>
&gt; &nbsp;&gt; ignored etc)?<br>
&gt;<br>
&gt; I don't think so. I believe the intent of &quot;3.6. Java EE components&quot;
is<br>
&gt; to clarify that if a component class (e.g. a servlet class) is also<br>
&gt; recognized as a managed bean [1] there will be two different<br>
&gt; &quot;components&quot; in your applicaion, each managed by a different
Java EE<br>
&gt; technology - e.g. a servlet managed by the servlet container and a
CDI<br>
&gt; bean with servlet class in its set of bean types.<br>
&gt;<br>
&gt; The servlet has a different lifecycle, it's managed by a servlet<br>
&gt; container and as such must support injection (but cannot be injected,
etc.).<br>
&gt;<br>
&gt; This might be confusing and therefore it's a good idea to veto the
Java<br>
&gt; EE component classes -&gt; there will be no CDI bean definitions based
on<br>
&gt; the component classes.<br>
&gt;<br>
&gt; [1]<br>
&gt; </font></tt><a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#what_classes_are_beans"><tt><font size=2>http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#what_classes_are_beans</font></tt></a><tt><font size=2><br>
&gt;<br>
&gt;<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; Many thanks,<br>
&gt; &nbsp;&gt; Emily<br>
&gt; &nbsp;&gt; ===========================<br>
&gt; &nbsp;&gt; Emily Jiang<br>
&gt; &nbsp;&gt; WebSphere Application Server Liberty Profile development,
CDI<br>
&gt; &nbsp;&gt; Development Lead<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN<br>
&gt; &nbsp;&gt; Phone: &nbsp;+44 (0)1962 816278 &nbsp;Internal: 246278<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; Email: emijiang@uk.ibm.com<br>
&gt; &nbsp;&gt; Lotus Notes: Emily Jiang/UK/IBM@IBMGB<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; Unless stated otherwise above:<br>
&gt; &nbsp;&gt; IBM United Kingdom Limited - Registered in England and
Wales with number<br>
&gt; &nbsp;&gt; 741598.<br>
&gt; &nbsp;&gt; Registered office: PO Box 41, North Harbour, Portsmouth,
Hampshire<br>
&gt; PO6 3AU<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; _______________________________________________<br>
&gt; &nbsp;&gt; cdi-dev mailing list<br>
&gt; &nbsp;&gt; cdi-dev@lists.jboss.org<br>
&gt; &nbsp;&gt; </font></tt><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/cdi-dev</font></tt></a><tt><font size=2><br>
&gt; &nbsp;&gt;<br>
&gt; &nbsp;&gt; Note that for all code provided on this list, the provider
licenses<br>
&gt; the code under the Apache License, Version 2<br>
&gt; (</font></tt><a href="http://www.apache.org/licenses/LICENSE-2.0.html"><tt><font size=2>http://www.apache.org/licenses/LICENSE-2.0.html</font></tt></a><tt><font size=2>).
For all other ideas<br>
&gt; provided on this list, the provider waives all patent and other<br>
&gt; intellectual property rights inherent in such information.<br>
&gt; &nbsp;&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Martin Kouba<br>
&gt; Software Engineer<br>
&gt; Red Hat, Czech Republic<br>
&gt; _______________________________________________<br>
&gt; cdi-dev mailing list<br>
&gt; cdi-dev@lists.jboss.org<br>
&gt; </font></tt><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/cdi-dev</font></tt></a><tt><font size=2><br>
&gt;<br>
&gt; Note that for all code provided on this list, the provider licenses
the<br>
&gt; code under the Apache License, Version 2<br>
&gt; (</font></tt><a href="http://www.apache.org/licenses/LICENSE-2.0.html"><tt><font size=2>http://www.apache.org/licenses/LICENSE-2.0.html</font></tt></a><tt><font size=2>).
For all other ideas<br>
&gt; provided on this list, the provider waives all patent and other<br>
&gt; intellectual property rights inherent in such information.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Unless stated otherwise above:<br>
&gt; IBM United Kingdom Limited - Registered in England and Wales with
number<br>
&gt; 741598.<br>
&gt; Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU<br>
<br>
-- <br>
Martin Kouba<br>
Software Engineer<br>
Red Hat, Czech Republic<br>
_______________________________________________<br>
cdi-dev mailing list<br>
cdi-dev@lists.jboss.org<br>
</font></tt><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/cdi-dev</font></tt></a><tt><font size=2><br>
<br>
Note that for all code provided on this list, the provider licenses the
code under the Apache License, Version 2 (</font></tt><a href="http://www.apache.org/licenses/LICENSE-2.0.html"><tt><font size=2>http://www.apache.org/licenses/LICENSE-2.0.html</font></tt></a><tt><font size=2>).
For all other ideas provided on this list, the provider waives all patent
and other intellectual property rights inherent in such information.<br>
<br>
</font></tt>
<br><font size=2 face="sans-serif"><br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU<br>
</font>