<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I think the main reason we wanted to split it was due to not confusing the use cases of booting CDI and accessing the CDI container.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 19 Dec 2014, at 11:03, Antoine Sabot-Durand &lt;<a href="mailto:antoine@sabot-durand.net" class="">antoine@sabot-durand.net</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi guys,<div class=""><br class=""></div><div class="">As I said during last meeting I was puzzled by the non use of CDI and CDIProvider to address CDI boot in Java SE.</div><div class=""><br class=""></div><div class="">I just made a small test adding this class to weld-se :</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">public class&nbsp;WeldSEProvider&nbsp;extends&nbsp;WeldProvider {<br class=""><br class="">&nbsp; &nbsp;&nbsp;private static boolean&nbsp;firstTime&nbsp;=&nbsp;true;<br class=""><br class="">&nbsp; &nbsp;&nbsp;@Override<br class="">&nbsp; &nbsp;&nbsp;public&nbsp;CDI&lt;Object&gt;&nbsp;getCDI() {<br class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(firstTime) {<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;new&nbsp;Weld().initialize();<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;firstTime&nbsp;=&nbsp;false;<br class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;}<br class=""><br class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return super.getCDI();<br class="">&nbsp; &nbsp;&nbsp;}<br class=""><br class="">}</font><br class=""></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class="">and replaced the content of META-INF/services/javax.enterprise.inject.spi.CDIProvider by my provider</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">org.jboss.weld.environment.se.WeldSEProvider</font></div><div class=""><br class=""></div><div class="">Using this new version of Weld-se in my project Iw as able to boot CDI without implementation classes :</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">public class&nbsp;Main {<br class="">&nbsp; &nbsp;&nbsp;<br class="">&nbsp; &nbsp;&nbsp;public static void&nbsp;main(String[] args)&nbsp;throws&nbsp;Exception {<br class="">&nbsp; &nbsp; &nbsp; &nbsp; CDI cdi = CDI.current();<br class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;BeanManager bm = cdi.getBeanManager();<br class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br class="">&nbsp; &nbsp;&nbsp;}<br class="">&nbsp; &nbsp;&nbsp;<br class="">}</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class="">Code is available in my weld fork :&nbsp;<a href="https://github.com/antoinesd/weld-core/blob/2.2-SE/environments/se/core/src/main/java/org/jboss/weld/environment/se/WeldSEProvider.java" class="">https://github.com/antoinesd/weld-core/blob/2.2-SE/environments/se/core/src/main/java/org/jboss/weld/environment/se/WeldSEProvider.java</a></div><div class=""><br class=""></div><div class="">Similar CDIProvider can be written for OWB as well.</div><div class=""><br class=""></div><div class="">I may have missed something, but I think we can figure out something like that to provide SE support in CDI today, even if it’s not as complete as the one we plan to push in CDI 2.0</div><div class=""><br class=""></div><div class="">Antoine</div></div></div></blockquote></div><br class=""></div></body></html>