1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.spring.service;
17
18 import org.kuali.common.util.spring.env.BasicEnvironmentService;
19 import org.kuali.common.util.spring.env.EnvironmentService;
20 import org.kuali.common.util.spring.env.model.EnvironmentServiceContext;
21 import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.context.annotation.Bean;
23 import org.springframework.context.annotation.Configuration;
24 import org.springframework.core.env.Environment;
25
26 @Configuration
27 public class SpringServiceConfig {
28
29 @Autowired
30 Environment env;
31
32 @Bean
33 public SpringService springService() {
34 return new DefaultSpringService();
35 }
36
37 @Bean
38 public PropertySourceService propertySourceService() {
39 return new DefaultPropertySourceService(springService());
40 }
41
42 @Bean
43 public EnvironmentService environmentService() {
44 EnvironmentServiceContext context = new EnvironmentServiceContext.Builder().env(env).build();
45 return new BasicEnvironmentService(context);
46 }
47 }