Package org.apache.cayenne.di.spi
Class ModuleLoader
java.lang.Object
org.apache.cayenne.di.spi.ModuleLoader
Auto-loads DI modules using ServiceLoader. To make a module auto-loadable, you will need to ship the jar with a file
"META-INF/services/<full.provider.class.name>" that contains provider implementation for the module in
question.
- Since:
- 4.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionload
(Class<? extends ModuleProvider> providerClass) Auto-loads all modules declared on classpath.load
(Class<? extends ModuleProvider> providerClass, ClassLoader classLoader) Auto-loads all modules declared on classpath.
-
Constructor Details
-
ModuleLoader
public ModuleLoader()
-
-
Method Details
-
load
Auto-loads all modules declared on classpath. Modules are loaded from the SPI declarations stored in "META-INF/services/<full.provider.class.name>", and then sorted in the order of override dependency.- Returns:
- a sorted collection of auto-loadable modules.
- Throws:
DIRuntimeException
- if auto-loaded modules have circular override dependencies.
-
load
Auto-loads all modules declared on classpath. Modules are loaded from the SPI declarations stored in "META-INF/services/<full.provider.class.name>", and then sorted in the order of override dependency.- Returns:
- a sorted collection of auto-loadable modules.
- Throws:
DIRuntimeException
- if auto-loaded modules have circular override dependencies.- Since:
- 4.2
-