Managed Process
Managed OS Process (Executable, Program, Command). Created by build.
Intended for controlling external "tools", often "daemons", which produce some text-based control output. In this form not yet suitable for programs returning binary data via stdout (but could be extended).
Does reasonably extensive logging about what it's doing (contrary to Apache Commons Exec), including logging the processes stdout &stderr, into SLF4J (not the System.out.Console).
Author
Michael Vorburger
Neelesh Shastry
William Dutton
See also
Executor
Internally based on http://commons.apache.org/exec/ but intentionally not exposing this; could be switched later, if there is any need.
Properties
Link copied to clipboard
Synthetic exit code returned when this process was explicitly destroyed via destroy rather than terminating normally.
Link copied to clipboard
Synthetic exit code used to indicate that the process was still running when a bounded wait timed out (see waitForExitMaxMs).
Functions
Link copied to clipboard
Returns the recent console output captured from the process (stdout and stderr).
Link copied to clipboard
Returns the path of the executable that will be launched.
Link copied to clipboard
Returns a formatted string with the last N lines of console output for diagnostics.
Link copied to clipboard
Returns a descriptive name of the process suitable for logs (typically includes the command and, if available, the working directory).
Link copied to clipboard
Allows
LoggingExecuteResultHandler to notify if process has halted (success or failure).Link copied to clipboard
Starts the Process.
Link copied to clipboard
public boolean startAndWaitForConsoleMessageMaxMs(String messageInConsole, long maxWaitUntilReturning)
Starts the Process and waits (blocks) until the process prints a certain message.
Link copied to clipboard
Waits for the process to terminate.
Link copied to clipboard
Like waitForExit, but waits max.
Link copied to clipboard
Like waitForExit, but waits max.
Link copied to clipboard
Indicates whether the watchdog forcibly killed the process.