}
}
else if (localName.equals(MAP_TAG)) {
String dataMapName = attributes.getValue("", "name");
Resource baseResource = descriptor.getConfigurationSource();
String dataMapLocation = attributes.getValue("", "location");
Resource dataMapResource = baseResource
.getRelativeResource(dataMapLocation);
DataMap dataMap = mapLoader.load(dataMapResource);
dataMap.setName(dataMapName);
dataMap.setLocation(dataMapLocation);
dataMap.setConfigurationSource(dataMapResource);
descriptor.getDataMaps().add(dataMap);
}
else if (localName.equals(NODE_TAG)) {
String nodeName = attributes.getValue("", "name");
if (nodeName == null) {
// TODO: assign dummy name?
throw new ConfigurationException("Error: <node> without 'name'.");
}
DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
nodeDescriptor.setName(nodeName);
String dataSourceFactory = attributes.getValue("", "factory");
String dataSourceFactory6 = convertDataSourceFactory(dataSourceFactory);
nodeDescriptor.setDataSourceFactoryType(dataSourceFactory6);
// depending on the factory, "datasource" attribute is interpreted
// differently
String datasource = attributes.getValue("", "datasource");
if (XMLPoolingDataSourceFactory.class
.getName()
.equals(dataSourceFactory6)) {
Resource baseResource = descriptor.getConfigurationSource();
Resource dataNodeResource = baseResource
.getRelativeResource(datasource);
nodeDescriptor.setConfigurationSource(dataNodeResource);
DataSourceInfo dataSourceInfo = dataSourceInfoLoader
.load(dataNodeResource);