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 List<String> |
execute(String[] cmdarray)
Executes the specified command and return the output.
|
long |
findPid(ProcessQuery query)
Finds a PID of a running process that has the specified command line.
|
protected abstract 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 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, waitkillprotected AbstractProcessManager()
protected 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(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 String[] getRunningProcessesCommand(String process)
process - The name of the process to query for.protected abstract Pattern getRunningProcessLinePattern()
getRunningProcessesCommand(String)