&& aResourceClass.isAssignableFrom(TextAnalysisEngine.class))
// NOTE: for backwards-compatibility, we have to check TextAnalysisEngine,
// not AnalysisEngine. Otherwise produceTAE would fail becasue
// TextAnalysisEngien.class.isAssignableFrom(AnalysisEngine.class) is false.
{
ResourceCreationSpecifier spec = (ResourceCreationSpecifier) aSpecifier;
if (multiprocessing) {
resource = new MultiprocessingAnalysisEngine_impl();
} else {
String frameworkImpl = spec.getFrameworkImplementation();
if (frameworkImpl == null || frameworkImpl.length() == 0) {
throw new ResourceInitializationException(
ResourceInitializationException.MISSING_FRAMEWORK_IMPLEMENTATION,
new Object[] { aSpecifier.getSourceUrlString() });
}
if (frameworkImpl.startsWith(Constants.CPP_FRAMEWORK_NAME)) {
resource = new UimacppAnalysisEngineImpl();
} else if (frameworkImpl.startsWith(Constants.JAVA_FRAMEWORK_NAME)) {
if (spec instanceof AnalysisEngineDescription
&& !((AnalysisEngineDescription) spec).isPrimitive()) {
resource = new AggregateAnalysisEngine_impl();
} else {
resource = new PrimitiveAnalysisEngine_impl();
}
} else {
throw new ResourceInitializationException(
ResourceInitializationException.UNSUPPORTED_FRAMEWORK_IMPLEMENTATION,
new Object[] { spec.getFrameworkImplementation(), aSpecifier.getSourceUrlString() });
}
}
}
if (resource != null && resource.initialize(aSpecifier, aAdditionalParams)) {