public final class GuiceModuleServiceLoader extends Object implements GuiceModuleLoader
Will find and load all classes which extend the Guice AbstractModule or PrivateModule class and that are annotated with the provided annotation by using the Java ServiceLoader framework.
To register an AbstractModule with the ServiceLoader framework, create a file named, "com.google.inject.AbstractModule", under META-INF/services with a new line delimited list of the fully qualified names of the subtypes, in your jar/project, to be used to configure the Guice injector.
Any AbstractModule subtypes which are registered with the Java ServiceLoader by are not annotated with the provided annotation will be ignored and will not be included in the returned set of Guice Modules.
ServiceLoader
Modifier and Type | Method and Description |
---|---|
Set<Class<? extends com.google.inject.Module>> |
getGuiceModules(Class<? extends Annotation> moduleAnnotation)
Finds and loads all the Guice modules that will be used to configure the Guice injector instance.
|
public Set<Class<? extends com.google.inject.Module>> getGuiceModules(Class<? extends Annotation> moduleAnnotation)
getGuiceModules
in interface GuiceModuleLoader
moduleAnnotation
- The Annotation that all modules MUST be annotated with.Copyright © 2025 Open Identity Platform Community. All rights reserved.