1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.kuali.coeus.s2sgen.impl.generate;
20
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
23 import org.springframework.beans.BeansException;
24 import org.springframework.beans.factory.InitializingBean;
25 import org.springframework.context.ApplicationContext;
26 import org.springframework.context.ApplicationContextAware;
27 import org.springframework.stereotype.Component;
28
29 import java.util.Map;
30
31 @Component("generatorInitializer")
32 public class GeneratorInitializerImpl implements GeneratorInitializer, ApplicationContextAware, InitializingBean {
33
34 private static final Logger LOG = LoggerFactory.getLogger(GeneratorInitializerImpl.class);
35
36 private ApplicationContext applicationContext;
37
38 @Override
39 public void initialize() {
40 final Map<String, S2SFormGenerator> map = applicationContext.getBeansOfType(S2SFormGenerator.class);
41 LOG.info("Found the following generators: " + map.keySet());
42 }
43
44 @Override
45 public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
46 this.applicationContext = applicationContext;
47 }
48
49 @Override
50 public void afterPropertiesSet() throws Exception {
51 initialize();
52 }
53 }