use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project kylo by Teradata.
the class Inspections method inspect.
public Object inspect(String path, String inspectionsPath, String isDevMode, String projectVersion) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
Configuration config = new DefaultConfiguration(path, inspectionsPath, isDevMode, projectVersion);
PropertySourcesPlaceholderConfigurer ppc = new PropertySourcesPlaceholderConfigurer();
ppc.setLocation(new FileSystemResource(config.getServicesConfigLocation()));
ppc.setIgnoreUnresolvablePlaceholders(true);
ppc.setIgnoreResourceNotFound(false);
ppc.postProcessBeanFactory(ctx.getBeanFactory());
ppc.setEnvironment(ctx.getEnvironment());
PropertySources sources = ppc.getAppliedPropertySources();
sources.forEach(source -> ctx.getEnvironment().getPropertySources().addLast(source));
ctx.scan("com.thinkbiganalytics.install.inspector.inspection", "com.thinkbiganalytics.hive.config", "com.thinkbiganalytics.spring");
ctx.refresh();
InspectionService service = ctx.getBean(InspectionService.class);
return service.inspect(config);
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project kylo by Teradata.
the class JcrTestConfig method placeHolderConfigurer.
@Bean
public PropertySourcesPlaceholderConfigurer placeHolderConfigurer() {
final Properties properties = new Properties();
properties.setProperty("security.entity.access.controlled", "true");
final PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
configurer.setProperties(properties);
return configurer;
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project kylo by Teradata.
the class TestSpringConfiguration method properties.
@Bean
public static PropertySourcesPlaceholderConfigurer properties() throws Exception {
final PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
Properties properties = new Properties();
properties.setProperty("nifi.remove.inactive.versioned.feeds", "true");
propertySourcesPlaceholderConfigurer.setProperties(properties);
return propertySourcesPlaceholderConfigurer;
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project alf.io by alfio-event.
the class ApplicationPropertiesConfiguration method propertyPlaceholder.
@Bean
@Profile("!" + Initializer.PROFILE_SPRING_BOOT)
public static PropertySourcesPlaceholderConfigurer propertyPlaceholder() {
PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
configurer.setLocation(new ClassPathResource("application.properties"));
return configurer;
}
use of org.springframework.context.support.PropertySourcesPlaceholderConfigurer in project alf.io by alfio-event.
the class BaseTestConfiguration method propConfig.
@Bean
public static PropertySourcesPlaceholderConfigurer propConfig() {
Properties properties = new Properties();
properties.put("alfio.version", "2.0-SNAPSHOT");
properties.put("alfio.build-ts", ZonedDateTime.now(ZoneId.of("UTC")).minusDays(1).toString());
ByteArrayOutputStream out = new ByteArrayOutputStream();
PrintWriter pw = new PrintWriter(out, true, Charset.defaultCharset());
properties.list(pw);
pw.flush();
var configurer = new PropertySourcesPlaceholderConfigurer();
configurer.setLocation(new ByteArrayResource(out.toByteArray()));
return configurer;
}
Aggregations