<div dir="ltr"><div><b>Option 2</b>. I can't think of the option 1 pattern in Java EE. If you look at JPA for example, you can see sentences such as : </div><div><br></div><div><br></div><div><div><i>"The Persistence class is available in a Java EE container environment as well; however, support for the Java SE bootstrapping APIs is not required in container environments."</i></div></div><div><i><br></i></div><div><i>"Both JTA entity managers and resource-local entity managers are required to be supported in Java EE web containers and EJB containers. (...) In general, in Java SE environments only resource-local entity managers are supported."</i></div><div><br></div><div><br></div><div>So I think Java EE developers are more confortable on using a same API, and depending on the environment (EE or SE) things might happen this way, or that way (ex. throwing an exception).</div><div><br></div><div>Antonio</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 31, 2015 at 5:19 PM, JJ Snyder <span dir="ltr"><<a href="mailto:j.j.snyder@oracle.com" target="_blank">j.j.snyder@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Option 2<span class=""><br>
<div>On 03/24/2015 02:00 PM, John D. Ament
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">All,
<div><br>
</div>
<div>In discussion today w/ Jozef, we found that the way of
shutting down a container in the proposed SE API precluded the
notion that multiple containers could be running. While we're
not necessarily going to handle multiple containers right now,
we don't want to preclude the idea either. With that said,
there were three different approaches though up to handle how
to shutdown a launched container. it obivously would only
work with an SE booted container, but part of this does give a
pointer in how we may implement initialize.</div>
<div><br>
</div>
<div>Option 1 - Subclass CDI. The returned CDI instance when
bootstrapped would return this subclass of CDI that has
shutdown capability. </div>
<div><br>
</div>
<div>Option 2 - Add method to CDI. Add the shutdown method to
CDI directly, and throw an exception if called in an EE
environment.</div>
<div><br>
</div>
<div>Option 3 - Return a different object all together when
initializing. Return something else from initialize, e.g.
CDIContext, which has a shutdown method when you initialize.
That class would also have a getter for the CDI instance
backing it.</div>
<div><br>
</div>
<div>Let us know your thoughts.</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>John</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
cdi-dev mailing list
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a>
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.</pre>
</blockquote>
<br>
</span></div>
<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><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Antonio Goncalves <br>Software architect, Java Champion and Pluralsight author<br><br><a href="http://www.antoniogoncalves.org" target="_blank">Web site</a> | <a href="http://twitter.com/agoncal" target="_blank">Twitter</a> | <a href="http://www.linkedin.com/in/agoncal" target="_blank">LinkedIn</a> | <a href="http://pluralsight.com/training/Authors/Details/antonio-goncalves" target="_blank">Pluralsight</a> | <a href="http://www.parisjug.org" target="_blank">Paris JUG</a> | <a href="http://www.devoxx.fr" target="_blank">Devoxx France</a></div></div>
</div>