use of com.netflix.config.AggregatedConfiguration in project spring-cloud-netflix by spring-cloud.
the class ArchaiusAutoConfiguration method addArchaiusConfiguration.
private static void addArchaiusConfiguration(ConcurrentCompositeConfiguration config) {
if (ConfigurationManager.isConfigurationInstalled()) {
AbstractConfiguration installedConfiguration = ConfigurationManager.getConfigInstance();
if (installedConfiguration instanceof ConcurrentCompositeConfiguration) {
ConcurrentCompositeConfiguration configInstance = (ConcurrentCompositeConfiguration) installedConfiguration;
configInstance.addConfiguration(config);
} else {
installedConfiguration.append(config);
if (!(installedConfiguration instanceof AggregatedConfiguration)) {
log.warn("Appending a configuration to an existing non-aggregated installed configuration will have no effect");
}
}
} else {
ConfigurationManager.install(config);
}
}
use of com.netflix.config.AggregatedConfiguration in project ribbon by Netflix.
the class ClientPropertiesProcessor method exportPropertiesToArchaius.
private void exportPropertiesToArchaius(String groupName, IClientConfig config, String configName) {
Map<String, Object> map = config.getProperties();
Configuration configuration = ConfigurationManager.getConfigInstance();
if (configuration instanceof AggregatedConfiguration) {
AggregatedConfiguration ac = (AggregatedConfiguration) configuration;
configuration = ac.getConfiguration(configName);
if (configuration == null) {
configuration = new ConcurrentMapConfiguration();
ac.addConfiguration((AbstractConfiguration) configuration, configName);
}
}
for (Map.Entry<String, Object> entry : map.entrySet()) {
configuration.setProperty(groupName + "." + config.getNameSpace() + "." + entry.getKey(), entry.getValue());
}
}
Aggregations