Interface ProcessTask

All Superinterfaces:
Callable<ProcessTask>

public interface ProcessTask extends Callable<ProcessTask>
Executes command task.
Since:
1.11
Author:
Erwin Mueller, erwin.mueller@deventm.org
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addObserver(Observer... observer)
    Adds the process task observer(s).
    Executes the command.
    void
    Kills the process.
    Returns the command line of the process.
    Returns the standard error output of the process after the process finished.
    int
    Returns the exit value of the process after the process finished.
    Returns the standard output of the process after the process finished.
    Returns the process of the executed command.
    boolean
    Returns if the process should be destroyed on thread interruption.
    void
    removeObserver(Observer... observer)
    Removes the process task observer(s).
    void
    Returns if the process should be destroyed on thread interruption.
  • Method Details

    • call

      Executes the command.
      Specified by:
      call in interface Callable<ProcessTask>
      Throws:
      CommandExecException
    • getCommandLine

      CommandLine getCommandLine()
      Returns the command line of the process.
      Returns:
      the CommandLine.
    • getProcess

      Process getProcess()
      Returns the process of the executed command.
      Returns:
      the Process.
    • destroy

      void destroy()
      Kills the process.
    • getOut

      String getOut()
      Returns the standard output of the process after the process finished.
      Returns:
      the String standard output.
    • getErr

      String getErr()
      Returns the standard error output of the process after the process finished.
      Returns:
      the String standard error output.
    • getExitValue

      int getExitValue()
      Returns the exit value of the process after the process finished.
      Returns:
      the exit value.
    • setDestroyOnInterrupted

      void setDestroyOnInterrupted(boolean flag)
      Returns if the process should be destroyed on thread interruption.
      Parameters:
      flag - set to true if the process should be destroyed on thread interruption.
      Since:
      4.6.3
    • isDestroyOnInterrupted

      boolean isDestroyOnInterrupted()
      Returns if the process should be destroyed on thread interruption.
      Returns:
      true if the process should be destroyed on thread interruption.
      Since:
      4.6.3
    • addObserver

      void addObserver(Observer... observer)
      Adds the process task observer(s).
      Parameters:
      observer - the Observer.
    • removeObserver

      void removeObserver(Observer... observer)
      Removes the process task observer(s).
      Parameters:
      observer - the Observer.