org.eclipse.microprofile.config.spi.ConfigBuilder Java Examples

The following examples show how to use org.eclipse.microprofile.config.spi.ConfigBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultConfigBuilder.java    From microprofile-jwt-auth with Apache License 2.0 6 votes vote down vote up
@Override
public ConfigBuilder addDiscoveredSources() {
    boolean debugClassLoader = Boolean.getBoolean("config.seimpl.debugClassLoader");
    if(debugClassLoader) {
        System.out.printf("ClassLoader: %s\n", loader);
        if (loader instanceof URLClassLoader) {
            URLClassLoader urlClassLoader = (URLClassLoader) loader;
            URL[] urls = urlClassLoader.getURLs();
            for (URL url : urls) {
                System.out.printf("\t: %s\n", url);
            }
        }
    }
    ServiceLoader<ConfigSource> sources = ServiceLoader.load(ConfigSource.class, loader);
    int count = 0;
    for(ConfigSource cs : sources) {
        config.addConfigSource(cs);
        count ++;
    }
    System.out.printf("Discovered %d additional ConfigSource\n", count);
    return this;
}
 
Example #2
Source File: DefaultConfigBuilder.java    From microprofile-jwt-auth with Apache License 2.0 5 votes vote down vote up
@Override
public ConfigBuilder withSources(ConfigSource... sources) {
    for(ConfigSource cs : sources) {
        config.addConfigSource(cs);
    }
    return this;
}
 
Example #3
Source File: DefaultConfigBuilder.java    From microprofile-jwt-auth with Apache License 2.0 5 votes vote down vote up
@Override
public ConfigBuilder withConverters(Converter<?>[] converters) {
    for(Converter converter : converters) {
        config.addConverter(converter);
    }
    return this;
}
 
Example #4
Source File: RunningAppConfigResolver.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Override
public ConfigBuilder getBuilder() {
    return null;
}
 
Example #5
Source File: QuarkusAugmentor.java    From quarkus with Apache License 2.0 4 votes vote down vote up
public Builder setConfigCustomizer(Consumer<ConfigBuilder> configCustomizer) {
    this.configCustomizer = configCustomizer;
    return this;
}
 
Example #6
Source File: DefaultConfigProviderResolver.java    From microprofile-jwt-auth with Apache License 2.0 4 votes vote down vote up
@Override
public ConfigBuilder getBuilder() {
    return new DefaultConfigBuilder();
}
 
Example #7
Source File: DefaultConfigBuilder.java    From microprofile-jwt-auth with Apache License 2.0 4 votes vote down vote up
@Override
public ConfigBuilder addDefaultSources() {
    config.loadStandardSources(loader);
    return this;
}
 
Example #8
Source File: DefaultConfigBuilder.java    From microprofile-jwt-auth with Apache License 2.0 4 votes vote down vote up
@Override
public ConfigBuilder addDiscoveredConverters() {
    ServiceLoader<Converter> converters = ServiceLoader.load(Converter.class, loader);
    converters.forEach(converter -> config.addConverter(converter));
    return this;
}
 
Example #9
Source File: DefaultConfigBuilder.java    From microprofile-jwt-auth with Apache License 2.0 4 votes vote down vote up
@Override
public ConfigBuilder forClassLoader(ClassLoader loader) {
    this.loader = loader;
    return this;
}
 
Example #10
Source File: DefaultConfigBuilder.java    From microprofile-jwt-auth with Apache License 2.0 4 votes vote down vote up
@Override
public <T> ConfigBuilder withConverter(Class<T> type, int priority, Converter<T> converter) {
    config.addConverter(converter);
    return this;
}
 
Example #11
Source File: MockConfigProviderResolver.java    From microprofile-rest-client with Apache License 2.0 4 votes vote down vote up
@Override
public ConfigBuilder getBuilder() {
    return null;
}
 
Example #12
Source File: MockConfigProviderResolver.java    From cxf with Apache License 2.0 4 votes vote down vote up
@Override
public ConfigBuilder getBuilder() {
    throw new UnsupportedOperationException();
}
 
Example #13
Source File: MockConfigProviderResolver.java    From cxf with Apache License 2.0 4 votes vote down vote up
@Override
public ConfigBuilder getBuilder() {
    throw new UnsupportedOperationException();
}
 
Example #14
Source File: ExtensionLoader.java    From quarkus with Apache License 2.0 2 votes vote down vote up
/**
 * Load all the build steps from the given class loader.
 *
 * @param classLoader the class loader
 * @param launchMode the launch mode
 * @return a consumer which adds the steps to the given chain builder
 * @throws IOException if the class loader could not load a resource
 * @throws ClassNotFoundException if a build step class is not found
 */
public static Consumer<BuildChainBuilder> loadStepsFrom(ClassLoader classLoader, LaunchMode launchMode,
        Consumer<ConfigBuilder> configCustomizer)
        throws IOException, ClassNotFoundException {
    return loadStepsFrom(classLoader, new Properties(), launchMode, configCustomizer);
}