Interface ProcessExecutionHandler
- All Known Subinterfaces:
HttpServerProcessHandlerExecutionHandler
- All Known Implementing Classes:
ProcessExecutionHandlerDefault,ProcessExecutionHandlerSync
public interface ProcessExecutionHandler
Handler to be inform of an exit code, an
exception and to be able to kill the started process.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the process is alive;voidKill the process.voidonEnd()Always called at the end, whether the process exited or an exception occured.voidonExit(int exitVal) Called when the process exits.voidCalled if an exception occured during the launch of the program.voidonSystemErr(String line) Called when a line is written to the standard errors by the created process.voidonSystemOut(String line) Called when a line is written to the standard output by the created process.voidCalled if the execution of the program exceeds the specified timeout.voidsetProcessAndProcessKiller(Process process, ProcessKiller processKiller) Internal use.
-
Method Details
-
setProcessAndProcessKiller
Internal use.Will be called automatically when the process is created.
-
isProcessAlive
boolean isProcessAlive()Returnstrueif the process is alive; -
onLaunchException
Called if an exception occured during the launch of the program. -
onTimeoutException
void onTimeoutException()Called if the execution of the program exceeds the specified timeout. -
onExit
void onExit(int exitVal) Called when the process exits. In general, a0value means that no error occured.Note that this method will not be called if there is an exception while launching the program! In that case,
onLaunchException(Exception)will be called instead. -
onEnd
void onEnd()Always called at the end, whether the process exited or an exception occured. -
onSystemOut
Called when a line is written to the standard output by the created process. -
onSystemErr
Called when a line is written to the standard errors by the created process. -
killProcess
void killProcess()Kill the process.
-