use of org.springframework.beans.factory.config.PropertiesFactoryBean in project spring-integration by spring-projects.
the class StoredProcInvalidConfigsTests method bootStrap.
private ApplicationContext bootStrap(String configProperty) throws Exception {
PropertiesFactoryBean pfb = new PropertiesFactoryBean();
pfb.setLocation(new ClassPathResource("org/springframework/integration/jdbc/config/stored-proc-invalid-configs.properties"));
pfb.afterPropertiesSet();
Properties prop = pfb.getObject();
StringBuilder buffer = new StringBuilder();
buffer.append(prop.getProperty("xmlheaders")).append(prop.getProperty(configProperty)).append(prop.getProperty("xmlfooter"));
ByteArrayInputStream stream = new ByteArrayInputStream(buffer.toString().getBytes());
GenericApplicationContext ac = new GenericApplicationContext();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(ac);
reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
reader.loadBeanDefinitions(new InputStreamResource(stream));
ac.refresh();
return ac;
}
use of org.springframework.beans.factory.config.PropertiesFactoryBean in project GMM by Katharsas.
the class ApplicationConfiguration method config.
/**
* Expose to <spring:eval expression="@config.getProperty(...)" in jsps
*/
@Bean
public PropertiesFactoryBean config() {
final PropertiesFactoryBean factory = new PropertiesFactoryBean();
factory.setLocation(new ClassPathResource("meta.properties"));
return factory;
}
use of org.springframework.beans.factory.config.PropertiesFactoryBean in project onebusaway-application-modules by camsys.
the class PropertiesBeanPostProcessor method postProcessAfterInitialization.
public Object postProcessAfterInitialization(Object obj, String beanName) throws BeansException {
if (_properties != null && _targets.contains(beanName)) {
if (obj instanceof Properties) {
Properties properties = (Properties) obj;
properties.putAll(_properties);
} else if (obj instanceof PropertiesFactoryBean) {
PropertiesFactoryBean factory = (PropertiesFactoryBean) obj;
System.out.println(factory);
}
}
return obj;
}
use of org.springframework.beans.factory.config.PropertiesFactoryBean in project TranslateIt-api by zunpiau.
the class DataConfig method jdbcProperties.
@Bean(name = "jdbcProperties")
public PropertiesFactoryBean jdbcProperties() {
PropertiesFactoryBean bean = new PropertiesFactoryBean();
bean.setLocations(new ClassPathResource(MessageFormat.format("jdbc-{0}.properties", profile)));
return bean;
}
use of org.springframework.beans.factory.config.PropertiesFactoryBean in project new-cloud by xie-summer.
the class QuartzConfigration method quartzProperties.
@Bean
public Properties quartzProperties() throws IOException {
PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
propertiesFactoryBean.setLocation(new ClassPathResource(quartzConfig));
propertiesFactoryBean.afterPropertiesSet();
return propertiesFactoryBean.getObject();
}
Aggregations