use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project alien4cloud by alien4cloud.
the class FullApplicationConfiguration method properties.
@Bean
public static PropertySourcesPlaceholderConfigurer properties(ResourceLoader resourceLoader) {
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
YamlPropertiesFactoryBean yaml = AlienYamlPropertiesFactoryBeanFactory.get(resourceLoader);
propertySourcesPlaceholderConfigurer.setProperties(yaml.getObject());
return propertySourcesPlaceholderConfigurer;
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project cas by apereo.
the class BeanDefinitionStoreFailureAnalyzerTests method createFailure.
private BeanDefinitionStoreException createFailure() {
val bf = new DefaultListableBeanFactory();
bf.registerBeanDefinition("testBean", genericBeanDefinition(CasServerProperties.class).addPropertyValue("name", "${not.defined}").getBeanDefinition());
val ppc = new PropertySourcesPlaceholderConfigurer();
try {
ppc.postProcessBeanFactory(bf);
} catch (final BeanDefinitionStoreException e) {
return e;
}
return null;
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project Asqatasun by Asqatasun.
the class PersistenceConfigTest method propertySourcesPlaceholderConfigurer.
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
yaml.setResources(new ClassPathResource("application-test.yml"));
propertySourcesPlaceholderConfigurer.setProperties(yaml.getObject());
return propertySourcesPlaceholderConfigurer;
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project chassis by Kixeye.
the class Application method createChildContext.
private void createChildContext() {
if (appMetadata.isWebapp()) {
applicationContext = new AnnotationConfigWebApplicationContext();
if (appMetadata.getConfigurationClasses().length > 0) {
((AnnotationConfigWebApplicationContext) applicationContext).register(appMetadata.getConfigurationClasses());
}
} else {
applicationContext = new AnnotationConfigApplicationContext();
if (appMetadata.getConfigurationClasses().length > 0) {
((AnnotationConfigApplicationContext) applicationContext).register(appMetadata.getConfigurationClasses());
}
}
applicationContext.setParent(bootstrapApplicationContext);
applicationContext.getEnvironment().getPropertySources().addFirst(new ArchaiusSpringPropertySource(appMetadata.getName() + "-archaius"));
PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
configurer.setEnvironment(applicationContext.getEnvironment());
applicationContext.addBeanFactoryPostProcessor(configurer);
applicationContext.setId(appMetadata.getName());
applicationContext.refresh();
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project chassis by Kixeye.
the class BootstrapConfiguration method propertySourcesPlaceHolderConfigurer.
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceHolderConfigurer() {
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
propertySourcesPlaceholderConfigurer.setNullValue("null");
return propertySourcesPlaceholderConfigurer;
}
Aggregations