Niclas Hedhman wrote:

On Monday 03 October 2005 08:23, Ralph Goers wrote:
1. Every bundle should have its own URL handlers.

Incorrect. A bundle can install URL handlers, which is made available to all other bundles. And those can use it without the service interfaces, i.e.

URL abc = new URL( "my://special/url" );
InputStream in = abc.opneStream();
OK. That makes it tougher. So if two bundles want to register the same protocol I guess one of them loses?

So why not just maintain the list of stream handlers and content for the
bundle in the Bundle implementation object?  Then your proxy could just
look at that to determine if the protocol is supported.

Because the above is dictated by the
static public void URL.setURLStreamHandlerFactory(URLStreamHandlerFactory fac) method.

The JVM only allows it to be set once, not reset, JVM wide, and the JVM will cache the URLStreamHandlers that the factory produces forever. IMHO, very nasty, and I am surprised that Sun hasn't done something about it over all these years.
I don't understand why this is a problem. I was under the impression that OSGi would always be returning a proxy stream handler that is basically the same for every protocol. So it is the proxy that needs the list of handlers, not the JVM. Am I misunderstanding section 11.3.1?

Ralph

Reply via email to