Class ProcessExecutionHandlerSync
java.lang.Object
org.spincast.plugins.processutils.ProcessExecutionHandlerDefault
org.spincast.plugins.processutils.ProcessExecutionHandlerSync
- All Implemented Interfaces:
HttpServerProcessHandlerExecutionHandler
,ProcessExecutionHandler
-
Field Summary
-
Constructor Summary
ConstructorDescriptionProcessExecutionHandlerSync
(CountDownLatch latch, ExecutionOutputStrategy executionOutputStrategy) -
Method Summary
Modifier and TypeMethodDescriptionprotected ExecutionOutputStrategy
protected CountDownLatch
getLatch()
boolean
void
onExit
(int exitCode) Called when the execution process exitsvoid
Called if an exception occured during the launch of the program.void
onSystemErr
(String line) Called when a line is written to the standard errors by the created process.void
onSystemOut
(String line) Called when a line is written to the standard output by the created process.void
Called if the execution of the program exceeds the specified timeout.Methods inherited from class org.spincast.plugins.processutils.ProcessExecutionHandlerDefault
getProcess, getProcessKiller, isKillingRequested, isProcessAlive, killProcess, onEnd, setKillingRequested, setProcessAndProcessKiller, waitForPortOpen
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
-
Constructor Details
-
ProcessExecutionHandlerSync
public ProcessExecutionHandlerSync(CountDownLatch latch, ExecutionOutputStrategy executionOutputStrategy) - Parameters:
latch
- to be decremented when the process exits or when an error occurs.
-
-
Method Details
-
getLatch
-
getExecutionOutputStrategy
-
getExitCode
-
getLaunchException
-
isTimeoutException
public boolean isTimeoutException() -
getOutLines
-
getErrLines
-
onExit
public void onExit(int exitCode) Description copied from class:ProcessExecutionHandlerDefault
Called when the execution process exits- Specified by:
onExit
in interfaceProcessExecutionHandler
- Overrides:
onExit
in classProcessExecutionHandlerDefault
-
onLaunchException
Description copied from interface:ProcessExecutionHandler
Called if an exception occured during the launch of the program.- Specified by:
onLaunchException
in interfaceProcessExecutionHandler
- Overrides:
onLaunchException
in classProcessExecutionHandlerDefault
-
onTimeoutException
public void onTimeoutException()Description copied from interface:ProcessExecutionHandler
Called if the execution of the program exceeds the specified timeout.- Specified by:
onTimeoutException
in interfaceProcessExecutionHandler
- Overrides:
onTimeoutException
in classProcessExecutionHandlerDefault
-
onSystemOut
Description copied from interface:ProcessExecutionHandler
Called when a line is written to the standard output by the created process.- Specified by:
onSystemOut
in interfaceProcessExecutionHandler
- Overrides:
onSystemOut
in classProcessExecutionHandlerDefault
-
onSystemErr
Description copied from interface:ProcessExecutionHandler
Called when a line is written to the standard errors by the created process.- Specified by:
onSystemErr
in interfaceProcessExecutionHandler
- Overrides:
onSystemErr
in classProcessExecutionHandlerDefault
-
getSyncExecutionResult
-