|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zeroturnaround.process.AbstractProcess
org.zeroturnaround.process.JavaProcess
public class JavaProcess
Wrapper for Process.
| Field Summary | |
|---|---|
protected Process |
process
The wrapped process. |
| Fields inherited from class org.zeroturnaround.process.AbstractProcess |
|---|
log |
| Constructor Summary | |
|---|---|
protected |
JavaProcess(Process process)
|
| Method Summary | |
|---|---|
protected boolean |
canDestroy(boolean forceful)
|
void |
destroy(boolean forceful)
Destroys the process handled by this killer either forcefully or gracefully according to the given option. |
String |
getDescription()
Returns the description of the system process represented. |
Process |
getProcess()
Returns the wrapped process. |
protected void |
invokeDestroy(boolean forceful)
|
boolean |
isAlive()
Tests whether this process is alive. |
void |
waitFor()
Causes the current thread to wait, if necessary, until this process has terminated. |
| Methods inherited from class org.zeroturnaround.process.AbstractProcess |
|---|
destroyForcefully, destroyGracefully, toString, waitFor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final Process process
| Constructor Detail |
|---|
protected JavaProcess(Process process)
| Method Detail |
|---|
public Process getProcess()
public String getDescription()
AbstractProcess
getDescription in class AbstractProcesspublic boolean isAlive()
SystemProcessThis operation may also take some time to finish.
true if this process is alive, false if it is finished or not found.
public void waitFor()
throws InterruptedException
SystemProcessThis method returns immediately if the process has already terminated. If the process has not yet terminated, the calling thread will be blocked until the process exits.
InterruptedException
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).
IOExceptionprotected boolean canDestroy(boolean forceful)
true if invokeDestroy(boolean) is supported with the given forceful flag on the given system.protected void invokeDestroy(boolean forceful)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||