public class ProcessUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ProcessUtils.ExtendedExecutor |
static class |
ProcessUtils.ProcessTree
Wrapper around an existing process that models a process tree
|
static class |
ProcessUtils.RunCancellationExecuteWatchdog
Based on
ExecuteWatchdog . |
static class |
ProcessUtils.RunCancellationWatchdog
A watchdog that monitors a sub-process of a
JIPipeRunnable
and watches for the JIPipeRunnable to be cancelled. |
Modifier and Type | Method and Description |
---|---|
static long |
getProcessID(Process p)
Gets the process ID of a process
|
static void |
killProcessTree(long pid,
JIPipeProgressInfo progressInfo) |
static String |
queryFast(Path executable,
JIPipeProgressInfo progressInfo,
String... args)
Queries standard output with a timeout.
|
static void |
runProcess(ProcessEnvironment environment,
ExpressionVariables variables,
JIPipeProgressInfo progressInfo)
Runs a process
|
static void |
setupLogger(org.apache.commons.exec.CommandLine commandLine,
org.apache.commons.exec.DefaultExecutor executor,
JIPipeProgressInfo progressInfo) |
public static long getProcessID(Process p)
p
- the processpublic static void runProcess(ProcessEnvironment environment, ExpressionVariables variables, JIPipeProgressInfo progressInfo)
environment
- the process environmentvariables
- additional variables for the arguments (can be null)progressInfo
- the progress infopublic static void setupLogger(org.apache.commons.exec.CommandLine commandLine, org.apache.commons.exec.DefaultExecutor executor, JIPipeProgressInfo progressInfo)
public static String queryFast(Path executable, JIPipeProgressInfo progressInfo, String... args)
executable
- the executableprogressInfo
- the progress infoargs
- executable argspublic static void killProcessTree(long pid, JIPipeProgressInfo progressInfo)
Copyright © 2020–2022 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.