callbackListener = aListener;
}
// Run until All CASes are sent
public void run() {
UimaASProcessStatusImpl status = null;
try {
while (howManyCASes-- > 0) {
CAS cas = uimaClient.getCAS();
cas.setDocumentText(text);
ProcessTrace pt = new ProcessTrace_impl();
try {
// Send CAS and wait for a response
String casReferenceId = uimaClient.sendAndReceiveCAS(cas, pt);
status = new UimaASProcessStatusImpl(pt, cas, casReferenceId);
} catch (ResourceProcessException rpe) {
//rpe.printStackTrace();
status = new UimaASProcessStatusImpl(pt);
status.addEventStatus("Process", "Failed", rpe);
} finally {
if ( callbackListener != null ) {
callbackListener.entityProcessComplete(cas, status);
}
cas.release();