Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-core-dev] setURLStreamHandlerFactory


Dorian,

You are correct.  For some reason I thought the public handler was accessed again in this scenario.  But there are other scenarios where plugins may construct a URL from a string.  I pretty sure some plugins are doing this with the platform: protocol.  I know that update configurator is using the public reference: protocol handler to construct URLs from strings to install bundles into the framework.  So the way we do reference installs would have to be redone without this support.

Thomas Watson



Dorian Birsan <birsan@xxxxxxxxxx>
Sent by: platform-core-dev-admin@xxxxxxxxxxx

06/17/2004 03:37 PM
Please respond to platform-core-dev

       
        To:        platform-core-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [platform-core-dev] setURLStreamHandlerFactory




So, when "buttonImage" is constructed, isn't it inheriting the handler from "images"  (which would be the private osgi URL stream handler) ?


-Dorian



Thomas Watson <tjwatson@xxxxxxxxxx>
Sent by: platform-core-dev-admin@xxxxxxxxxxx

06/17/2004 04:14 PM

Please respond to
platform-core-dev

To
platform-core-dev@xxxxxxxxxxx
cc
Subject
Re: [platform-core-dev] setURLStreamHandlerFactory








We have lots of usecases where plugins are given a URL from either an OSGi API or eclipse runtime API and then use these URL's as a context to another URL.  For example:


URL images = bundle.getEntry("images/");

URL buttonImage = new URL(images, "button.jpg");


To support these types of scenarios we must provide public protocols.


Thomas Watson


Dorian Birsan <birsan@xxxxxxxxxx>
Sent by: platform-core-dev-admin@xxxxxxxxxxx

06/17/2004 02:53 PM
Please respond to platform-core-dev

       
      To:        platform-core-dev@xxxxxxxxxxx

      cc:        

      Subject:        Re: [platform-core-dev] setURLStreamHandlerFactory






Are those protocols public? If they are for internal purposes only, then clients would not create such URL from a string, but will only pass already created (by the framework) URL's around.

In that case, the osgi implementation could create URL's using this constructor: URL(String protocol, String host, int port, String file,  URLStreamHandler handler), by passing the appropriate factory.


-Dorian

Thomas Watson <tjwatson@xxxxxxxxxx>
Sent by: platform-core-dev-admin@xxxxxxxxxxx

06/17/2004 03:41 PM

Please respond to
platform-core-dev


To
platform-core-dev@xxxxxxxxxxx
cc
Subject
Re: [platform-core-dev] setURLStreamHandlerFactory












Marius,


Unfortunately there is no way of preventing the Framework from calling these methods.  The URL HandlerFactories must be set by the Framework to support the OSGi URLStreamHandlerService.  The eclipse runtime depends on the URLStreamHandlerService to support all of its protocol handlers (i.e. platform: bundleentry: bundleresource: ect.).  Without support for these protocol handlers eclipse will not work.  The URLStreamHandlerService allows plugins within the Framework to dynamically add and remove protocol handlers in the runtime environment.


Thomas Watson
"Marius Gleeson" <platform-core-dev@xxxxxxxxxxxxxx>
Sent by: platform-core-dev-admin@xxxxxxxxxxx

06/17/2004 02:12 AM
Please respond to platform-core-dev

       
    To:        platform-core-dev@xxxxxxxxxxx

    cc:        

    Subject:        [platform-core-dev] setURLStreamHandlerFactory







Hi there,

Is there any way of stopping the framework from calling the
URL.setURLStreamHandlerFactory(URLStreamHandlerFactory fac) and
URLConnection.setContentHandlerFactory(ContentHandlerFactory fac)
methods ?

I have a tricky situation where I need to launch eclipse from within
another third party app which also calls these methods. Of course when
eclipse tries to set them an Error is thrown and the whole thing
crumbles.

Any ideas?
thanks,
Marius


_______________________________________________
platform-core-dev mailing list
platform-core-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-core-dev



Back to the top