1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.xml.spring;
17
18 import org.kuali.common.util.execute.Executable;
19 import org.kuali.common.util.spring.env.EnvironmentService;
20 import org.kuali.common.util.spring.event.ApplicationEventListenerConfig;
21 import org.kuali.common.util.spring.event.ExecutableApplicationEventListener;
22 import org.kuali.common.util.spring.service.SpringServiceConfig;
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.context.event.ContextRefreshedEvent;
28 import org.springframework.context.event.SmartApplicationListener;
29 import org.springframework.core.Ordered;
30
31
32
33
34
35
36
37 @Configuration
38 @Import({ SpringServiceConfig.class })
39 public class IngestXmlConfig implements ApplicationEventListenerConfig {
40
41 private static final String ORDER_KEY = "rice.ingest.order";
42
43
44
45
46 @Autowired
47 IngestXmlExecConfig config;
48
49
50
51
52 @Autowired
53 EnvironmentService env;
54
55
56
57
58 @Override
59 @Bean
60 public SmartApplicationListener applicationEventListener() {
61 Executable executable = config.ingestXmlExecutable();
62 Integer order = env.getInteger(ORDER_KEY, Integer.valueOf(Ordered.LOWEST_PRECEDENCE));
63
64 return ExecutableApplicationEventListener.builder(executable, ContextRefreshedEvent.class).order(order.intValue()).build();
65 }
66
67 }