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| Constructor and Description |
|---|
WindowsProcessManager() |
| Modifier and Type | Method and Description |
|---|---|
static @NonNull WindowsProcessManager |
getDefault()
Gets the default instance of
WindowsProcessManager. |
protected @NonNull String[] |
getRunningProcessesCommand(@NonNull String process)
Gets the command to be executed to get a snapshot of all the running processes identified by
the specified argument (process).
|
protected @NonNull 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(@Nullable Process process,
long pid)
Kills the specified process.
|
execute, findPidclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanFindPidpublic static @NonNull WindowsProcessManager getDefault()
WindowsProcessManager.WindowsProcessManager instance.protected @NonNull String[] getRunningProcessesCommand(@NonNull String process)
AbstractProcessManagergetRunningProcessesCommand in class AbstractProcessManagerprocess - The name of the process to query for.protected @NonNull Pattern getRunningProcessLinePattern()
AbstractProcessManagergetRunningProcessLinePattern in class AbstractProcessManagerAbstractProcessManager.getRunningProcessesCommand(String)public boolean isUsable()
true If the required commands are available, false otherwise.public void kill(@Nullable Process process, long pid) throws IOException
ProcessManagerprocess - The process to kill.pid - The id of the process to kill.IOException - If an IO error occurs.Copyright © 2022 - present; JODConverter. All rights reserved.