<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 14 Aug 2009, at 09:42, Vladimir Blagojevic wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 13/08/09 5:27 PM, Manik Surtani wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">I've mentioned these in a previous email, reiterating here for the record:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">1. &nbsp;XSD should be generated before the test suite is run. Perhaps in the pre-test or post-compile phase.<br></blockquote><blockquote type="cite">2. &nbsp;The code should skip loading the schema if schema validation is disabled, following this algorithm:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">validating = system property "infinispan.config.validate", defaults to true.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">schema file = system property "infinispan.config.schema", defaults to schemas/infinispan-config-4.0.xsd<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">schema URL = system property "infinispan.config.schema.url" defaults to <a href="http://www.jboss.org/infinispan/infinispan-config-4.0.xsd">http://www.jboss.org/infinispan/infinispan-config-4.0.xsd</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">if (validating) {<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">1. &nbsp;try and load schema file from classpath<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">2. &nbsp;else, try and load schema file on file system<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">3. &nbsp;else, try and load from schema URL<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">4. &nbsp;else, throw an exception!<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">}<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">3. &nbsp;The unit test suite should *not* attempt to skip schema validation. &nbsp;This will, on one level, test schema validation code, and on another, ensure all sample cfg files we ship with are valid.<br></blockquote><blockquote type="cite">4. &nbsp;We should document the above system properties. &nbsp;Javadoc for Configuration could be one place, but also on the wiki.<br></blockquote><blockquote type="cite"><br></blockquote>Ok let me get this right this time. We should keep both static factories in Infinispan configuration, right? The first one where only configuration file reference is provided and the other where both configuration and schema file reference are provided. Call them factory 1 and factory 2 respectively.<br><br>Now, for factory 1, you are saying that even though schema reference is not provided the above mentioned schema lookup algorithm would be run? What about factory 2? Should only provided reference be looked up and/or if it fails should the default be looked up? Or should we just have a factory without possibility to provided reference for schema file?<br><br>Is there some JBoss standard to follow?<br><br>Let me know<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>Hmm, no I didn't mean &gt; 1 factory. &nbsp;Quite simply, DefaultCacheManager:210 could do something like:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>initialize(InfinispanConfiguration.newInfinispanConfiguration(configurationFile, InfinispanConfiguration.locateSchema()));</div><div><br></div><div>and InfinispanConfiguration.locateSchema() would follow a few simple steps in trying to locate a schema:</div><div><br></div><div>1.&nbsp;&nbsp;Initialise&nbsp;system&nbsp;vars:&nbsp;validating = system property "infinispan.config.validate", defaults to true.&nbsp;&nbsp;schema file = system property "infinispan.config.schema", defaults to schemas/infinispan-config-4.0.xsd.&nbsp;&nbsp;schema URL = system property "infinispan.config.schema.url" defaults to <a href="http://www.jboss.org/infinispan/infinispan-config-4.0.xsd">http://www.jboss.org/infinispan/infinispan-config-4.0.xsd</a></div><div><br></div><div>2. &nbsp;if ! validating, return null.</div><div>3. &nbsp;if (stream = FileLookup.lookupFile(schema file) != null) return stream</div><div>4. &nbsp;if (stream = new URL(schema url).openStream() != null) return stream</div><div>5. &nbsp;return null</div><blockquote type="cite"><div><blockquote type="cite"></blockquote><blockquote type="cite"></blockquote></div></blockquote><div><br></div><div>HTH</div><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div>Lead, Infinispan</div><div>Lead, JBoss Cache</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><a href="http://www.jbosscache.org">http://www.jbosscache.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>