1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.config.spring.aggregation;
17
18 import java.util.List;
19 import java.util.Properties;
20
21 import org.kuali.common.util.spring.service.PropertySourceConfig;
22 import org.springframework.beans.factory.annotation.Autowired;
23 import org.springframework.context.annotation.Bean;
24 import org.springframework.context.annotation.Configuration;
25 import org.springframework.context.annotation.Import;
26 import org.springframework.core.env.PropertiesPropertySource;
27 import org.springframework.core.env.PropertySource;
28
29
30
31
32 @Deprecated
33 @Configuration
34 @Import({ org.kuali.common.util.config.spring.ConfigServiceConfig.class })
35 public class ConfigPropertySourceConfig implements PropertySourceConfig {
36
37 private static final String PROPERTY_SOURCE_NAME = "configPropertySource";
38
39 @Autowired
40 org.kuali.common.util.config.spring.ConfigServiceConfig configServiceConfig;
41
42 @Autowired
43 ConfigOverridesConfig configOverridesConfig;
44
45 @Autowired
46 ConfigIdsConfig configIdsConfig;
47
48 @Override
49 @Bean
50 public PropertySource<?> propertySource() {
51 org.kuali.common.util.config.service.ConfigService service = configServiceConfig.configService();
52 Properties overrides = configOverridesConfig.configOverrideProperties();
53 List<String> configIds = configIdsConfig.configIds();
54 Properties properties = service.getProperties(configIds, overrides);
55 return new PropertiesPropertySource(PROPERTY_SOURCE_NAME, properties);
56 }
57
58 }