public class PureJavaProcessManager extends java.lang.Object implements ProcessManager
PID_NOT_FOUND, PID_UNKNOWN
Constructor and Description |
---|
PureJavaProcessManager() |
Modifier and Type | Method and Description |
---|---|
long |
findPid(ProcessQuery query)
Finds a PID of a running process that has the specified command line.
|
static PureJavaProcessManager |
getDefault()
Gets the default instance of
PureJavaProcessManager . |
void |
kill(java.lang.Process process,
long pid)
Kills the specified process.
|
public static PureJavaProcessManager getDefault()
PureJavaProcessManager
.PureJavaProcessManager
instance.public long findPid(ProcessQuery query)
ProcessManager
findPid
in interface ProcessManager
query
- A query used to find the process with the pid we are looking for.ProcessManager.PID_NOT_FOUND
if not, or ProcessManager.PID_UNKNOWN
if this
implementation is unable to find outpublic void kill(java.lang.Process process, long pid)
ProcessManager
kill
in interface ProcessManager
process
- The process to kill.pid
- The id of the process to kill.