[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] URL Handler service and existing URLHandlers

You don't need to inherit from AbstractURLStreamHander. You just need to implement URLStreamHandlerService. So you can extend your URLStreamHandler and implement URLStreamHandlerService.

It's a bit of a pain because you will have to define public methods that then invoke the protected super version of the method. You will also need to do the realHandler trick that we do in AbstractURLStreamHandler.

Actually, the easiest thing to do is to copy AbstractURLStreamHandler and make it extend your class rather than URLStreamHandler.

The whole URL/Content handler design in Java is really screwed up, but since we have to work with it, we end up with these complicated solutions.

ben

Pascal Rapicault wrote:

Hi,

I have an existing URL Handler for which I can not change the implementation to make it inherits from AbstractURLStreamHandler.
How am I suppose to proceed to declare it has a service?

The concrete example is about handling of jndi urls written by apache (you can see it in the org.eclipse.tomcat plugin).

    PaScaL