On Wednesday 17 August 2005 22:09, Daniel Fagerstrom wrote: > > And BTW, unless I missed something I haven't seen an explicit > > reference to the "bundle:" protocol in the OSGi specs, at least in R3. > > Didn't found it either, maybe it is Knopflerfish specific. But even if > it is, the OSGi api have no direct ways for accessing a resource from > any bundle, you must specify from what bundle you want to read a > resource. Maybe there is a way to do it in some more indirect way.
It is probably a protocol available to be 'installed' at your own leisure (i.e. the core beauty of OSGi). I have not bothered with it. Since a protocol is a Service, I assume that the ServiceFactory mechanism would also work, in which case a protocol could "extract" context information from the "requesting bundle" and use that to tailor the resulting connection, including retrieving resources from with that client bundle. I have not tested this for URLs but using something along those line in a Log4J bundle, where the "default config" for a bundle is retrieved from the requesting bundle. I think quite a fair bit in Cocoon should use URLs and custom protocols, and implement those through the OSGi URL service mechanism. Cheers Niclas
