*
* @author cmathew
* @date 23 Oct 2015
- *
*/
-
public class ProgressMonitorClientManager {
private static final Logger logger = Logger.getLogger(ProgressMonitorClientManager.class);
SubMonitor monitor) throws InterruptedException {
return pollMonitor(label, uuid, pollInterval, postOp, Arrays.asList(feedbackGenerator), monitor);
}
+
/**
* Polls the progress monitor service for the progress status of a monitor
* corresponding to the given uuid.
break;
}
}
-
if (remotingMonitor == null){
return null;
}
+
// if the total work is still not been set then we assume that the
// operation has zero work units
-
if(remotingMonitor.getTotalWork() == 0 && remotingMonitor.isDone()) {
return remotingMonitor;
-
}else if (remotingMonitor.getTotalWork() == 0 ){
Object result = remotingMonitor.getResult();
InterruptedException exception = new InterruptedException("Monitor has zero work units");
}else{
throw e;
}
-
}
+
// check if remoting monitor is waiting for feedback
if(remotingMonitor.getIsWaitingForFeedback()) {
if(feedbackGenerators != null) {
feedbackCount++;
}
}
+
serverTotalWorkDone = (int) remotingMonitor.getWorkDone();
logger.info("Work done from start: " + serverTotalWorkDone);
String percentage = "100";