public class UnixProcessManager
extends java.lang.Object
OSProcessUtil
wherever possible.Modifier and Type | Field and Description |
---|---|
static int |
SIGABRT |
static int |
SIGINT |
static int |
SIGKILL |
static int |
SIGPIPE |
static int |
SIGTERM |
Modifier and Type | Method and Description |
---|---|
static int |
getCurrentProcessId() |
static int |
getProcessId(java.lang.Process process) |
static java.lang.String[] |
getPSCmd(boolean commandLineOnly) |
static java.lang.String[] |
getPSCmd(boolean commandLineOnly,
boolean isShortenCommand) |
static int |
getSignalNumber(java.lang.String signalName) |
static void |
processCommandOutput(java.lang.String[] cmd,
Processor<? super java.lang.String> processor,
boolean skipFirstLine,
boolean throwOnError) |
static void |
processPSOutput(java.lang.String[] cmd,
Processor<? super java.lang.String> processor) |
static boolean |
sendSigIntToProcessTree(java.lang.Process process) |
static boolean |
sendSigKillToProcessTree(java.lang.Process process) |
static int |
sendSignal(int pid,
int signal) |
static int |
sendSignal(int pid,
java.lang.String signalName) |
static boolean |
sendSignalToProcessTree(int processId,
int signal) |
static boolean |
sendSignalToProcessTree(int processId,
int signal,
int ourPid) |
static boolean |
sendSignalToProcessTree(java.lang.Process process,
int signal) |
public static final int SIGINT
public static final int SIGABRT
public static final int SIGKILL
public static final int SIGTERM
public static final int SIGPIPE
public static int getProcessId(java.lang.Process process)
public static int getCurrentProcessId()
public static int getSignalNumber(java.lang.String signalName)
signalName
- without the 'SIG' prefix ('INT', not 'SIGINT')public static int sendSignal(int pid, java.lang.String signalName)
public static int sendSignal(int pid, int signal)
public static boolean sendSigIntToProcessTree(java.lang.Process process)
public static boolean sendSigKillToProcessTree(java.lang.Process process)
public static boolean sendSignalToProcessTree(java.lang.Process process, int signal)
public static boolean sendSignalToProcessTree(int processId, int signal)
public static boolean sendSignalToProcessTree(int processId, int signal, int ourPid)
public static void processPSOutput(java.lang.String[] cmd, Processor<? super java.lang.String> processor)
public static void processCommandOutput(java.lang.String[] cmd, Processor<? super java.lang.String> processor, boolean skipFirstLine, boolean throwOnError)
public static java.lang.String[] getPSCmd(boolean commandLineOnly)
public static java.lang.String[] getPSCmd(boolean commandLineOnly, boolean isShortenCommand)