1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.metainf.spring;
17
18 import java.util.List;
19
20 import org.kuali.common.util.execute.Executable;
21 import org.kuali.common.util.metainf.model.MetaInfContext;
22 import org.kuali.common.util.metainf.service.MetaInfExecutable;
23 import org.kuali.common.util.metainf.service.MetaInfService;
24 import org.kuali.common.util.metainf.service.MetaInfUtils;
25 import org.kuali.common.util.spring.ExecutionConfig;
26 import org.kuali.common.util.spring.env.EnvironmentService;
27 import org.kuali.common.util.spring.service.SpringServiceConfig;
28 import org.springframework.beans.factory.annotation.Autowired;
29 import org.springframework.context.annotation.Bean;
30 import org.springframework.context.annotation.Configuration;
31 import org.springframework.context.annotation.Import;
32
33 @Configuration
34 @Import({ MetaInfServiceConfig.class, SpringServiceConfig.class })
35 public class MetaInfExecutableConfig implements ExecutionConfig {
36
37 @Autowired
38 EnvironmentService env;
39
40 @Autowired
41 MetaInfContextsConfig contextsConfig;
42
43 @Autowired
44 MetaInfService service;
45
46 @Override
47 @Bean(initMethod = "execute")
48 public Executable executable() {
49 boolean skip = env.getBoolean(MetaInfUtils.PROPERTY_PREFIX + ".skip", false);
50 List<MetaInfContext> contexts = contextsConfig.metaInfContexts();
51 return new MetaInfExecutable(contexts, service, skip);
52 }
53
54 }