Save This Page
Home » openjdk-7 » java » lang » [javadoc | source]
java.lang
final class: VMProcess [javadoc | source]
java.lang.Object
   java.lang.Process
      java.lang.VMProcess
Represents one external process. Each instance of this class is in one of three states: INITIAL, RUNNING, or TERMINATED. The instance is notifyAll() 'd each time the state changes. The state of all instances is managed by a single dedicated thread which does the actual fork()/exec() and wait() system calls. User threads Object#wait() on the instance when creating the process or waiting for it to terminate.

See GCC bug #11801 for the motivation behind the design of this class.

Field Summary
static  Thread processThread     
static final  LinkedList workList     
static  long reapedPid     
static  int reapedExitValue     
 int state     
final  String[] cmd     
final  String[] env     
final  File dir     
 Throwable exception     
 long pid     
 OutputStream stdin     
 InputStream stdout     
 InputStream stderr     
 int exitValue     
 boolean redirect     
Method from java.lang.VMProcess Summary:
destroy,   exec,   exec,   exitValue,   getErrorStream,   getInputStream,   getOutputStream,   nativeReap,   nativeSpawn,   waitFor
Methods from java.lang.Process:
destroy,   exitValue,   getErrorStream,   getInputStream,   getOutputStream,   waitFor
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.lang.VMProcess Detail:
 public synchronized  void destroy() 
 static Process exec(String[] cmd,
    String[] env,
    File dir) throws IOException 
    Entry point from Runtime.exec().
 static Process exec(List cmd,
    Map env,
    File dir,
    boolean redirect) throws IOException 
 public synchronized int exitValue() 
 public InputStream getErrorStream() 
 public InputStream getInputStream() 
 public OutputStream getOutputStream() 
 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