Interface ConfigSourceFactory

All Known Subinterfaces:
ConfigSourceFactory.ConfigurableConfigSourceFactory<MAPPING>
All Known Implementing Classes:
AbstractLocationConfigSourceFactory, AbstractLocationConfigSourceLoader.ConfigurableProfileConfigSourceFactory, PropertiesLocationConfigSourceFactory

public interface ConfigSourceFactory
This ConfigSourceFactory allows to initialize a ConfigSource, with access to the current ConfigSourceContext.

The provided ConfigSource is initialized in priority order and the current ConfigSourceContext has access to all previous initialized ConfigSources. This allows the factory to configure the ConfigSource with all other ConfigSources available, except for ConfigSources initialized by another ConfigSourceFactory.

Instances of this interface will be discovered by SmallRyeConfigBuilder.withSources(ConfigSourceFactory...) via the ServiceLoader mechanism and can be registered by providing a META-INF/services/io.smallrye.config.ConfigSourceFactory which contains the fully qualified class name of the custom ConfigSourceFactory implementation.

  • Method Details

    • 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 a ConfigSource will use its own ordinal to determine the config lookup order.
      Returns:
      the priority value.