// wait about 10 seconds for the remoting monitor to be initialised
// (i.e. for the begin task method to be called ON THE REMOTING MONITOR)
for(int i=0;i<START_DELAY;i++) {
- Thread.sleep(1000);
+ Thread.sleep(500);
logger.info("Waiting for monitered work to start ..");
remotingMonitor = progressMonitorService.getRemotingMonitor(uuid);
if(remotingMonitor.getTotalWork() > 0) {
return remotingMonitor;
// throw new InterruptedException("Monitor has zero work units");
}else if (remotingMonitor.getTotalWork() == 0 ){
- throw new InterruptedException("Monitor has zero work units");
+ Object result = remotingMonitor.getResult();
+ InterruptedException exception = new InterruptedException("Monitor has zero work units");
+ if (result instanceof UpdateResult){
+ ((UpdateResult)result).addException(exception);
+ }else if (result == null){
+ result = new UpdateResult();
+ }
+
}
// start the client monitor
monitor.beginTask(label, remotingMonitor.getTotalWork());
if (result instanceof UpdateResult){
((UpdateResult)result).addException(exception);
}
-
+ return remotingMonitor;
}
feedbackGenerators.get(feedbackCount).setFeedbackForMonitor(uuid);
feedbackCount++;