Legacy mode, module mode, mixed mode

Mandy Chung mandy.chung at oracle.com
Thu Jun 3 12:50:13 PDT 2010


On 06/03/10 10:10, Karen Kinnear wrote:
>>
>>
>> C) Mixed mode
>> C.a) A legacy application running with classpath and with third-party 
>> modules
>>
>>  This will be supported to ease migration to enable libraries to
>>  migrate to modules which legacy applications can continue to work.
>>
>>  This will require some change in the legacy applications to specify its
>>  required modules and versions.
>>
>>  One option is to extend the manifest of the legacy application jar 
>> file:
>>     Main-Class: com.greetings.Main
>>     Required-Modules: org.astro at 1.2.3
>>     Required-Platform-Modules: jdk.base, jdk.logging
>
> Do we also want to outline options for applications that use .jnlp or
> command-line without a jar file?

The jnlp applications are packaged as jar file.  I can add a note. The 
jnlp launcher would need to get the required modules from the manifest 
before launching the jnlp application.

For launching a class (rather than from -jar option), it will become 
clear when we define the interface for the custom launcher to use 
(currently I use the "sun.java.launcher.*" system properties).

>>
>> C) Mixed mode
>> C.a) A legacy class-path-based application to run with third-party
>>    modules
>>
>>  The legacy application will need to specify the required third-
>>  party modules and the legacy launcher needs to set up a configuration
>>  that resolves the specified dependencies at startup time.
>>  In addition, the application can also specify the platform modules
>>  it requires to override the default one.
> How?

As described above, add Required-Platform-Modules in the manifest.

>>
>>  A special class loader (say LegacyLoader) will be created for finding
>>  classes from the required modules.  LegacyLoader will be the
>>  parent class loader of the extension class loader so that the
>>  required modules will always be searched first.  The application
>>  class loader and extension class loader will continue to work as it is.
> I'm not sure I understand the overall search order when we mix
> legacy apps and modules.
>

My current thinking is to always search the modules first before the 
extension and application class loader.  The webrev in [1] should give 
you a better idea.  I still need to consider if the third-party modules 
be searched after the extension class path.

[1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2010-June/001061.html



More information about the jigsaw-dev mailing list