log.debug("BatchExecutionListener: notify STARTED for: "+ticket);
bInfomredStarted=true;
}
if(bp.isRunning(ticket)){
TestbedBatchJob job = bp.getJob(ticket);
job.setStatus(TestbedBatchJob.RUNNING);
bp.notifyRunning(ticket, job);
log.debug("BatchExecutionListener: notify RUNNING for: "+ticket);
}
if(bp.isUpdated(ticket)){
bp.notifyUpdate(ticket, bp.getJob(ticket));
log.debug("BatchExecutionListener: notify UPDATE for: "+ticket);
}
if(bp.isFailed(ticket)){
TestbedBatchJob job = bp.getJob(ticket);
job.setStatus(TestbedBatchJob.FAILED);
bp.notifyFailed(ticket, job);
log.debug("BatchExecutionListener: notify FAILED for: "+ticket);
}
//check if completed
if(bp.isCompleted(ticket)){
TestbedBatchJob job = bp.getJob(ticket);
job.setStatus(TestbedBatchJob.DONE);
bp.notifyComplete(ticket, job);
log.debug("BatchExecutionListener: notify COMPLETE for: "+ticket);
return;
}
}
//status is: still no completed - sleep and repoll
try {
Thread.sleep(sleep);
} catch (InterruptedException e) {
log.debug("Error while waiting for ticket: "+ticket, e);
TestbedBatchJob job = bp.getJob(ticket);
job.setStatus(TestbedBatchJob.FAILED);
bp.notifyFailed(ticket, job);
return;
}
t1 = System.currentTimeMillis();
}
//b) in this case a time-out occurred
TestbedBatchJob job = bp.getJob(ticket);
job.setStatus(TestbedBatchJob.FAILED);
job.setWorkflowFailureReport(new String("BatchExperimentListener with timeout of "+timeOutMillis/1000+" Sec. has timed-out. This normally indicates a failure within the remote workflow execution processor"));
bp.notifyFailed(ticket, job);
log.debug("BatchExecutionListener: notify FAILED due to time-out for: "+ticket);
}