Updates to new ConfigData method signatures
This commit is contained in:
@@ -29,6 +29,7 @@ import org.apache.commons.logging.Log;
|
||||
|
||||
import org.springframework.boot.context.config.ConfigData;
|
||||
import org.springframework.boot.context.config.ConfigDataLoader;
|
||||
import org.springframework.boot.context.config.ConfigDataLoaderContext;
|
||||
import org.springframework.boot.env.OriginTrackedMapPropertySource;
|
||||
import org.springframework.boot.origin.Origin;
|
||||
import org.springframework.boot.origin.OriginTrackedValue;
|
||||
@@ -68,8 +69,10 @@ public abstract class AbstractConfigDataLoader<L extends AbstractConfigDataLocat
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
// TODO: retry
|
||||
public ConfigData load(L location) throws IOException {
|
||||
public ConfigData load(ConfigDataLoaderContext context, L location)
|
||||
throws IOException {
|
||||
ConfigClientProperties properties = location.getProperties();
|
||||
// ConfigClientProperties properties =
|
||||
// this.defaultProperties.override(environment);
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.boot.SpringBootConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.context.config.ConfigData;
|
||||
import org.springframework.boot.context.config.ConfigDataLoaderContext;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
public class TestConfigServerConfigDataLoader
|
||||
@@ -40,12 +41,12 @@ public class TestConfigServerConfigDataLoader
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigData load(TestConfigServerConfigDataLocation location)
|
||||
throws IOException {
|
||||
public ConfigData load(ConfigDataLoaderContext context,
|
||||
TestConfigServerConfigDataLocation location) throws IOException {
|
||||
// This could be a RetryTemplate
|
||||
Function<TestConfigServerConfigDataLocation, ConfigData> fn = dataLocation -> {
|
||||
try {
|
||||
return super.load(dataLocation);
|
||||
return super.load(context, dataLocation);
|
||||
}
|
||||
catch (IOException e) {
|
||||
ReflectionUtils.rethrowRuntimeException(e);
|
||||
|
||||
@@ -134,7 +134,7 @@ public class NativeEnvironmentRepository
|
||||
try {
|
||||
ConfigurableEnvironment environment = getEnvironment(config, profile, label);
|
||||
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
|
||||
ConfigDataEnvironmentPostProcessor.applyTo(environment, resourceLoader,
|
||||
ConfigDataEnvironmentPostProcessor.applyTo(environment, resourceLoader, null,
|
||||
StringUtils.commaDelimitedListToStringArray(profile));
|
||||
|
||||
environment.getPropertySources().remove("config-data-setup");
|
||||
|
||||
Reference in New Issue
Block a user