Runtime impact on URL handlers

Stephen J. McConnell mcconnell at dpml.net
Fri Jul 31 09:24:13 PDT 2009


Hello everyone.

I've been reading through all of the JSR 294 and Jigsaw material with
interest. One of the questions I have had in the back of my mind (which
remains unresolved) is the impact that 294 and Jigsaw would have of URL
handler management.

As things stand in SE6, a URL handler must be installed as a part of a
static system classloader (unless an alternative system classloader is
defined in which case the alternative must be included in the system
classpath).  If we take a leap forward to Java 7 with modules, I would
like to get some clarification on how the following would work:

Sample Java source:

   URL url = URI.create( "link:part:org/acme/widget" ).toURL(); 
   Widget widget = (Widget) url.getContent( new Class[]{ Widget.class } );

In the above example we have some code which has a dependency on the
availability of a 'link' protocol handler.  Under my SE6 implementation
this works providing the class executes in a JVM with the link handler
installed as a system extension.  

In a Java 7/294/Jigsaw world, 

(a) will it be possible to define a module that has a declared 
    dependency on a system-level module (i.e. the link protocol 
    handler module described above), and

(b) will it be possible to load the consumer module (the module 
    containing the sample code) into a runing JVM with assurance 
    that the system level protocol handler will be available (in 
    effect dynamically) to the Java URLHandler machinery?

Cheers, Steve.


-- 
Stephen J. McConnell
mailto:mcconnell at dpml.net
http://www.dpml.net
mobile: 04 5800 3980





More information about the jigsaw-dev mailing list