Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
We need to borrow the central modularity feature from bootique.io - module auto-loading based on Java ServiceLoader:
1. Each module in Cayenne (or custom modules if a user so desires) will ship with "META-INF/services/org.apache.cayenne.di.spi.ModuleProvider" file that will contain the name of the provider class.
2. Provider will contain a factory method for the module, as well as a method that returns a collection of modules that this module "overrides"
3. There will be a loader class that will load all providers via "java.util.ServiceLoader", create modules for each provider and then sort them in the order of override dependencies.
4. ServerRuntimeBuilder will contain a method to turn auto-loading on and off. "on" will be the default.