
public.javadoc.org.spincast.plugins.processutils.ProcessExecutionHandlerSync.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
ProcessExecutionHandlerSync (org.spincast:spincast-framework 1.14.0 API)
org.spincast.plugins.processutils
Class ProcessExecutionHandlerSync
- java.lang.Object
-
- org.spincast.plugins.processutils.ProcessExecutionHandlerDefault
-
- org.spincast.plugins.processutils.ProcessExecutionHandlerSync
-
- All Implemented Interfaces:
- HttpServerProcessHandlerExecutionHandler, ProcessExecutionHandler
public class ProcessExecutionHandlerSync
extends ProcessExecutionHandlerDefault
-
-
Field Summary
Fields
Modifier and Type
Field and Description
protected static org.slf4j.Logger
logger
-
Constructor Summary
Constructors
Constructor and Description
ProcessExecutionHandlerSync(CountDownLatch latch,
ExecutionOutputStrategy executionOutputStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
List<String>
getErrLines()
protected ExecutionOutputStrategy
getExecutionOutputStrategy()
Integer
getExitCode()
protected CountDownLatch
getLatch()
Exception
getLaunchException()
List<String>
getOutLines()
SyncExecutionResult
getSyncExecutionResult()
boolean
isTimeoutException()
void
onExit(int exitCode)
Called when the execution process exits
void
onLaunchException(Exception ex)
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
onTimeoutException()
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
-
-
Constructor Detail
-
ProcessExecutionHandlerSync
public ProcessExecutionHandlerSync(CountDownLatch latch,
ExecutionOutputStrategy executionOutputStrategy)
- Parameters:
latch
- to be decremented when the process
exits or when an error occurs.
-
Method Detail
-
getLatch
protected CountDownLatch getLatch()
-
getExecutionOutputStrategy
protected ExecutionOutputStrategy getExecutionOutputStrategy()
-
getExitCode
public Integer getExitCode()
-
getLaunchException
public Exception getLaunchException()
-
isTimeoutException
public boolean isTimeoutException()
-
onExit
public void onExit(int exitCode)
Description copied from class: ProcessExecutionHandlerDefault
Called when the execution process exits
- Specified by:
onExit
in interface ProcessExecutionHandler
- Overrides:
onExit
in class ProcessExecutionHandlerDefault
-
onLaunchException
public void onLaunchException(Exception ex)
Description copied from interface: ProcessExecutionHandler
Called if an exception occured during the launch
of the program.
- Specified by:
onLaunchException
in interface ProcessExecutionHandler
- Overrides:
onLaunchException
in class ProcessExecutionHandlerDefault
-
onTimeoutException
public void onTimeoutException()
Description copied from interface: ProcessExecutionHandler
Called if the execution of the program
exceeds the specified timeout.
- Specified by:
onTimeoutException
in interface ProcessExecutionHandler
- Overrides:
onTimeoutException
in class ProcessExecutionHandlerDefault
-
onSystemOut
public void onSystemOut(String line)
Description copied from interface: ProcessExecutionHandler
Called when a line is written to the standard
output by the created process.
- Specified by:
onSystemOut
in interface ProcessExecutionHandler
- Overrides:
onSystemOut
in class ProcessExecutionHandlerDefault
-
onSystemErr
public void onSystemErr(String line)
Description copied from interface: ProcessExecutionHandler
Called when a line is written to the standard
errors by the created process.
- Specified by:
onSystemErr
in interface ProcessExecutionHandler
- Overrides:
onSystemErr
in class ProcessExecutionHandlerDefault
-
getSyncExecutionResult
public SyncExecutionResult getSyncExecutionResult()
Copyright © 2019. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy