+ analysisEngineDescriptions.size() + "]does not match number of component names ["
+ componentNames.size() + "].");
}
// create the descriptor and set configuration parameters
AnalysisEngineDescription desc = new AnalysisEngineDescription_impl();
desc.setFrameworkImplementation(Constants.JAVA_FRAMEWORK_NAME);
desc.setPrimitive(false);
// if any of the aggregated analysis engines does not allow multiple
// deployment, then the
// aggregate engine may also not be multiply deployed
boolean allowMultipleDeploy = true;
for (AnalysisEngineDescription d : analysisEngineDescriptions) {
allowMultipleDeploy &= d.getAnalysisEngineMetaData().getOperationalProperties()
.isMultipleDeploymentAllowed();
}
desc.getAnalysisEngineMetaData().getOperationalProperties()
.setMultipleDeploymentAllowed(allowMultipleDeploy);
List<String> flowNames = new ArrayList<String>();
for (int i = 0; i < analysisEngineDescriptions.size(); i++) {
AnalysisEngineDescription aed = analysisEngineDescriptions.get(i);
String componentName = componentNames.get(i);
desc.getDelegateAnalysisEngineSpecifiersWithImports().put(componentName, aed);
flowNames.add(componentName);
}
if (flowControllerDescription != null) {
FlowControllerDeclaration flowControllerDeclaration = new FlowControllerDeclaration_impl();
flowControllerDeclaration.setSpecifier(flowControllerDescription);
desc.setFlowControllerDeclaration(flowControllerDeclaration);
}
FixedFlow fixedFlow = new FixedFlow_impl();
fixedFlow.setFixedFlow(flowNames.toArray(new String[flowNames.size()]));
desc.getAnalysisEngineMetaData().setFlowConstraints(fixedFlow);
if (typePriorities != null) {
desc.getAnalysisEngineMetaData().setTypePriorities(typePriorities);
}
if (sofaMappings != null) {
desc.setSofaMappings(sofaMappings);
}
return desc;
}