Interface ProcessTask
- All Superinterfaces:
Callable<ProcessTask>
Executes command task.
- Since:
- 1.11
- Author:
- Erwin Mueller, erwin.mueller@deventm.org
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(Observer... observer) Adds the process task observer(s).call()Executes the command.voiddestroy()Kills the process.Returns the command line of the process.getErr()Returns the standard error output of the process after the process finished.intReturns the exit value of the process after the process finished.getOut()Returns the standard output of the process after the process finished.Returns the process of the executed command.voidremoveObserver(Observer... observer) Removes the process task observer(s).
-
Method Details
-
call
Executes the command.- Specified by:
callin interfaceCallable<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
Stringstandard output.
-
getErr
String getErr()Returns the standard error output of the process after the process finished.- Returns:
- the
Stringstandard error output.
-
getExitValue
int getExitValue()Returns the exit value of the process after the process finished.- Returns:
- the exit value.
-
addObserver
Adds the process task observer(s).- Parameters:
observer- theObserver.
-
removeObserver
Removes the process task observer(s).- Parameters:
observer- theObserver.
-