public abstract class AbstractProcessManager extends java.lang.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 java.util.List<java.lang.String> |
execute(java.lang.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 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 abstract java.util.regex.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, wait
kill
protected AbstractProcessManager()
protected java.util.List<java.lang.String> execute(java.lang.String[] cmdarray) throws java.io.IOException
cmdarray
- An array containing the command to call and its arguments.java.io.IOException
- If an I/O error occurs.public long findPid(ProcessQuery query) throws java.io.IOException
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 outjava.io.IOException
- If an IO error occurs.protected abstract java.lang.String[] getRunningProcessesCommand(java.lang.String process)
process
- The name of the process to query for.protected abstract java.util.regex.Pattern getRunningProcessLinePattern()
getRunningProcessesCommand(String)