public class UnixProcess extends PidProcess
It uses the getpgid system call for checking the status and the kill one for
destroying the process.
pidlog| Constructor and Description |
|---|
UnixProcess(int pid) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy(boolean forceful)
Destroys the process either forcefully or gracefully according to the given option.
|
boolean |
isAlive()
Tests whether this process is alive.
|
boolean |
kill(int signal)
Sends a signal to this process.
|
getDescription, getPidgetIntervalForCheckingFinished, setIntervalForCheckingFinished, waitFordestroyForcefully, destroyGracefully, toString, waitForpublic boolean isAlive()
throws IOException
SystemProcessThis operation may take some time to finish.
true if this process is alive, false if it is finished or not found.IOException - on IO error.public void destroy(boolean forceful)
throws IOException
AbstractProcess
Note: The process may not terminate at all.
i.e. isAlive() may return true for a any period after destroy() is called.
This method may be chained to waitFor() if needed.
No error is thrown if the process was already terminated.
destroy in class AbstractProcessforceful - true if the process must be destroyed forcefully (like kill -KILL),
false if it must be destroyed gracefully (like kill -TERM).IOException - on IO error.public boolean kill(int signal)
throws IOException
signal - name of the signal.true if this process received the signal, false if this process was not found (any more).IOException - on system call error.Copyright © 2019 ZeroTurnaround. All rights reserved.