1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.config.spring;
17
18 import java.util.Collections;
19 import java.util.List;
20 import java.util.Properties;
21
22 import org.kuali.common.util.spring.SpringUtils;
23 import org.springframework.beans.factory.annotation.Autowired;
24 import org.springframework.context.annotation.Bean;
25 import org.springframework.context.annotation.Configuration;
26 import org.springframework.context.annotation.Import;
27 import org.springframework.core.env.PropertySource;
28
29
30
31
32 @Deprecated
33 @Configuration
34 @Import({ ConfigServiceConfig.class })
35 public class BasicPropertySourceConfig {
36
37 @Autowired
38 ConfigServiceConfig utilConfigServiceConfig;
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 protected List<String> getConfigIds() {
55 return Collections.emptyList();
56 }
57
58
59
60
61
62
63 protected Properties getOverrides() {
64 return new Properties();
65 }
66
67
68
69
70 protected PropertySource<?> getPropertySource() {
71 org.kuali.common.util.config.service.ConfigService service = utilConfigServiceConfig.configService();
72 List<String> configIds = getConfigIds();
73 Properties properties = service.getProperties(configIds, getOverrides());
74 return SpringUtils.getGlobalPropertySource(properties);
75 }
76
77 @Bean
78 public PropertySource<?> springPropertySource() {
79 return getPropertySource();
80 }
81
82 }