Interface ConfigSourceProvider
-
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 aMETA-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider
file which contains the fully qualified classname of the custom ConfigSourceProvider.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Iterable<ConfigSource>
getConfigSources(java.lang.ClassLoader forClassLoader)
Return the collection ofConfigSource
s.
-
-
-
Method Detail
-
getConfigSources
java.lang.Iterable<ConfigSource> getConfigSources(java.lang.ClassLoader forClassLoader)
Return the collection ofConfigSource
s. For each e.g. property file, we return a single ConfigSource or an empty list if no ConfigSource exists.- Parameters:
forClassLoader
- the classloader which should be used if any is needed- Returns:
- the
ConfigSources
to register within theConfig
.
-
-