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