Review request: module view support

Mandy Chung mandy.chung at oracle.com
Wed Dec 14 09:27:24 PST 2011


Jon and I have implemented an initial support for module views [1].

This is the webrev for the jdk change (remaining work listed below):
   http://cr.openjdk.java.net/~mchung/jigsaw/webrevs/module-views.00/

[2] and [3] are the module-info.java files for the JDK before and
after views support.

Before the views support, in the current Jigsaw prototype, the JDK
is comprised of 63 modules.  With views, we fold the internal content
(i.e. "sun.*" module) into the "jdk.*" module as a view that gets
the JDK down to a total of 45 modules.

There are currently 39 tools in the JDK, each has its entry point.
Now multiple tools can be present in one single module and define
one view with an entry point for each tool.  For example, jdk.javac,
jdk.javap, jdk.javadoc are different views of the jdk.devtools module.
javac can be launched in module mode by specifying the view name:
   $ java -m jdk.javac

The Catalog (and SimpleLibrary) will find a module of a given
name.  A name can be either a module name and a view name.
To avoid the need of reading all module-info.class for each query,
the simple library extends the current layout and creates a
directory ${name}/${version}, for a view.  It currently stores
a copy of "info" (i.e. module-info.class) in the view directory
and we will explore other alternatives in the future, e.g. simply
store a file pointing to the path of its module.

There are remaining works to be completed including:
o exports
o repository to support views
o remove the launcher hack for multiple entry points support
o add more tests

Mandy
[1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2011-December/001800.html
[2] http://cr.openjdk.java.net/~mchung/jigsaw/webrevs/module-views.00/module-info/jdk-modules-no-views.txt
[3] http://cr.openjdk.java.net/~mchung/jigsaw/webrevs/module-views.00/module-info/jdk-modules-with-views.txt





More information about the jigsaw-dev mailing list