// Release the CAS and notify listeners if the end of the
// pipeline is reached.
if ((releaseCAS) && (i == (processContainers.size() - 1))) {
// This flag is used to prevent multiple notifications
doneAlready = true;
EntityProcessStatus aEntityProcStatus = new EntityProcessStatusImpl(pTrTemp);
maybeLogFinest("UIMA_CPM_notify_listeners__FINEST");
threadState = 2007;
notifyListeners(aCasObjectList, isCasObject, aEntityProcStatus);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
logFinest("UIMA_CPM_done_notify_listeners__FINEST");
logFinest("UIMA_CPM_releasing_cases__FINEST",
container.getName(), String.valueOf(releaseCAS), "true");
}
if (casCache != null) {
clearCasCache();
}
// Release CAS's.
if (aCasObjectList instanceof CAS[]) {
cpm.releaseCASes((CAS[]) aCasObjectList);
}
maybeLogFinest("UIMA_CPM_done_releasing_cases__FINEST", container);
}
maybeLogFinest("UIMA_CPM_pipeline_completed__FINEST");
retry = false;
// On successfull processing reset the restart counter. Restart counter determines how
// many times to restart Cas Processor on the same CAS
// Do this conditionally. If the CAS is to be dropped on Exception this restart counter
// scope extends to the entire collection not just one CAS
if (!cpm.dropCasOnException()) {
container.resetRestartCount();
}
} catch (Exception e) {
e.printStackTrace();
if (UIMAFramework.getLogger().isLoggable(Level.SEVERE)) {
logSevere("UIMA_CPM_pipeline_exception__SEVERE", container.getName(), e.getMessage());
maybeLogSevereException(e);
logFinest("UIMA_CPM_pipeline_exception__FINEST",
container.getName(), String.valueOf(container.isPaused()));
}
EntityProcessStatusImpl enProcSt = new EntityProcessStatusImpl(pTrTemp);
enProcSt.addEventStatus("Process", "Failed", e);
threadState = 2008;
notifyListeners(aCasObjectList, isCasObject, enProcSt);
doneAlready = true;
threadState = 2009;