1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.sql.spring;
17
18 import java.util.List;
19
20 import com.google.common.collect.Lists;
21 import org.kuali.common.jdbc.project.spring.JdbcPropertyLocationsConfig;
22 import org.kuali.common.util.properties.Location;
23 import org.kuali.common.util.properties.PropertiesService;
24 import org.kuali.common.util.properties.spring.DefaultPropertiesServiceConfig;
25 import org.kuali.common.util.spring.PropertySourceUtils;
26 import org.kuali.common.util.spring.service.PropertySourceConfig;
27 import org.springframework.beans.factory.annotation.Autowired;
28 import org.springframework.context.annotation.Bean;
29 import org.springframework.context.annotation.Configuration;
30 import org.springframework.context.annotation.Import;
31 import org.springframework.core.env.PropertySource;
32
33
34
35
36
37
38 @Configuration
39 @Import({ SourceSqlProjectConfig.class, SourceSqlPropertyLocationsConfig.class, JdbcPropertyLocationsConfig.class, DefaultPropertiesServiceConfig.class })
40 public class SourceSqlPSC implements PropertySourceConfig {
41
42
43
44
45 @Autowired
46 JdbcPropertyLocationsConfig jdbcConfig;
47
48
49
50
51 @Autowired
52 SourceSqlPropertyLocationsConfig sourceSqlConfig;
53
54
55
56
57 @Autowired
58 PropertiesService service;
59
60
61
62
63
64
65
66
67 @Override
68 @Bean
69 public PropertySource<?> propertySource() {
70 List<Location> locations = Lists.newArrayList();
71
72 locations.addAll(jdbcConfig.jdbcPropertyLocations());
73 locations.addAll(sourceSqlConfig.riceSourceSqlPropertyLocations());
74
75 return PropertySourceUtils.getPropertySource(service, locations);
76 }
77
78 }