module readability and exceptions in api
Michał Zegan
webczat_200 at poczta.onet.pl
Fri Oct 12 23:40:40 UTC 2018
W dniu 10.10.2018 o 22:09, Michał Zegan pisze:
>
>
> W dniu 10.10.2018 o 20:36, Alan Bateman pisze:
>> On 10/10/2018 17:43, Michał Zegan wrote:
>>> 2. What is the use for Module.addReads and
>>> ModuleLayer.Controller.addReads methods?
>> Module addReads is important when generating bytecode in your own module
>> with references to classes in modules that you don't read. Another
>> example is where you create method handles for a method in a class that
>> is a member of a module that you don't read.
Oh actually one question I forgot about: if I generate bytecode
accessing classes in modules that I don't read, and I call
Module.addReads on myself, I can then read the module with classes I
want to access, however my module's class loader probably will not
delegate to the other module's class loader for class loading, so how to
solve this situation? Creating my own class loader that loads the
bytecode would require to have separate module for the bytecode.
>>
>> The equivalent ModuleLayer.Controller addReads is the container case.
>> There was a recent thread here with Alex Svirivov where he's prototyping
>> creating a container creating a module layer for a web application. The
>> container may need to use addExports to export the web application entry
>> point to the container and (depending on how the container invokes the
>> web application entry point) it may need to read the module in the child
>> layer too.
>>
>> -Alan
More information about the jigsaw-dev
mailing list