public abstract class AbstractProcessManager extends Object implements ProcessManager
PID_NOT_FOUND, PID_UNKNOWN| Modifier | Constructor and Description |
|---|---|
protected |
AbstractProcessManager()
Initializes a new instance of the class.
|
| Modifier and Type | Method and Description |
|---|---|
protected @NonNull List<String> |
execute(String... cmdarray)
Executes the specified command and return the output.
|
long |
findPid(@NonNull ProcessQuery query)
Finds a PID of a running process that has the specified command line.
|
protected abstract @NonNull String[] |
getRunningProcessesCommand(String process)
Gets the command to be executed to get a snapshot of all the running processes identified by
the specified argument (process).
|
protected abstract @NonNull Pattern |
getRunningProcessLinePattern()
Gets the pattern to be used to match an output line containing the information about a running
process.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanFindPid, killprotected AbstractProcessManager()
protected @NonNull List<String> execute(String... cmdarray) throws IOException
cmdarray - An array containing the command to call and its arguments.IOException - If an I/O error occurs.public long findPid(@NonNull ProcessQuery query) throws IOException
ProcessManagerfindPid in interface ProcessManagerquery - 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 outIOException - If an IO error occurs.protected abstract @NonNull String[] getRunningProcessesCommand(String process)
process - The name of the process to query for.protected abstract @NonNull Pattern getRunningProcessLinePattern()
getRunningProcessesCommand(String)Copyright © 2016 - present; JODConverter.org. All rights reserved.