Proposal: #NonHierarchicalLayers
Remi Forax
forax at univ-mlv.fr
Thu Dec 8 14:22:27 UTC 2016
I fully agree with David here,
All these methods should be added.
Currently, if you want to implement in Java the equivalent of the Java launcher you need to add the module of your launcher in the exported list of the module that contains the main method.
You can do that by changing the export directive by writing a ModuleFinder that will acts as proxy and add the directive you want because if you are the creator of the Layer, you are controlling the ModuleDescriptor of all modules in the Layer too.
So adding these methods is just a convenience for module runtime developers, it doesn't add new capability compared to what can be done now
(that's not fully true because you can not represent the unnamed module in a module-info, BTW).
Rémi
----- Mail original -----
> De: "David M. Lloyd" <david.lloyd at redhat.com>
> À: "mark reinhold" <mark.reinhold at oracle.com>
> Cc: jpms-spec-experts at openjdk.java.net
> Envoyé: Jeudi 8 Décembre 2016 14:46:24
> Objet: Re: Proposal: #NonHierarchicalLayers
> On 12/07/2016 05:41 PM, mark.reinhold at oracle.com wrote:
>> 2016/12/6 20:43:00 -0800, david.lloyd at redhat.com:
>>> ...
>>>
>>> OK so my initial experiments indicate that I'd need at least a few more
>>> methods added to Layer.Controller to make this work. I did need a
>>> small-ish patch to let me get some tests working, which can be viewed at
>>> https://gist.github.com/dmlloyd/e3c114f0ac7595a93ecb63b1dbed5e00 and
>>> taken from there if these changes make sense (or I can bring this up on
>>> jigsaw-dev if that's where this discussion should take place).
>>
>> Could you please describe here, in plain text, what further methods you
>> think you need? For IP clarity any material you want this EG to consider
>> must be posted to this list or to related OpenJDK infrastructure.
>>
>> It'd be fine to discuss specific code patches on jigsaw-dev, but again
>> you'd need to include it directly rather than point to GitHub. This is
>> a design issue, though, so it's probably best to discuss it here first.
>
> Sure. I've added the following methods to Layer.Controller:
>
> public Controller addPackage(Module source, String pn) { ... }
> public Controller addOpens(Module source, String pn, Module target) { ... }
> public Controller addOpensToAll(Module source, String pn) { ... }
> public Controller addOpensToAllUnnamed(Module source, String pn) { ... }
> public Controller addExports(Module source, String pn, Module target) {
> ... }
> public Controller addExportsToAll(Module source, String pn) { ... }
> public Controller addExportsToAllUnnamed(Module source, String pn) { ... }
> public Controller addUses(Module source, Class<?> service) { ... }
>
> --
> - DML
More information about the jpms-spec-observers
mailing list