<html><head></head><body bgcolor="#FFFFFF"><div>Two points.&nbsp;</div><div><br></div><div>CDI will be a dependency of Bean Validation (see topic on injection).&nbsp;</div><div><br></div><div>What does not work today in the following code in a modular environment?</div><div><br></div><div><pre class="code-java" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; max-height: 30em; overflow-x: auto; overflow-y: auto; word-wrap: normal; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">Validation&nbsp;</span></font></pre><pre class="code-java" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; max-height: 30em; overflow-x: auto; overflow-y: auto; word-wrap: normal; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">&nbsp; &nbsp; .byDefaultProvider()&nbsp;</span></font></pre><pre class="code-java" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; max-height: 30em; overflow-x: auto; overflow-y: auto; word-wrap: normal; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">&nbsp; &nbsp; &nbsp; &nbsp; .providerResolver( myOSGiResolver )&nbsp;</span></font></pre><pre class="code-java" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; max-height: 30em; overflow-x: auto; overflow-y: auto; word-wrap: normal; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">&nbsp; &nbsp; &nbsp;.configure()</span></font><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">&nbsp;</span></font></pre><pre class="code-java" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; max-height: 30em; overflow-x: auto; overflow-y: auto; word-wrap: normal; "><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">&nbsp; &nbsp; &nbsp;.buildValidatorFactory();</span></font></pre><pre class="code-java" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; max-height: 30em; overflow-x: auto; overflow-y: auto; word-wrap: normal; "></pre>&nbsp;<br>On 31 oct. 2011, at 17:13, Gunnar Morling &lt;<a href="mailto:gunnar.morling@googlemail.com">gunnar.morling@googlemail.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div><blockquote type="cite"><span>So all JARs must be OSGi-ified before they can be used? [...]</span><br></blockquote><blockquote type="cite"><span>I'm asking because declaring dependencies means that all dependent JSRs (and</span><br></blockquote><blockquote type="cite"><span>the JDK) will need to be OSGi-ified as well. I'd rather see that coordinated</span><br></blockquote><blockquote type="cite"><span>by the Java EE expert group.</span><br></blockquote><span></span><br><span>In case of BV we would have to add the OSGi headers to the JAR to make</span><br><span>it usable under OSGi. As Kevin says there is no relation to the JDK</span><br><span>here, and AFAIK the BV API doesn't have any other additional</span><br><span>dependencies. So adding these headers wouldn't be a problem IMO (each</span><br><span>OSGi bundle is still a standard JAR which can be used in any other</span><br><span>environment).</span><br><span></span><br><span>Another thing is the bootstrapping, i.e. how BV implementations are</span><br><span>found. Searching for resources such as</span><br><span>META-INF/services/j.v.ValidationProvider doesn't work in OSGi (I don't</span><br><span>know about JBoss modules). This kind of things is in OSGi typically</span><br><span>solved using services, that means in the BV bundle would be the</span><br><span>definition of a service interface (we already have this with</span><br><span>ValidationProvider) while BV providers would register implementations</span><br><span>of this service. In the BV API Jar we still would need some glue</span><br><span>code/meta-data to obtain references to these implementations.</span><br><span></span><br><span>Personally I feel adding the headers would be ok for the "official"</span><br><span>API Jar as it's rather un-intrusive, but the bootstrapping stuff might</span><br><span>be too much. One idea might be to provide separate "enabler" modules</span><br><span>for the different module systems around, e.g. there could be a</span><br><span>bv-osgi.jar which takes the raw API jar and makes it usable under OSGi</span><br><span>(it could also offer j.v.Validator as OSGi service etc.).</span><br><span></span><br><span>--Gunnar</span><br><span></span><br><span>2011/10/28 Emmanuel Bernard &lt;<a href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a>&gt;:</span><br><blockquote type="cite"><span>So all JARs must be OSGi-ified before they can be used? Is there any way to</span><br></blockquote><blockquote type="cite"><span>keep this information outside?&nbsp;Do you know of any other JSR published JAR</span><br></blockquote><blockquote type="cite"><span>that also expose its OSGi headers?</span><br></blockquote><blockquote type="cite"><span>I'm asking because declaring dependencies means that all dependent JSRs (and</span><br></blockquote><blockquote type="cite"><span>the JDK) will need to be OSGi-ified as well. I'd rather see that coordinated</span><br></blockquote><blockquote type="cite"><span>by the Java EE expert group.&nbsp;There is also the problem of supporting them</span><br></blockquote><blockquote type="cite"><span>forever(tm).</span><br></blockquote><blockquote type="cite"><span>On 27 oct. 2011, at 22:52, Kevin Pollet wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Hi experts,</span><br></blockquote><blockquote type="cite"><span>IMHO, making Bean Validation ready for the modular world is a great thing!</span><br></blockquote><blockquote type="cite"><span>A first step might be to provide the module meta-datas (OSGi headers,</span><br></blockquote><blockquote type="cite"><span>…).&nbsp;For OSGi, those meta-datas can be added to the jar Manifest within the</span><br></blockquote><blockquote type="cite"><span>maven build with the&nbsp;maven-bundle-plugin. The advantage is that the api can</span><br></blockquote><blockquote type="cite"><span>be deployed in an OSGi container out of the box.&nbsp;For JBoss Modules the</span><br></blockquote><blockquote type="cite"><span>descriptor&nbsp;reside alongside its content but we can provide it.</span><br></blockquote><blockquote type="cite"><span>WDYT?</span><br></blockquote><blockquote type="cite"><span>--Kevin</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>_______________________________________________</span><br></blockquote><blockquote type="cite"><span>beanvalidation-dev mailing list</span><br></blockquote><blockquote type="cite"><span><a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a></span><br></blockquote><blockquote type="cite"><span><a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>_______________________________________________</span><br></blockquote><blockquote type="cite"><span>beanvalidation-dev mailing list</span><br></blockquote><blockquote type="cite"><span><a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a></span><br></blockquote><blockquote type="cite"><span><a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><span></span><br><span>_______________________________________________</span><br><span>beanvalidation-dev mailing list</span><br><span><a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a></span><br></div></blockquote></body></html>