<p dir="ltr">This is a good feature but not in lazy mode. It implies to forbid all contextuality like serialization etc...</p>
<p dir="ltr">Agree weld impl will lead to more issues than solutions.</p>
<div class="gmail_quote">Le 14 mai 2015 15:22, &quot;Mark Struberg&quot; &lt;<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>&gt; a écrit :<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I DID voice against multiple CDI impls both on the mailing list and on EG meetings…<br>
<br>
&gt; Am 14.05.2015 um 10:44 schrieb Antoine Sabot-Durand &lt;<a href="mailto:antoine@sabot-durand.net">antoine@sabot-durand.net</a>&gt;:<br>
&gt;<br>
&gt; Mark,<br>
&gt;<br>
&gt; My question wasn’t about the feature which have been discussed for more than 2 months. This feature is now going to EDR1 since there wasn’t voice against it. And again EDR1 is not final spec. You’ll be able to discuss it with the community when it’ll be proposed.<br>
&gt;<br>
&gt; Antoine<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt; Le 14 mai 2015 à 10:36, Mark Struberg &lt;<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>&gt; a écrit :<br>
&gt;&gt;<br>
&gt;&gt; That usecase is imo not really valid. Such a testing framework would need a ClassLoader isolation to work. Just create a child UrlClassLoader with your test project in and be done. Otherwise you would get into a total mess with static fields etc. It simply makes no sense in my opinion and propagates bad practice.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; think the fact that there’s no specific use case doesn’t mean we should forbid this.<br>
&gt;&gt; If it requires the impls to do all kind of mad stuff then we at least should not require it.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; LieGrue,<br>
&gt;&gt; strub<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; Am 14.05.2015 um 09:23 schrieb Martin Kouba &lt;<a href="mailto:mkouba@redhat.com">mkouba@redhat.com</a>&gt;:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Just quoting Jozef from the referenced Weld 3.0.0.Alpha8 announcement:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &quot;One possible use-case this enables is for a library or framework (e.g. a testing framework) to use an embedded instance of Weld internally for its own needs (dependency injection, events, extensibility). This instance would not interfere with the Weld instance used by the application.&quot;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I think the fact that there&#39;s no specific use case doesn&#39;t mean we should forbid this.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Martin<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Dne 14.5.2015 v 09:12 Mark Struberg napsal(a):<br>
&gt;&gt;&gt;&gt; I still don’t get it what running multiple CDI container on the SAME ClassLoader/Thread should be for?<br>
&gt;&gt;&gt;&gt; What’s the use case?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; LieGrue,<br>
&gt;&gt;&gt;&gt; strub<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Am 14.05.2015 um 08:11 schrieb Martin Kouba &lt;<a href="mailto:mkouba@redhat.com">mkouba@redhat.com</a>&gt;:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Hi Antoine,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Weld SE 3.0.0.Alpha8 [1] (which allows to start multiple independent<br>
&gt;&gt;&gt;&gt;&gt; Weld instances) has a special CDIProvider implementation [2]:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; * if there&#39;s exactly one container running, return this container<br>
&gt;&gt;&gt;&gt;&gt; * if there are multiple containers running, log an INFO message and<br>
&gt;&gt;&gt;&gt;&gt; attempt to identify the container by the calling class:<br>
&gt;&gt;&gt;&gt;&gt; ** if there is only one container aware of the class, return this container<br>
&gt;&gt;&gt;&gt;&gt; ** otherwise return the first container initialized<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Martin<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; [1]<br>
&gt;&gt;&gt;&gt;&gt; <a href="http://weld.cdi-spec.org/news/2015/04/21/weld-300Alpha8/" target="_blank">http://weld.cdi-spec.org/news/2015/04/21/weld-300Alpha8/</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; [2]<br>
&gt;&gt;&gt;&gt;&gt; <a href="https://github.com/weld/core/blob/master/environments/se/core/src/main/java/org/jboss/weld/environment/se/WeldSEProvider.java" target="_blank">https://github.com/weld/core/blob/master/environments/se/core/src/main/java/org/jboss/weld/environment/se/WeldSEProvider.java</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Dne 13.5.2015 v 19:08 Antoine Sabot-Durand napsal(a):<br>
&gt;&gt;&gt;&gt;&gt;&gt; Hi all,<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; While cleaning Javadoc in CDIProvider, I realized that getCDI() method description is not compatible with the multiple container initialization we allowed in the API.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; While running in Java EE getCDI() retuns the current container which is fine since there’s only one, but what do we expect from it when running in SE?<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; I thought of 2 simple solutions for EDR1:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; 1) make getCDI() return the last CDI object initialized by the CDIProvider<br>
&gt;&gt;&gt;&gt;&gt;&gt; 2) Forbid getCDI() in SE<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Of course there’s always the solution of moving the code outside CDIProvider, but it’s less simple…<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Wdyt,<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Antoine<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt; cdi-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; Martin Kouba<br>
&gt;&gt;&gt;&gt;&gt; Software Engineer<br>
&gt;&gt;&gt;&gt;&gt; Red Hat, Czech Republic<br>
&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt; cdi-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Martin Kouba<br>
&gt;&gt;&gt; Software Engineer<br>
&gt;&gt;&gt; Red Hat, Czech Republic<br>
&gt;&gt;<br>
&gt;<br>
<br>
<br>
_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
</blockquote></div>