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 void |
launchProcess(ProcessEnvironment environment,
JIPipeExpressionVariablesMap variables,
Map<String,String> overrideEnvironmentVariables,
boolean handleQuoting,
JIPipeProgressInfo progressInfo)
Runs a process detached
|
static String |
queryFast(Path executable,
JIPipeProgressInfo progressInfo,
String... args)
Queries standard output with a timeout.
|
static void |
runProcess(ProcessEnvironment environment,
JIPipeExpressionVariablesMap variables,
Map<String,String> overrideEnvironmentVariables,
boolean handleQuoting,
JIPipeProgressInfo progressInfo)
Runs a process
|
static void |
setupLogger(org.apache.commons.exec.CommandLine commandLine,
org.apache.commons.exec.DefaultExecutor executor,
JIPipeProgressInfo progressInfo) |
static boolean |
shouldHandleQuoting()
Test for handling quoting in addArgument
|
static boolean |
systemIsMacM1() |
public static boolean systemIsMacM1()
public static boolean shouldHandleQuoting()
public static long getProcessID(Process p)
p
- the processpublic static void runProcess(ProcessEnvironment environment, JIPipeExpressionVariablesMap variables, Map<String,String> overrideEnvironmentVariables, boolean handleQuoting, JIPipeProgressInfo progressInfo)
environment
- the process environmentvariables
- additional variables for the arguments (can be null)overrideEnvironmentVariables
- additional environment variableshandleQuoting
- if argument quoting is handled by commons exec (can be buggy)progressInfo
- the progress infopublic static void launchProcess(ProcessEnvironment environment, JIPipeExpressionVariablesMap variables, Map<String,String> overrideEnvironmentVariables, boolean handleQuoting, JIPipeProgressInfo progressInfo)
environment
- the process environmentvariables
- additional variables for the arguments (can be null)overrideEnvironmentVariables
- additional environment variableshandleQuoting
- if argument quoting is handled by commons exec (can be buggy)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–2025 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.