Chris Custine wrote:
>
> You should be able to create a new instance of CatalogManager and either
> set
> a path to your properties file or set the values you require on
> CatalogManager explicitly (catalog file, etc.) . Then pass this to your
> CatalogResolver instance, and so on...
>
> This will all occur in the classloader of your bundle so something along
> these lines should work.
>
> Chris
> --
> Chris Custine
> FUSESource :: http://fusesource.com
> My Blog :: http://blog.organicelement.com
> Apache ServiceMix :: http://servicemix.apache.org
> Apache Directory Server :: http://directory.apache.org
>
Thank you. This ended up being a workable solution. I had Spring pass in a
file URL to my custom camel component that pointed to
"classpath:catalog.xml". Internally, Spring transformed that into a bundle
reference, so the URL ended up looking like: "bundle://168.0:1/catalog.xml".
My custom camel component then used that to configure the CatalogResolver
and use it to manufacture XSLT endpoints.
For anyone who might be interested, here's an approximate example of what
the code looks like:
URL catalogFile = {URL passed in from Spring}
CatalogManager catalogManager = new CatalogManager();
catalogManager.setIgnoreMissingProperties(true);
Catalog catalog = catalogManager.getCatalog();
catalog.parseCatalog(catalogFile);
CatalogResolver entityResolver = new CatalogResolver(catalogManager);
--
View this message in context:
http://www.nabble.com/OSGi-Resource-loading-conundrum-tp22462718p22482275.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.