Ejemplo n.º 1
0
 public TaskDisplay(Task task) {
   taskId = task.getId();
   externalHandle = task.getExternalHandle();
   taskType = task.getType();
   name = task.getName();
   requireLock = task.requireLock();
   retryIfFail = task.ifRetryCmdWhenFail();
 }
Ejemplo n.º 2
0
 public synchronized <T extends Serializable> void updateStatus(Task<T> tTask) {
   this.taskState = tTask.getTaskState();
   if (externalHandle == null && tTask.getExternalHandle() != null) {
     this.externalHandle = tTask.getExternalHandle();
   }
   setStatusMessage(tTask.getStatusMessage());
   switch (taskState) {
     case RUNNING:
       if (beginTime == null) {
         beginTime = System.currentTimeMillis();
       }
       break;
     case FINISHED:
       if (endTime == null) {
         endTime = System.currentTimeMillis();
       }
       break;
   }
 }