Hi all,

I have a problem related to URL Handlers for which I could not find a
hint or solution. If anyone could shed some light on this, I would be
very grateful.

I am currently building an application which uses Felix to implement
the OSGi framework. This application is intended to run in servlet
container as part of a Web Application. It is also intended that
multiple such Web Applications may be registered with the same servlet
container. As each Web Application has its own class loader hierarchy,
each Felix instance will have its own URL Handler registry - but only
the first instance will be successfull registrating the global Java VM
URL Handler Factories. Even worse, if the application is running
inside an Application Server, which itself registers URL Handler
Factories, not even the first Felix instance will be able to register.

Consequently I will probably have to disable global URL Handler
Factory registration, which leaves me with no way of supporting custom
URL handlers. In the spec, I could not find a hint on what would
happen in such a situation.

How about having a per-framework URL Handler registry just like the
URLHandlers class which is registered as a service. This service could
serve URLs and content handlers by calling the system URL factory
first (after checking for the "bundle:" protocol) and then the locally
registered handlers.

What do you think ?

Thanks for any more or better ideas.

Regards
Felix

Reply via email to