ManagedProcessState

public interface ManagedProcessState

Read-only view and lifecycle controls for a managed external process.

Provides operations to start, wait, destroy, and query state, plus helpers for reading recent console output useful for diagnostics.

Inheritors

Functions

Link copied to clipboard
public abstract void destroy()
Destroys (terminates) the running process.
Link copied to clipboard
public abstract int exitValue()
Returns the exit value of the process.
Link copied to clipboard
public abstract String getConsole()
Returns the recent console output captured from the process (stdout and stderr).
Link copied to clipboard
public abstract String getLastConsoleLines()
Returns a formatted string with the last N lines of console output for diagnostics.
Link copied to clipboard
public abstract String getProcLongName()
Returns a descriptive name of the process suitable for logs (typically includes the command and, if available, the working directory).
Link copied to clipboard
public abstract boolean isAlive()
Indicates whether the process has been started and has not yet terminated.
Link copied to clipboard
public abstract void notifyProcessHalted()
Internal callback used to signal that the process has halted (success or failure).
Link copied to clipboard
public abstract boolean startAndWaitForConsoleMessageMaxMs(String messageInConsole, long maxWaitUntilReturning)
Starts the process and waits until a specific message appears in the process console output (stdout or stderr), or the timeout elapses.
Link copied to clipboard
public abstract int waitForExit()
Blocks until the process terminates and returns its exit value.
Link copied to clipboard
public abstract int waitForExitMaxMs(long maxWaitUntilReturning)
Blocks until the process terminates, or until the timeout elapses.
Link copied to clipboard
public abstract ManagedProcess waitForExitMaxMsOrDestroy(long maxWaitUntilDestroyTimeout)
Waits up to the given timeout for the process to terminate; if still running after the timeout, the process is destroyed.
Link copied to clipboard
public abstract boolean watchDogKilledProcess()
Indicates whether the watchdog forcibly killed the process.