
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 1.14.0 API)
org.spincast.plugins.processutils
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
Modifier and Type
Field and Description
protected static org.slf4j.Logger
logger
-
Constructor Summary
Constructors
Constructor and Description
ProcessExecutionHandlerDefault()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
protected Process
getProcess()
protected ProcessKiller
getProcessKiller()
Can be null
if the process
was not created.
protected boolean
isKillingRequested()
boolean
isProcessAlive()
Returns true
if the process is alive;
void
killProcess()
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
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.
void
setKillingRequested()
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.
-
-
Method Detail
-
getProcess
protected Process getProcess()
-
getProcessKiller
protected ProcessKiller 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
public void setProcessAndProcessKiller(Process process,
ProcessKiller processKiller)
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
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
-
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
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
-
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
Copyright © 2019. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy