Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » registering a URLStreamHandlerService as osgi service does no longer work
registering a URLStreamHandlerService as osgi service does no longer work [message #48344] Mon, 30 May 2005 06:47 Go to next message
Eclipse UserFriend
Originally posted by: egglersim.post.ch

i have replaced the standart sun https handler with my own handler by
implementing the URLStreamHandlerService and registering it as a osgi
service:

Hashtable properties = new Hashtable(1);
properties.put(URLConstants.URL_HANDLER_PROTOCOL, new
String[]{Handler.PROTOCOL});
String serviceClass = URLStreamHandlerService.class.getName();
BundleContext context = //got it from the bundle's activator
start method;
context.registerService(serviceClass, new Handler(), properties);


it has been working fine with the 3.1 releases up to the m6 build. from
m7 on, it stopped working.

it hasn't been mentioned on any release note, any clues?

help is greatly apreciated.
cheers,
simon
Re: registering a URLStreamHandlerService as osgi service does no longer work [message #48403 is a reply to message #48344] Tue, 31 May 2005 04:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: skaegi.sympatico.ca

Hi Simon,

It looks like there was a related bug fix done in
org.eclipse.osgi.framework.internal.protocol.StreamHandlerFa ctory as you say
between M6 and M7.

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.osgi/co re/framework/org/eclipse/osgi/framework/internal/protocol/St reamHandlerFactory.java.diff?r1=1.11&r2=1.12

In an OSGi environment built in handlers take priority over handlers from
the service registry. To make this work the implementation ends up having to
look in <system default package>.<protocol>.Handler -- this is where the
"sun.net.www.protocol" bit comes in.

Hope this helps identify the problem at least,
(another) Simon

Note: I'm no expert in this area but the "sun.net.www.protocol" isn't in the
public API -- the details of the lookup are somewhat implementation
dependent and typically buried in the java.net.URL class so this looks like
a best effort approach.


"Simon F. Eggler" <egglersim@post.ch> wrote in message
news:429ab6fc$1@news.post.ch...
> i have replaced the standart sun https handler with my own handler by
> implementing the URLStreamHandlerService and registering it as a osgi
> service:
>
> Hashtable properties = new Hashtable(1);
> properties.put(URLConstants.URL_HANDLER_PROTOCOL, new
> String[]{Handler.PROTOCOL});
> String serviceClass = URLStreamHandlerService.class.getName();
> BundleContext context = //got it from the bundle's activator
> start method;
> context.registerService(serviceClass, new Handler(), properties);
>
>
> it has been working fine with the 3.1 releases up to the m6 build. from
> m7 on, it stopped working.
>
> it hasn't been mentioned on any release note, any clues?
>
> help is greatly apreciated.
> cheers,
> simon
Re: registering a URLStreamHandlerService as osgi service does no longer work [message #48437 is a reply to message #48403] Tue, 31 May 2005 07:07 Go to previous message
Eclipse UserFriend
Originally posted by: egglersim.post.ch

Simon,

They will revert the URLStreamHandlerFactory behaviour to pre-M7, see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=97175.

Cheers,
Simon


Simon Kaegi wrote:
> Hi Simon,
>
> It looks like there was a related bug fix done in
> org.eclipse.osgi.framework.internal.protocol.StreamHandlerFa ctory as you say
> between M6 and M7.
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.osgi/co re/framework/org/eclipse/osgi/framework/internal/protocol/St reamHandlerFactory.java.diff?r1=1.11&r2=1.12
>
> In an OSGi environment built in handlers take priority over handlers from
> the service registry. To make this work the implementation ends up having to
> look in <system default package>.<protocol>.Handler -- this is where the
> "sun.net.www.protocol" bit comes in.
>
> Hope this helps identify the problem at least,
> (another) Simon
>
> Note: I'm no expert in this area but the "sun.net.www.protocol" isn't in the
> public API -- the details of the lookup are somewhat implementation
> dependent and typically buried in the java.net.URL class so this looks like
> a best effort approach.
>
>
> "Simon F. Eggler" <egglersim@post.ch> wrote in message
> news:429ab6fc$1@news.post.ch...
>
>>i have replaced the standart sun https handler with my own handler by
>>implementing the URLStreamHandlerService and registering it as a osgi
>>service:
>>
>> Hashtable properties = new Hashtable(1);
>> properties.put(URLConstants.URL_HANDLER_PROTOCOL, new
>>String[]{Handler.PROTOCOL});
>> String serviceClass = URLStreamHandlerService.class.getName();
>> BundleContext context = //got it from the bundle's activator
>>start method;
>> context.registerService(serviceClass, new Handler(), properties);
>>
>>
>>it has been working fine with the 3.1 releases up to the m6 build. from
>>m7 on, it stopped working.
>>
>>it hasn't been mentioned on any release note, any clues?
>>
>>help is greatly apreciated.
>>cheers,
>>simon
>
>
>
Previous Topic:Bundles, classloaders and the Factory Pattern
Next Topic:communication with an embedded RCP
Goto Forum:
  


Current Time: Fri Apr 26 14:01:08 GMT 2024

Powered by FUDForum. Page generated in 0.02287 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top