<div dir="ltr"><div><div><div>Hi Martin,<br></div>I totally agree with you. In integrating CDI 1.2 to WebSphere Liberty profile, I interpreted the latter. <br><br>e.g. In a war with bean-discovery-mod=none, if one of its libs is a bean archive, the cdi is enabled for the war module. The servlet in this war will support injections. <br><br>However, it gives performance penalty, e.g. creating bda etc. I would like to know what the other application servers (GlassFish or WildFly) behave. It will be nice if the spec is clearer on this. I will raise a spec issue on this. <br></div>Thanks<br></div>Emily<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 18, 2015 at 2:36 PM, Martin Kouba <span dir="ltr">&lt;<a href="mailto:mkouba@redhat.com" target="_blank">mkouba@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Emily,<br>
<br>
Dne 18.8.2015 v 11:36 Emily Jiang napsal(a):<span class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 From CDI spec,<br>
An archive which:<br>
• contains a beans.xml file with the bean-discovery-mode of none, or,<br>
• contains an extension and no beans.xml file<br>
is not a bean archive.<br>
<br>
I think it is no need to create a bda for such bean archives, which<br>
implies JavaEE component classes cannot support injection in these<br>
archives. These archives are ignored basically. Right?<br>
</blockquote>
<br></span>
Yes, these archives are ignored from the CDI container point of view. As regards the injection support for Java EE component classes - this is not clearly defined. Java EE spec states in &quot;EE.5.2.5<br>
Annotations and Injection&quot;:<br>
<br>
&quot;The component classes listed in Table EE.5-1 with support level Standard all support Java EE resource injection, as well as PostConstruct and PreDestroy callbacks. In addition, if CDI is enabled—which it is by default—these classes also support CDI injection, as described in Section EE.5.24, Support for Dependency Injection, and the use of interceptors.&quot;<br>
<br>
However, it is not clear what &quot;if CDI is enabled&quot; means. One can argue that &quot;CDI is enabled&quot; if the component class resides in a bean archive. The other interpretation (the one I personally prefer) might be that &quot;CDI is enabled&quot; if a CDI container is initialized for the application (i.e. there&#39;s at least one CDI bean archive).<br>
<br>
I think we should check what Java EE RI (GlassFish) and other implementations (WildFly) do.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
The spec does say an extension can exist in a non-bean archive but it<br>
does not say anything about JavaEE component classes.<br>
<br>
<br>
--<br>
Thanks<br>
Emily<br>
=================<br>
Emily Jiang<br>
</span><a href="mailto:ejiang@apache.org" target="_blank">ejiang@apache.org</a> &lt;mailto:<a href="mailto:ejiang@apache.org" target="_blank">ejiang@apache.org</a>&gt;<br>
<br>
<br>
_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org" target="_blank">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
<br><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
Martin Kouba<br>
Software Engineer<br>
Red Hat, Czech Republic<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Thanks<br>Emily<br>=================<br>Emily Jiang<br><a href="mailto:ejiang@apache.org" target="_blank">ejiang@apache.org</a><br></div>
</div>