This project is a proof of concept related to how you can integrate PF4J with Java Platform Modules System that comes with Java 9.
What I think/feel that are possible:
- a
Module
from JPMS is equivalent with aPlugin
from PF4J - read plugin metadata from
module-info.java
(module-info.class), that means to write a custom PluginDescriptorFinder - read extensions-points and extensions from
module-info.java
, that means to write a custom ExtensionFinder
When required, PF4J can be forced to use a single class loader for all plugins (the default is to use a class loader for each plugin) via DefaultPluginLoader.createPluginClassLoader(Path pluginPath, PluginDescriptor pluginDescriptor) (returns the same instance).
TODO: add other ideas
- In JPMS, the syntax for indicating dependency in a module is asymmetric - you export a package, but require a module.
- In JPMS you export only some packages from a module.
PF4J uses SemVer but JPMS not. A possible solution is to abstract the work with versions in aResolved by pf4j/pf4j#155.VersionManager
(interface) and to have the possibility to inject a custom version manager inPluginManager
.- find a resource
- PF4J project
- JPMS very simple demo based on PF4J demo
- JEP 261: Module System