Class ProcessExecutionHandlerSync
java.lang.Object
org.spincast.plugins.processutils.ProcessExecutionHandlerDefault
org.spincast.plugins.processutils.ProcessExecutionHandlerSync
- All Implemented Interfaces:
HttpServerProcessHandlerExecutionHandler,ProcessExecutionHandler
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProcessExecutionHandlerSync(CountDownLatch latch, ExecutionOutputStrategy executionOutputStrategy) -
Method Summary
Modifier and TypeMethodDescriptionprotected ExecutionOutputStrategyprotected CountDownLatchgetLatch()booleanvoidonExit(int exitCode) Called when the execution process exitsvoidCalled 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.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:ProcessExecutionHandlerDefaultCalled when the execution process exits- Specified by:
onExitin interfaceProcessExecutionHandler- Overrides:
onExitin classProcessExecutionHandlerDefault
-
onLaunchException
Description copied from interface:ProcessExecutionHandlerCalled if an exception occured during the launch of the program.- Specified by:
onLaunchExceptionin interfaceProcessExecutionHandler- Overrides:
onLaunchExceptionin classProcessExecutionHandlerDefault
-
onTimeoutException
public void onTimeoutException()Description copied from interface:ProcessExecutionHandlerCalled if the execution of the program exceeds the specified timeout.- Specified by:
onTimeoutExceptionin interfaceProcessExecutionHandler- Overrides:
onTimeoutExceptionin classProcessExecutionHandlerDefault
-
onSystemOut
Description copied from interface:ProcessExecutionHandlerCalled when a line is written to the standard output by the created process.- Specified by:
onSystemOutin interfaceProcessExecutionHandler- Overrides:
onSystemOutin classProcessExecutionHandlerDefault
-
onSystemErr
Description copied from interface:ProcessExecutionHandlerCalled when a line is written to the standard errors by the created process.- Specified by:
onSystemErrin interfaceProcessExecutionHandler- Overrides:
onSystemErrin classProcessExecutionHandlerDefault
-
getSyncExecutionResult
-