示例#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);
    }
  }