use of com.radensolutions.reporting.service.ServerSettings in project netxms by netxms.
the class Launcher method registerReportingDataSources.
private static void registerReportingDataSources(AnnotationConfigApplicationContext context) {
ServerSettings settings = context.getBean(ServerSettings.class);
Set<String> registeredDataSources = settings.getReportingDataSources();
for (String name : registeredDataSources) {
BeanDefinition definition = new RootBeanDefinition(BasicDataSource.class);
ServerSettings.DataSourceConfig dataSourceConfig = settings.getDataSourceConfig(name);
definition.getPropertyValues().add("driverClassName", dataSourceConfig.getDriver());
definition.getPropertyValues().add("url", dataSourceConfig.getUrl());
definition.getPropertyValues().add("username", dataSourceConfig.getUsername());
definition.getPropertyValues().add("password", dataSourceConfig.getPassword());
context.registerBeanDefinition(name, definition);
}
}
Aggregations