public class WindowsProcessManager extends AbstractProcessManager
ProcessManager implementation for Windows.
Requires wmic.exe and taskkill.exe, that should be available at least on Windows XP, Windows Vista, and Windows 7 (except Home versions).
PID_NOT_FOUND, PID_UNKNOWN| 构造器和说明 |
|---|
WindowsProcessManager() |
| 限定符和类型 | 方法和说明 |
|---|---|
static WindowsProcessManager |
getDefault()
Gets the default instance of
WindowsProcessManager. |
protected java.lang.String[] |
getRunningProcessesCommand(java.lang.String process)
Gets the command to be executed to get a snapshot of all the running processes identified by
the specified argument (process).
|
protected java.util.regex.Pattern |
getRunningProcessLinePattern()
Gets the pattern to be used to match an output line containing the information about a running
process.
|
boolean |
isUsable()
Gets whether the commands we need are available for a Windows OS.
|
void |
kill(java.lang.Process process,
long pid)
Kills the specified process.
|
execute, findPidpublic static WindowsProcessManager getDefault()
WindowsProcessManager.WindowsProcessManager instance.protected java.lang.String[] getRunningProcessesCommand(java.lang.String process)
AbstractProcessManagergetRunningProcessesCommand 在类中 AbstractProcessManagerprocess - The name of the process to query for.protected java.util.regex.Pattern getRunningProcessLinePattern()
AbstractProcessManagergetRunningProcessLinePattern 在类中 AbstractProcessManagerAbstractProcessManager.getRunningProcessesCommand(String)public boolean isUsable()
true If the required commands are available, false otherwise.public void kill(java.lang.Process process,
long pid)
throws java.io.IOException
ProcessManagerprocess - The process to kill.pid - The id of the process to kill.java.io.IOException - If an IO error occurs.