felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: URL Handlers Service
Date Mon, 03 Oct 2005 03:42:14 GMT
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();

> 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) 

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.

> so what I am suggesting might not make any sense.

No, but that is Ok. :o)


View raw message