Multiple entry points requirement
David M. Lloyd
david.lloyd at redhat.com
Wed Jun 29 16:41:36 PDT 2011
On 06/28/2011 08:07 PM, Mandy Chung wrote:
> I think the multiple entry points should be added to the requirement.
> There are several tools in the JDK that would be best if they can be
> packaged in a single module with multiple entry points. For example,
> jps, jstat, jstack, jmap, etc are the JDK command-line tools that are in
> tools.jar and each has its own entry point. Each of the tool has only
> one or few classes and they are diagnosability tools that make sense to
> be packaged and installed together. The JDK would benefit from the
> multiple entry points to avoid unnecessary fine-grained modules.
> On 6/29/11 2:10 AM, Alex Buckley wrote:
>> I recall discussion of different entrypoints when a module is used in
>> different contexts, e.g. applet v. command-line launcher.
>> However, the Java Module System requirements don't say anything about
>> this, so I stuck with a solitary, unqualified 'class ...' construct in
>> the module declaration. The closest "context-aware" requirement is
>> that a module "can be used both as a JAR on the class path and
>> installed as a module in a module library".
>> On 6/28/2011 10:41 AM, Roger Riggs wrote:
>>> Thanks for the writeup of jigsaw modules.
>>> This is more of a comment on the module compilation unit grammar
>>> and the choice of keywords and semantics.
>>> The "class" keyword in the module-info.java sticks out as an awkward
>>> There are plenty of classes in the module. The significance the class
>>> is that it is a/the main class. The keyword should identify the usage
>>> of the class.
>>> "main" would be more meaningful and intuitive.
>>> The "class" keyword is being overloaded. While it identifies a main
>>> class it is
>>> also being used to indicate module is the root of the static context for
>>> the module as a whole and the class name is not relevant to that
>>> A separate keyword defining the module as requiring a static context
>>> would clearer to separate the semantics of the entry point from the
>>> Can a module, like a jar file could contain multiple classes with
>>> main methods?
>>> In current usage, for jar files, the main class can be given on the
>>> command line
>>> allowing multiple applications to share the overhead of packaging.
>>> Having a solitary entry point may result in extra overhead because
>>> each application
>>> must be in a separate module.
More information about the jigsaw-dev