Java Code Examples for org.eclipse.microprofile.config.spi.ConfigProviderResolver#getConfig()

The following examples show how to use org.eclipse.microprofile.config.spi.ConfigProviderResolver#getConfig() . 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: NativeImageLauncher.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private static Config installAndGetSomeConfig() {
    final SmallRyeConfig config = ConfigUtils.configBuilder(false).build();
    QuarkusConfigFactory.setConfig(config);
    final ConfigProviderResolver cpr = ConfigProviderResolver.instance();
    try {
        final Config installed = cpr.getConfig();
        if (installed != config) {
            cpr.releaseConfig(installed);
        }
    } catch (IllegalStateException ignored) {
    }
    return config;
}
 
Example 2
Source File: CustomInvokeWithJsonPProviderTest.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BeforeTest
public void setupClient() throws Exception {
    SmallRyeConfig config = ConfigUtils.configBuilder(true).build();
    QuarkusConfigFactory.setConfig(config);
    ConfigProviderResolver cpr = ConfigProviderResolver.instance();
    try {
        Config old = cpr.getConfig();
        if (old != config) {
            cpr.releaseConfig(old);
        }
    } catch (IllegalStateException ignored) {
    }
    super.setupClient();
}
 
Example 3
Source File: CustomInvokeWithJsonPProviderTest.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@AfterTest
public void tearDownClient() {
    ConfigProviderResolver cpr = ConfigProviderResolver.instance();
    try {
        Config old = cpr.getConfig();
        cpr.releaseConfig(old);
    } catch (IllegalStateException ignored) {
    }
}
 
Example 4
Source File: CustomInvokeWithJsonBProviderTest.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@BeforeTest
public void setupClient() throws Exception {
    SmallRyeConfig config = ConfigUtils.configBuilder(true).build();
    QuarkusConfigFactory.setConfig(config);
    ConfigProviderResolver cpr = ConfigProviderResolver.instance();
    try {
        Config old = cpr.getConfig();
        if (old != config) {
            cpr.releaseConfig(old);
        }
    } catch (IllegalStateException ignored) {
    }
    super.setupClient();
}
 
Example 5
Source File: CustomInvokeWithJsonBProviderTest.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@AfterTest
public void tearDownClient() {
    ConfigProviderResolver cpr = ConfigProviderResolver.instance();
    try {
        Config old = cpr.getConfig();
        cpr.releaseConfig(old);
    } catch (IllegalStateException ignored) {
    }
}