public interface ConfigSourceProvider
Implement this interfaces to provide multiple ConfigSources. This is e.g. needed if there are multiple property files of a given name on the classpath but they are not all known at compile time.
If a single ConfigSource exists, then there is no need
to register it using a custom implementation of ConfigSourceProvider, it can be
registered directly as a ConfigSource
.
A ConfigSourceProvider will get picked up via the
ServiceLoader
mechanism and can be registered by providing a
META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider
file which contains
the fully qualified classname of the custom ConfigSourceProvider.
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<ConfigSource> |
getConfigSources(java.lang.ClassLoader forClassLoader)
Return the collection of
ConfigSource s. |
java.lang.Iterable<ConfigSource> getConfigSources(java.lang.ClassLoader forClassLoader)
ConfigSource
s.
For each e.g. property file, we return a single ConfigSource or an empty list if no ConfigSource exists.forClassLoader
- the classloader which should be used if any is neededConfigSources
to register within the Config
.