private void waitEndMoving(final DeviceProxy proxy) throws DevFailed {
   waitTask = new WaitStateTask(proxy.get_name(), DevState.MOVING, 100, false);
   waitTask.run();
   if (waitTask.hasFailed()) {
     throw waitTask.getDevFailed();
   }
 }
 public synchronized void cancel() {
   if (waitTask != null) {
     logger.debug("cancelling waiting for DR");
     waitTask.cancel();
   }
   cancel = true;
 }