Package io.smallrye.config
Interface ConfigSourceFactory
-
- All Known Implementing Classes:
AbstractLocationConfigSourceFactory,PropertiesLocationConfigSourceFactory
@Experimental("ConfigSource API Enhancements") public interface ConfigSourceFactoryThisConfigSourceFactoryallows to initialize aConfigSource, with access to the currentConfigSourceContext.The provided
ConfigSourceis initialized in priority order and the currentConfigSourceContexthas access to all previous initializedConfigSources. This allows the factory to configure theConfigSourcewith all otherConfigSourcesavailable, except forConfigSourcesinitialized by anotherConfigSourceFactory.Instances of this interface will be discovered by
SmallRyeConfigBuilder.withSources(ConfigSourceFactory...)via theServiceLoadermechanism and can be registered by providing aMETA-INF/services/io.smallrye.config.ConfigSourceFactorywhich contains the fully qualified class name of the customConfigSourceFactoryimplementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Iterable<org.eclipse.microprofile.config.spi.ConfigSource>getConfigSources(ConfigSourceContext context)default OptionalIntgetPriority()Returns the factory priority.
-
-
-
Method Detail
-
getConfigSources
Iterable<org.eclipse.microprofile.config.spi.ConfigSource> getConfigSources(ConfigSourceContext context)
-
getPriority
default OptionalInt getPriority()
Returns the factory priority. This is required, because the factory needs to be sorted before doing initialization. Once the factory is initialized, each aConfigSourcewill use its own ordinal to determine the config lookup order.- Returns:
- the priority value.
-
-