Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there dynamic module discovery in JDK9?

In the upcoming Java 9, is there a way to dynamically discover which modules are available?

E.g.:

  1. Run some app with some module path
  2. While the app is running, add a few more modules into the module path (e.g. copy into module directories)
  3. From within the app, query "give me all available modules" (perhaps with a filter, such as those providing an alternate implementation of the same service)

I can't quite tell from the documentation.

like image 998
Johannes Ernst Avatar asked Jun 02 '17 19:06

Johannes Ernst


1 Answers

I don’t think such dynamic functionality is supported. Currently, the documentation of ModuleFinder.findAll() states:

A ModuleFinder provides a consistent view of the modules that it locates. If findAll is invoked several times then it will return the same (equals) result each time.

like image 113
VGR Avatar answered Sep 17 '22 23:09

VGR