public TaskDisplay(Task task) { taskId = task.getId(); externalHandle = task.getExternalHandle(); taskType = task.getType(); name = task.getName(); requireLock = task.requireLock(); retryIfFail = task.ifRetryCmdWhenFail(); }
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; } }