/**
* A handler for TaskUpdateProgress pseudo-event.
*/
public class VcTaskUpdateProgressHandler implements IVcEventHandler {
public boolean eventHandler(VcEventType type, Event e) throws Exception {
TaskUpdateProgressEvent taskEvent = (TaskUpdateProgressEvent)e;
ManagedObjectReference taskMoRef = taskEvent.getTaskMoRef();
synchronized(VcTaskMgr.this) {
VcTask task = pendingTasks.get(taskMoRef);
if (task != null) {
logger.info("task: " + task.getMoRef() + " progress: " + taskEvent.getProgress());
task.setProgress(taskEvent.getProgress());
return true;
}
return false;
}
}