<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="">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 WeldSEProvider extends WeldProvider {<br class=""><br class=""> private static boolean firstTime = true;<br class=""><br class=""> @Override<br class=""> public CDI<Object> getCDI() {<br class=""> if (firstTime) {<br class=""> new Weld().initialize();<br class=""> firstTime = false;<br class=""> }<br class=""><br class=""> return super.getCDI();<br class=""> }<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 Main {<br class=""> <br class=""> public static void main(String[] args) throws Exception {<br class=""> CDI cdi = CDI.current();<br class=""> BeanManager bm = cdi.getBeanManager();<br class=""> <br class=""> }<br class=""> <br class="">}</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class="">Code is available in my weld fork : <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></body></html>