+ nodeName
+ "' without 'factory'.");
}
}
DataNode node = createDataNode(nodeName);
node.setDataSourceFactory(factory);
node.setDataSourceLocation(dataSource);
// load DataSource
try {
// use DomainHelper factory if it exists, if not - use factory specified
// in configuration data
DataSourceFactory confFactory = config.getDataSourceFactory(factory);
DataSourceFactory localFactory = (confFactory != null)
? confFactory
: (DataSourceFactory) Class.forName(factory).newInstance();
logger.info("using factory: " + localFactory.getClass().getName());
localFactory.initializeWithParentConfiguration(config);
DataSource ds = localFactory.getDataSource(dataSource);
if (ds != null) {
logger.info("loaded datasource.");
node.setDataSource(ds);
}
else {
logger.info("Warning: null datasource.");
getStatus().getFailedDataSources().put(nodeName, dataSource);
}