Am Donnerstag, den 11.10.2007, 22:10 +0200 schrieb Tobias Bocanegra: > > Therefore we always had the dream in Cocoon to use plain java.net > > classes to access any resource. In the last weeks I developed the > > excalibur jnet package which hopefully makes this dream come true in the > > near future. It is a package which is able to install own url handlers > > in a webapp environment and which is able to make source implementations > > available through java.net.URL class. The idea is to use well known api > > and classes to access custom stuff. Even for the XML streaming stuff, I > > created a prototype which (ab)uses the getContent(Class[]) method. > > i have some concerns if the java.net.URL stream handler works well > with the OSGI framework since the handlers/factory is a static field > in the URL class. i just remember some visibility issues.
Well actually, the OSGi core spec is well aware of the restrictions of the java.net.URL class allowing specifying the URLStreamHandlerFactory only once in a lifetime (of the VM). And therefore, there is a spec enabling bundles to register (and unregister) URLStreamHandlerFactories at will. Felix contains some basic implementation, which fails under certain circumstances, a first enhanced implementation of mine has not been used due to uncertainties regarding licensing (the implementation was developped looking very closely at the Eclipse implementation)... So implementing URLStreamHandlerFactories in an OSGi environment is not that big an issue as it is usually. But I agree with Roys remark of java.net.URL. If find it way to heavy, so using just a string for URI or the URI class (which just operates on a string level) might be a better way to go. Regards Felix Regards Felix