| Method from java.lang.VMProcess Detail: |
public synchronized void destroy() {
if (state == TERMINATED)
return;
nativeKill(pid);
while (state != TERMINATED)
{
try
{
wait();
}
catch (InterruptedException e)
{
/* ignore */
}
}
}
|
static Process exec(String[] cmd,
String[] env,
File dir) throws IOException {
return new VMProcess(cmd, env, dir, false);
}
Entry point from Runtime.exec(). |
static Process exec(List cmd,
Map env,
File dir,
boolean redirect) throws IOException {
String[] acmd = (String[]) cmd.toArray(new String[cmd.size()]);
String[] aenv = new String[env.size()];
int i = 0;
Iterator iter = env.entrySet().iterator();
while (iter.hasNext())
{
Map.Entry entry = (Map.Entry) iter.next();
aenv[i++] = entry.getKey() + "=" + entry.getValue();
}
return new VMProcess(acmd, aenv, dir, redirect);
}
|
public synchronized int exitValue() {
if (state != TERMINATED)
throw new IllegalThreadStateException();
return exitValue;
}
|
public InputStream getErrorStream() {
return stderr;
}
|
public InputStream getInputStream() {
return stdout;
}
|
public OutputStream getOutputStream() {
return stdin;
}
|
static native boolean nativeReap()
Test for a reapable child process, and reap if so. Does not block.
If a child was reaped, this method must set reapedPid and
reapedExitValue appropriately before returning.
This method is only invoked by processThread. |
native void nativeSpawn(String[] cmd,
String[] env,
File dir,
boolean redirect) throws IOException
Does the fork()/exec() thing to create the O/S process.
Must invoke setProcessInfo() before returning successfully.
This method is only invoked by processThread. |
public synchronized int waitFor() throws InterruptedException {
while (state != TERMINATED)
wait();
return exitValue;
}
|