001 package edu.calpoly.records.spring; 002 003 import java.util.ArrayList; 004 import java.util.List; 005 import java.util.Properties; 006 007 import org.kuali.common.util.execute.Executable; 008 import org.kuali.common.util.execute.ExecutablesExecutable; 009 import org.kuali.maven.plugins.spring.MavenConstants; 010 import org.springframework.beans.factory.annotation.Autowired; 011 import org.springframework.beans.factory.annotation.Qualifier; 012 import org.springframework.context.annotation.Bean; 013 import org.springframework.context.annotation.Configuration; 014 import org.springframework.context.annotation.Import; 015 import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; 016 017 @Configuration 018 @Import(PrintMessageConfig.class) 019 public class PowerWebappConfig { 020 021 @Autowired 022 PrintMessageConfig pmc; 023 024 @Autowired 025 @Qualifier(MavenConstants.DEFAULT_MAVEN_PROPERTIES_BEAN_NAME) 026 Properties mavenProperties; 027 028 @Bean 029 public static PropertySourcesPlaceholderConfigurer pspc() { 030 return new PropertySourcesPlaceholderConfigurer(); 031 } 032 033 @Bean 034 public Executable showProperties() { 035 ShowPropertiesExecutable spe = new ShowPropertiesExecutable(); 036 spe.setProperties(mavenProperties); 037 return spe; 038 } 039 040 @Bean(initMethod = "execute") 041 public Executable executablesExecutable() { 042 List<Executable> executables = new ArrayList<Executable>(); 043 executables.add(pmc.printMessageExecutable()); 044 executables.add(showProperties()); 045 046 ExecutablesExecutable ee = new ExecutablesExecutable(); 047 ee.setExecutables(executables); 048 return ee; 049 } 050 }