public final class OSProcessUtil
extends java.lang.Object
Constructor and Description |
---|
OSProcessUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getApplicationPid() |
static java.util.List<java.lang.String> |
getCommandLinesOfRunningProcesses()
Deprecated.
trivial, use
getProcessList() directly |
static int |
getCurrentProcessId() |
static int |
getProcessID(java.lang.Process process) |
static int |
getProcessID(java.lang.Process process,
java.lang.Boolean disableWinp) |
static ProcessInfo [] |
getProcessList() |
static void |
killProcess(int pid) |
static void |
killProcess(java.lang.Process process) |
static boolean |
killProcessTree(java.lang.Process process) |
static void |
terminateProcessGracefully(int pid)
Terminates the process with the specified pid gracefully: on windows sends Ctrl-C,
on unix sends the SIGINT signal.
|
public static ProcessInfo [] getProcessList()
public static boolean killProcessTree(java.lang.Process process)
public static void killProcess(java.lang.Process process)
public static void killProcess(int pid)
public static void terminateProcessGracefully(int pid) throws java.lang.RuntimeException
java.lang.UnsupportedOperationException
- if cannot interrupt the processjava.lang.RuntimeException
KillableProcessHandler.destroyProcessGracefully()
public static int getProcessID(java.lang.Process process)
public static int getProcessID(java.lang.Process process, java.lang.Boolean disableWinp)
public static int getCurrentProcessId()
public static java.lang.String getApplicationPid()
@Deprecated public static java.util.List<java.lang.String> getCommandLinesOfRunningProcesses()
getProcessList()
directly