
public.javadoc.org.spincast.plugins.processutils.ProcessExecutionHandlerDefault.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.
ProcessExecutionHandlerDefault (org.spincast:spincast-framework 2.1.1 API)
Class ProcessExecutionHandlerDefault
java.lang.Object
org.spincast.plugins.processutils.ProcessExecutionHandlerDefault
- All Implemented Interfaces:
HttpServerProcessHandlerExecutionHandler
, ProcessExecutionHandler
- Direct Known Subclasses:
ProcessExecutionHandlerSync
public class ProcessExecutionHandlerDefault
extends Object
implements HttpServerProcessHandlerExecutionHandler
-
Field Summary
Fields
-
Constructor Summary
Constructors
-
Method Summary
Modifier and Type
Method
Description
protected Process
protected ProcessKiller
Can be null
if the process
was not created.
protected boolean
boolean
Returns true
if the process is alive;
void
Kill the process.
void
onEnd()
Always called at the end, whether the process
exited or an exception occured.
void
onExit(int exitCode)
Called when the execution process exits
void
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.
void
void
setProcessAndProcessKiller(Process process,
ProcessKiller processKiller)
Internal use.
void
waitForPortOpen(String host,
int port,
int nbrTry,
int sleepMilliseconds)
Wait for the specified host:port to be connectable.
-
Field Details
-
logger
protected static final org.slf4j.Logger logger
-
Constructor Details
-
ProcessExecutionHandlerDefault
public ProcessExecutionHandlerDefault()
-
Method Details
-
getProcess
-
getProcessKiller
Can be null
if the process
was not created.
-
isProcessAlive
public boolean isProcessAlive()
Description copied from interface: ProcessExecutionHandler
Returns true
if the process is alive;
- Specified by:
isProcessAlive
in interface ProcessExecutionHandler
-
setProcessAndProcessKiller
Description copied from interface: ProcessExecutionHandler
Internal use.
Will be called automatically
when the process is created.
- Specified by:
setProcessAndProcessKiller
in interface ProcessExecutionHandler
-
isKillingRequested
protected boolean isKillingRequested()
-
setKillingRequested
public void setKillingRequested()
-
waitForPortOpen
public void waitForPortOpen(String host,
int port,
int nbrTry,
int sleepMilliseconds)
throws PortNotOpenException
Description copied from interface: HttpServerProcessHandlerExecutionHandler
Wait for the specified host:port to be connectable.
- Specified by:
waitForPortOpen
in interface HttpServerProcessHandlerExecutionHandler
- Throws:
PortNotOpenException
-
killProcess
public void killProcess()
Description copied from interface: ProcessExecutionHandler
Kill the process.
- Specified by:
killProcess
in interface ProcessExecutionHandler
-
onExit
public void onExit(int exitCode)
Called when the execution process exits
- Specified by:
onExit
in interface ProcessExecutionHandler
-
onLaunchException
Description copied from interface: ProcessExecutionHandler
Called if an exception occured during the launch
of the program.
- Specified by:
onLaunchException
in interface ProcessExecutionHandler
-
onEnd
public void onEnd()
Description copied from interface: ProcessExecutionHandler
Always called at the end, whether the process
exited or an exception occured.
- Specified by:
onEnd
in interface ProcessExecutionHandler
-
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
-
onSystemOut
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
-
onSystemErr
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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy