<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On 18 Dec 2014, at 07:58, Jozef Hartinger <<a href="mailto:jharting@redhat.com" class="">jharting@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On 12/18/2014 08:48 AM, Romain Manni-Bucau wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Hi guys,<br class=""><br class="">- why shutdown and not AutoClosable?<br class=""></blockquote><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I like this idea.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">- about instance: it uses TCCL to load the impls, not sure it is<br class="">intended but depending the deployment it can be an issue (is this api<br class="">100% JavaSE + flat classpath - ie more constrained than JavaSE?) +<br class="">most of javax SPI creates a new instance each time "creator" is<br class="">called.<br class=""></blockquote><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I don't follow. Who uses TCCL?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>This is exactly the way java.util.ServiceLoader works.</div><div><br class=""></div><div>Note that it doesn’t use the TCCL to load the impl, it uses the TCCL, or the class loader of the API, or the system loader, to load the “CDIProvider”. This CDIProvider can use whatever mechanism it needs to load the actual impl.</div><div><br class=""></div><div>This certainly provides some limitations, but I think writing an OSGi provider that uses some of OSGi’s DI features could work to look up the current CDI container would work here?</div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">- Why Booter and not Container (better than factory IMO)? 1) for<br class="">consistency with other spec, 2) why can I shutdown a booter ;)?<br class=""></blockquote><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Exactly</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><br class=""><br class="">Romain Manni-Bucau<br class="">@rmannibucau<br class=""><a href="http://www.tomitribe.com" class="">http://www.tomitribe.com</a><br class="">http://rmannibucau.wordpress.com<br class="">https://github.com/rmannibucau<br class=""><br class=""><br class="">2014-12-18 8:37 GMT+01:00 Jozef Hartinger <jharting@redhat.com>:<br class=""><blockquote type="cite" class="">On 12/18/2014 04:33 AM, John D. Ament wrote:<br class=""><br class="">I thought today's meeting was pretty good. Based on one of the discussion<br class="">points, I wanted to try putting together an interface that described the<br class="">boot paradigm. Unfortunately even in Java 8 it doesn't work too well, I<br class="">cannot assign a static variable in an interface the way I can in an abstract<br class="">class. More importantly, it doesn't give us the private level expectation I<br class="">would look for in this case. I best I could come up with using an interface<br class="">is:<br class=""><br class="">public interface CDIBooter {<br class=""> default BeanManager initialize() {<br class=""> return initialize(new HashMap<>());<br class=""> }<br class=""><br class=""> BeanManager initialize(Map<?,?> properties);<br class=""><br class="">Why BeanManager? I think it would be better to return CDI or its subclass<br class="">rather than this low-level SPI. With the CDI class we get more user-friendly<br class="">Instance<T> for free. We could also expose Event<T> similarly.<br class=""><br class=""><br class=""> void shutdown();<br class=""><br class=""> class BootHolder {<br class=""><br class=""> static CDIBooter instance = null;<br class=""><br class=""> }<br class=""><br class=""> static CDIBooter instance() {<br class=""> if(BootHolder.instance == null) {<br class=""> ServiceLoader<CDIBooter> serviceLoader =<br class="">ServiceLoader.load(CDIBooter.class);<br class=""> for(CDIBooter booter : serviceLoader) {<br class=""> BootHolder.instance = booter;<br class=""> break;<br class=""> }<br class=""> }<br class=""> return BootHolder.instance;<br class=""> }<br class="">}<br class=""><br class="">where as the abstract class is a bit briefer, while also being private.<br class=""><br class="">public abstract class CDIBooter {<br class=""> public BeanManager initialize() {<br class=""> return initialize(new HashMap<>());<br class=""> }<br class=""><br class=""> public abstract BeanManager initialize(Map<?,?> properties);<br class=""><br class=""> public abstract void shutdown();<br class=""><br class=""> private static CDIBooter instance = null;<br class=""><br class=""> public static CDIBooter instance() {<br class=""> if(instance == null) {<br class=""> ServiceLoader<CDIBooter> serviceLoader =<br class="">ServiceLoader.load(CDIBooter.class);<br class=""> for(CDIBooter booter : serviceLoader) {<br class=""> instance = booter;<br class=""> break;<br class=""> }<br class=""> }<br class=""> return instance;<br class=""> }<br class="">}<br class=""><br class="">Obviously ignore concurrency issues, etc. It does look to be safer to do an<br class="">abstract class, rather than a factory-interface.<br class=""><br class="">John<br class=""><br class=""><br class="">On Wed Dec 17 2014 at 10:40:44 AM Antoine Sabot-Durand<br class=""><antoine@sabot-durand.net> wrote:<br class=""><blockquote type="cite" class="">Hi all,<br class=""><br class=""><br class="">I have business matter and will have to shorten the meeting tonight (half<br class="">an hour instead of 1h).<br class=""><br class="">I updated the SE doc and Antonio added useful annexes :<br class="">https://docs.google.com/document/d/1LgsGT-AAlrF72Z5pW4xNQiVjUHGUME46ZmB-wwF35Yw/edit?usp=sharing<br class=""><br class="">I propose we focus on this in these 30 mn<br class=""><br class="">regards,<br class=""><br class="">Antoine<br class="">_______________________________________________<br class="">cdi-dev mailing list<br class="">cdi-dev@lists.jboss.org<br class="">https://lists.jboss.org/mailman/listinfo/cdi-dev<br class=""><br class="">Note that for all code provided on this list, the provider licenses the<br class="">code under the Apache License, Version 2<br class="">(http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas<br class="">provided on this list, the provider waives all patent and other intellectual<br class="">property rights inherent in such information.<br class=""></blockquote><br class=""><br class="">_______________________________________________<br class="">cdi-dev mailing list<br class="">cdi-dev@lists.jboss.org<br class="">https://lists.jboss.org/mailman/listinfo/cdi-dev<br class=""><br class="">Note that for all code provided on this list, the provider licenses the code<br class="">under the Apache License, Version 2<br class="">(http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas<br class="">provided on this list, the provider waives all patent and other intellectual<br class="">property rights inherent in such information.<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">cdi-dev mailing list<br class="">cdi-dev@lists.jboss.org<br class="">https://lists.jboss.org/mailman/listinfo/cdi-dev<br class=""><br class="">Note that for all code provided on this list, the provider licenses the code<br class="">under the Apache License, Version 2<br class="">(http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas<br class="">provided on this list, the provider waives all patent and other intellectual<br class="">property rights inherent in such information.<br class=""></blockquote></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">cdi-dev mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><a href="mailto:cdi-dev@lists.jboss.org" class="">cdi-dev@lists.jboss.org</a></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" class="">https://lists.jboss.org/mailman/listinfo/cdi-dev</a></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">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" class="">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.</span></div></blockquote></div><br class=""></body></html>