Skip to content

Commit

Permalink
add loader for ConfigProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Feb 19, 2024
1 parent 655d2e6 commit c1534b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Comparing source compatibility of against
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder (not serializable)
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder setComponentLoader(io.opentelemetry.sdk.autoconfigure.ComponentLoader)
+++* NEW INTERFACE: PUBLIC(+) ABSTRACT(+) io.opentelemetry.sdk.autoconfigure.ComponentLoader (not serializable)
+++ NEW INTERFACE: PUBLIC(+) ABSTRACT(+) io.opentelemetry.sdk.autoconfigure.ComponentLoader (not serializable)
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
+++ NEW SUPERCLASS: java.lang.Object
+++* NEW METHOD: PUBLIC(+) ABSTRACT(+) java.lang.Iterable<T> load(java.lang.Class<T>)
+++ NEW METHOD: PUBLIC(+) ABSTRACT(+) java.lang.Iterable<T> load(java.lang.Class<T>)
GENERIC TEMPLATES: +++ T:java.lang.Object
+++* NEW METHOD: PUBLIC(+) java.util.Map<java.lang.String,T> loadConfigurableProviders(java.lang.Class<T>)
+++ NEW METHOD: PUBLIC(+) java.util.Map<java.lang.String,T> loadConfigurableProviders(java.lang.Class<T>)
GENERIC TEMPLATES: +++ T:io.opentelemetry.sdk.autoconfigure.spi.ConfigurableProvider
+++* NEW METHOD: PUBLIC(+) java.util.Optional<T> loadOptional(java.lang.Class<T>)
+++ NEW METHOD: PUBLIC(+) java.util.Optional<T> loadOptional(java.lang.Class<T>)
GENERIC TEMPLATES: +++ T:java.lang.Object
+++* NEW METHOD: PUBLIC(+) java.util.List<T> loadOrdered(java.lang.Class<T>)
+++ NEW METHOD: PUBLIC(+) java.util.List<T> loadOrdered(java.lang.Class<T>)
GENERIC TEMPLATES: +++ T:io.opentelemetry.sdk.autoconfigure.spi.Ordered
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,19 @@ private ConfigProperties getConfig() {
}

private ConfigProperties computeConfigProperties() {
DefaultConfigProperties properties = DefaultConfigProperties.create(propertiesSupplier.get());
for (Function<ConfigProperties, Map<String, String>> customizer : propertiesCustomizers) {
Map<String, String> overrides = customizer.apply(properties);
properties = properties.withOverrides(overrides);
}
return properties;
return spiHelper
.loadOptional(ConfigProperties.class)
.orElseGet(
() -> {
DefaultConfigProperties properties =
DefaultConfigProperties.create(propertiesSupplier.get());
for (Function<ConfigProperties, Map<String, String>> customizer :
propertiesCustomizers) {
Map<String, String> overrides = customizer.apply(properties);
properties = properties.withOverrides(overrides);
}
return properties;
});
}

// Visible for testing
Expand Down

0 comments on commit c1534b5

Please sign in to comment.