if (key == null) {
throw new AsynchAEException(getName() + "-Unable to look up delegate "
+ aDelegateEndpointName + " in internal map");
}
UimaContextAdmin uctx = getUimaContextAdmin();
// retrieve the sofa mappings for input/output sofas of this analysis engine
HashMap sofamap = new HashMap();
if (resourceSpecifier instanceof AnalysisEngineDescription) {
AnalysisEngineDescription desc = (AnalysisEngineDescription) resourceSpecifier;
SofaMapping[] sofaMappings = desc.getSofaMappings();
if (sofaMappings != null && sofaMappings.length > 0) {
for (int s = 0; s < sofaMappings.length; s++) {
// the mapping is for this analysis engine
if (sofaMappings[s].getComponentKey().equals(key)) {
// if component sofa name is null, replace it with
// the default for TCAS sofa name
// This is to support old style TCAS
if (sofaMappings[s].getComponentSofaName() == null)
sofaMappings[s].setComponentSofaName(CAS.NAME_DEFAULT_SOFA);
sofamap.put(sofaMappings[s].getComponentSofaName(), sofaMappings[s]
.getAggregateSofaName());
}
}
}
}
// create child UimaContext and insert into mInitParams map
return uctx.createChild(key, sofamap);
}
return null;
}