Пример #1
0
 /** Finished executing a command, update states, notify */
 protected void execDone() {
   stateDone();
   if (task != null) {
     task.setExitValue(exitValue);
     if (notifyTaskState != null)
       notifyTaskState.taskFinished(task, null); // Notify end of execution
   }
 }
Пример #2
0
  /** Kill a process */
  public void kill() {
    if (debug) log("Process killed");

    killCmd();

    // Notify end of execution
    if (task != null) {
      task.setExitValue(Task.EXITCODE_KILLED);
      if (notifyTaskState != null) notifyTaskState.taskFinished(task, TaskState.KILLED);
    }
  }
Пример #3
0
  /** Error while trying to 'exec' of a command, update states */
  protected void execError(Throwable t, TaskState taskState, int exitCode) {
    stateDone();
    exitValue = exitCode;

    addError(t != null ? t.getMessage() : null);

    if (debug && t != null) t.printStackTrace();

    if (task != null) {
      task.setExitValue(exitCode);
      if (notifyTaskState != null) notifyTaskState.taskFinished(task, taskState);
    }
  }
Пример #4
0
 protected void stateStarted() {
   started = true;
   if (notifyTaskState != null) notifyTaskState.taskStarted(task);
 }
Пример #5
0
 protected void stateRunning() {
   started = true;
   if (notifyTaskState != null) notifyTaskState.taskRunning(task);
 }