in impl/src/main/java/org/apache/geronimo/config/DefaultConfigBuilder.java [113:155]
public Config build() {
List<ConfigSource> configSources = new ArrayList<>();
if (forClassLoader == null) {
forClassLoader = Thread.currentThread().getContextClassLoader();
if (forClassLoader == null) {
forClassLoader = DefaultConfigProvider.class.getClassLoader();
}
}
if (!ignoreDefaultSources) {
configSources.addAll(getBuiltInConfigSources(forClassLoader));
}
configSources.addAll(sources);
if (!ignoreDiscoveredSources) {
// load all ConfigSource services
ServiceLoader<ConfigSource> configSourceLoader = ServiceLoader.load(ConfigSource.class, forClassLoader);
configSourceLoader.forEach(configSources::add);
// load all ConfigSources from ConfigSourceProviders
ServiceLoader<ConfigSourceProvider> configSourceProviderLoader = ServiceLoader.load(ConfigSourceProvider.class, forClassLoader);
configSourceProviderLoader.forEach(configSourceProvider ->
configSourceProvider.getConfigSources(forClassLoader)
.forEach(configSources::add));
}
if (!ignoreDiscoveredConverters) {
ServiceLoader<Converter> converterLoader = ServiceLoader.load(Converter.class, forClassLoader);
converterLoader.forEach(converters::add);
}
ConfigImpl config = new ConfigImpl();
config.addConfigSources(configSources);
for (Converter<?> converter : converters) {
config.addConverter(converter);
}
for (PrioritisedConverter prioritisedConverter : prioritisedConverters.values()) {
config.addPrioritisedConverter(prioritisedConverter);
}
return config;
}