+ (t1 - t0)
+ " ms.");
}
DataChannelDescriptor descriptor = tree.getRootNode();
DataDomain dataDomain = createDataDomain(descriptor.getName());
dataDomain.setEntitySorter(injector.getInstance(EntitySorter.class));
dataDomain.setEventManager(injector.getInstance(EventManager.class));
dataDomain.initWithProperties(descriptor.getProperties());
for (DataMap dataMap : descriptor.getDataMaps()) {
dataDomain.addDataMap(dataMap);
}
dataDomain.getEntityResolver().applyDBLayerDefaults();
dataDomain.getEntityResolver().applyObjectLayerDefaults();
for (DataNodeDescriptor nodeDescriptor : descriptor.getNodeDescriptors()) {
DataNode dataNode = new DataNode(nodeDescriptor.getName());
dataNode.setDataSourceLocation(nodeDescriptor.getParameters());
DataSource dataSource = dataSourceFactory.getDataSource(nodeDescriptor);
dataNode.setDataSourceFactory(nodeDescriptor.getDataSourceFactoryType());
dataNode.setDataSource(dataSource);
// schema update strategy
String schemaUpdateStrategyType = nodeDescriptor
.getSchemaUpdateStrategyType();
if (schemaUpdateStrategyType == null) {
dataNode.setSchemaUpdateStrategy(defaultSchemaUpdateStrategy);
dataNode.setSchemaUpdateStrategyName(defaultSchemaUpdateStrategy
.getClass()
.getName());
}
else {
SchemaUpdateStrategy strategy = objectFactory.newInstance(
SchemaUpdateStrategy.class,
schemaUpdateStrategyType);
dataNode.setSchemaUpdateStrategyName(schemaUpdateStrategyType);
dataNode.setSchemaUpdateStrategy(strategy);
}
// DbAdapter
dataNode.setAdapter(adapterFactory.createAdapter(nodeDescriptor, dataSource));
// DataMaps
for (String dataMapName : nodeDescriptor.getDataMapNames()) {
dataNode.addDataMap(dataDomain.getDataMap(dataMapName));
}
dataDomain.addNode(dataNode);
}
for (DataChannelFilter filter : filters) {
dataDomain.addFilter(filter);
}
return dataDomain;
}