return getFactoryWithTolerance(abstractFactoryClass, parameters);
}
SelectorEnsemble ensemble =
absFactoryRTD.getAdditionalData(SelectorEnsemble.DATA_ID);
ParameterBlock selectedParameters =
ensemble.select(parameters, getDataStorage().getFailureTolerance());
// If no selection could be made, return to default behaviour
if (selectedParameters == null) {
return getFactoryWithTolerance(abstractFactoryClass, parameters);
}
// Only select sub-block that corresponds to given task
String baseFactoryName =
getBaseFactoryForAbstractFactory(abstractFactoryClass).getName();
if (selectedParameters.hasSubBlock(baseFactoryName)) {
// Setting the value to null is important in case the user messed up a
// factory name, i.e. it is non-null but does not result in a selection
// Otherwise the value of selectedParameters will not be copied (infinite
// loop)
parameters.setValue(null);
copyValues(parameters, selectedParameters.getSubBlock(baseFactoryName));
}
return getFactory(abstractFactoryClass, parameters);
}