Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
1 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
package gov.va.med.ars.configuration;
import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
/**
* @author
DNS
*
*/
@Configuration
public class AppConfig {
// static final String props = System.getProperty("propFileLocation");
@Configuration
@Profile("default")
@ComponentScan(basePackages = "gov.va.med", excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "gov.va.med.ars.configuration.spring"))
@PropertySources({ @PropertySource("file:${arsPropFileLocation}"), @PropertySource("classpath:oauth.properties"),
@PropertySource("classpath:ValidationMessages.properties") })
@EnableCaching
@EnableAspectJAutoProxy
static class Defaults {
}
@Configuration
@Profile("dev")
@ComponentScan(basePackages = "gov.va.med", excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "gov.va.med.ars.configuration.spring"))
@PropertySources({ @PropertySource("file:${arsPropFileLocation}"),
@PropertySource("classpath:oauth.properties"), @PropertySource("classpath:ValidationMessages.properties"),
@PropertySource("classpath:port.properties") })
@EnableCaching
@EnableAspectJAutoProxy(proxyTargetClass = true)
static class Development {
}
@Configuration
@Profile("qa")
@ComponentScan(basePackages = "gov.va.med", excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "gov.va.med.ars.configuration.spring"))
@PropertySources({ @PropertySource("file:${arsPropFileLocation}"), @PropertySource("classpath:oauth.properties"),
@PropertySource("classpath:ValidationMessages.properties"), @PropertySource("classpath:port.properties") })
@EnableCaching
@EnableAspectJAutoProxy(proxyTargetClass = true)
static class Qa {
}
@Configuration
@Profile("sqa")
@ComponentScan(basePackages = "gov.va.med", excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "gov.va.med.ars.configuration.spring"))
@PropertySources({ @PropertySource("file:${arsPropFileLocation}"), @PropertySource("classpath:oauth.properties"),
@PropertySource("classpath:ValidationMessages.properties"), @PropertySource("classpath:port.properties") })
@ComponentScan(basePackages = "gov.va.med")
@EnableCaching
@EnableAspectJAutoProxy(proxyTargetClass = true)
static class Sqa {
}
@Configuration
@Profile("demo")
@ComponentScan(basePackages = "gov.va.med", excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "gov.va.med.ars.configuration.spring"))
@PropertySources({ @PropertySource("file:${arsPropFileLocation}"), @PropertySource("classpath:oauth.properties"),
@PropertySource("classpath:ValidationMessages.properties"), @PropertySource("classpath:port.properties") })
@EnableCaching
@EnableAspectJAutoProxy(proxyTargetClass = true)
static class Demo {
}
@Configuration
@Profile("production")
@ComponentScan(basePackages = "gov.va.med", excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "gov.va.med.ars.configuration.spring"))
@PropertySources({ @PropertySource("file:${arsPropFileLocation}"), @PropertySource("classpath:oauth.properties"),
@PropertySource("classpath:ValidationMessages.properties"), @PropertySource("classpath:port.properties") })
@EnableCaching
@EnableAspectJAutoProxy
static class Production {
}
/*
* @Autowired private Environment env;
*/
@Bean
public static PropertySourcesPlaceholderConfigurer placeholderCOnfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}
@Bean
public CacheManager cacheManager() {
return new ConcurrentMapCacheManager();
}
@Bean
public AnnotationAwareAspectJAutoProxyCreator annotationAwareAspectJAutoProxy() {
return new AnnotationAwareAspectJAutoProxyCreator();
}
}