Loading an automatic module from an exploded directory

Alan Bateman Alan.Bateman at oracle.com
Fri Apr 10 15:00:06 UTC 2020


On 10/04/2020 11:14, Eirik Bjørsnøs wrote:
> :
> Since ModuleReader already has the list() method, code in java.lang.module
> could use that to scan for packages and service names it needs to derive
> automatic ModuleDescriptors.
>
> Clients would now only need to pass the custom module reader and a default
> automatic name:
>
> ModuleFinder moduleFinder = ModuleFinder.of(ModuleReader moduleReader,
> String defaultAutomaticModuleName);
>
> I would still have to create my custom module reader, but I would no longer
> need to know or care about the details of how automatic modules work.
>
> Something to consider?
>
This would require the API specify how automatic modules are created 
from the contents of "something" that already have a ModuleReader. 
Specification could be crafted of course but I have concerns that it 
goes beyond the original intention of automatic modules. That is, the 
original intention was to allow yesterday's JAR files be used as today 
modules. More sophisticated applications have the APIs to create 
automatic modules for other cases where needed. So I think it needs a 
bit more thought on whether additional APIs should be exposed.

-Alan.




More information about the jigsaw-dev mailing list