<div dir="ltr">At some point, I had this issue noted somewhere.  I guess I never brought it up on the ML.<div><br></div><div>The behavior of the RI makes no sense IMHO.  If someone else calls initialize of the CDIProvider I&#39;m working on, now my state is all messed up.  Not good behavior.</div><div><br></div><div>Anyways, if we do #1 it&#39;s clear that this initialization doesn&#39;t belong in CDIProvider.</div><div><br></div><div>If we do #2, it&#39;ll be bad experience for whoever&#39;s using the provider.</div><div><br></div><div>I&#39;d prefer a third option.  Revert the change that allows you to call initialize() multiple times, and instead add a CDIProviderFactory (or equivalent) that creates new CDIProviders.  You may call initialize on those instances to get new containers.  Oh then shutdown can go back on the CDIProvider as well.</div><div><br></div><div>John<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 13, 2015 at 1:08 PM, Antoine Sabot-Durand <span dir="ltr">&lt;<a href="mailto:antoine@sabot-durand.net" target="_blank" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=antoine@sabot-durand.net&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">antoine@sabot-durand.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
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>
<br>
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>
<br>
I thought of 2 simple solutions for EDR1:<br>
<br>
1) make getCDI() return the last CDI object initialized by the CDIProvider<br>
2) Forbid getCDI() in SE<br>
<br>
Of course there’s always the solution of moving the code outside CDIProvider, but it’s less simple…<br>
<br>
Wdyt,<br>
<br>
Antoine<br>
<br>_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" onclick="window.open(&#39;https://mail.google.com/mail/?view=cm&amp;tf=1&amp;to=cdi-dev@lists.jboss.org&amp;cc=&amp;bcc=&amp;su=&amp;body=&#39;,&#39;_blank&#39;);return false;">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><br></div></div></div>