Packages  This Package  Prev  Next  Index  

§1.13 Class Process

public  abstract class  java.lang.Process
    extends  java.lang.Object  (I-§1.12)
{
        // Constructors
    public Process();	§1.13.1

        // Methods
    public abstract void destroy();	§1.13.2
    public abstract int exitValue();	§1.13.3
    public abstract InputStream getErrorStream();	§1.13.4
    public abstract InputStream getInputStream();	§1.13.5
    public abstract OutputStream getOutputStream();	§1.13.6
    public abstract int waitFor();	§1.13.7
}
The exec methods (I-§1.14.1-§1.14.4) return an instance of a subclass of Process that can be used to control the process and obtain information about it.

The subprocess is not killed when there are no more references to the Process object, but rather the subprocess continues executing asynchronously.


Constructors

Process

public Process()
The default constructor.

Methods

destroy

public abstract void destroy()
Kills the subprocess.

exitValue

public abstract int exitValue()
Returns:
the exit value of the subprocess.
Throws
IllegalThreadStateException (I-§1.34)
If the subprocess has not yet terminated.

getErrorStream

public abstract InputStream getErrorStream()
Gets the error stream of the subprocess.
Returns:
the input stream connected to the error stream of the subprocess. This stream is usually unbuffered.

getInputStream

public abstract InputStream getInputStream()
Gets the input stream of the subprocess.
Returns:
the input stream connected to the normal output of the subprocess. This stream is usually buffered.

getOutputStream

public abstract OutputStream getOutputStream()
Gets the output stream of the subprocess.
Returns:
the output stream connected to the normal input of the subprocess. This stream is usually buffered.

waitFor

public abstract int waitFor() throws InterruptedException
Waits for the subprocess to complete. This method returns immediately if the subprocess has already terminated.
Returns:
the exit value of the process.
Throws
InterruptedException (I-§1.37)
If the waitFor was interrupted.

Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com