uimaSerializer.deserializeCasFromXmi(xmi, cas, deserSharedData, true, -1);
}
private void handleProcessResponseWithCASReference(MessageContext aMessageContext) {
String casReferenceId = null;
CacheEntry cacheEntry = null;
try {
casReferenceId = aMessageContext.getMessageStringProperty(AsynchAEMessage.CasReference);
cacheEntry = getController().getInProcessCache().getCacheEntryForCAS(casReferenceId);
CasStateEntry casStateEntry = ((AggregateAnalysisEngineController) getController())
.getLocalCache().lookupEntry(casReferenceId);
CAS cas = cacheEntry.getCas();
String delegateKey = ((AggregateAnalysisEngineController) getController())
.lookUpDelegateKey(aMessageContext.getEndpoint().getEndpoint());
Delegate delegate = ((AggregateAnalysisEngineController) getController())
.lookupDelegate(delegateKey);
if (casStateEntry != null) {
casStateEntry.setReplyReceived();
casStateEntry.setLastDelegate(delegate);
}
delegate.removeCasFromOutstandingList(casReferenceId);
if (cas != null) {
cancelTimerAndProcess(aMessageContext, casReferenceId, cas);
} else {
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(
Level.INFO,
CLASS_NAME.getName(),
"handleProcessResponseWithCASReference",
UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
"UIMAEE_cas_not_in_cache__INFO",
new Object[] { getController().getName(), casReferenceId,
aMessageContext.getEndpoint().getEndpoint() });
}
throw new AsynchAEException("CAS with Reference Id:" + casReferenceId
+ " Not Found in CasManager's CAS Cache");
}
} catch (Exception e) {
ErrorContext errorContext = new ErrorContext();
errorContext.add(AsynchAEMessage.Command, AsynchAEMessage.Process);
errorContext.add(AsynchAEMessage.CasReference, casReferenceId);
errorContext.add(AsynchAEMessage.Endpoint, aMessageContext.getEndpoint());
getController().getErrorHandlerChain().handle(e, errorContext, getController());
} finally {
incrementDelegateProcessCount(aMessageContext);
if (getController() instanceof AggregateAnalysisEngineController) {
try {
String endpointName = aMessageContext.getEndpoint().getEndpoint();
String delegateKey = ((AggregateAnalysisEngineController) getController())
.lookUpDelegateKey(endpointName);
if (delegateKey != null) {
Endpoint endpoint = ((AggregateAnalysisEngineController) getController())
.lookUpEndpoint(delegateKey, false);
// Check if the multiplier aborted during processing of this input CAS
if (endpoint != null && endpoint.isCasMultiplier() && cacheEntry.isAborted()) {
if (!getController().getInProcessCache().isEmpty()) {
getController().getInProcessCache().registerCallbackWhenCacheEmpty(
getController().getEventListener());
} else {
// Callback to notify that the cache is empty