Package java.lang Previous
Previous
Java API
Java API
Index
Index
Next
Next

Class Process

Constructors , Methods

public  abstract class  java.lang.Process
    extends  java.lang.Object  
{
        // Constructors
    public Process();	

        // Methods
    public abstract void destroy();	
    public abstract int exitValue();	
    public abstract InputStream getErrorStream();	
    public abstract InputStream getInputStream();	
    public abstract OutputStream getOutputStream();	
    public abstract int waitFor();	
}

The exec methods 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() 

Return Value:

Returns the exit value of the subprocess.

Throw:

IllegalThreadStateException

If the subprocess has not yet terminated.


getErrorStream

public abstract InputStream getErrorStream() 

Gets the error stream of the subprocess.

Return Value:

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.

Return Value:

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.

Return Value:

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.

Return Value:

Returns the exit value of the process.

Throw:

InterruptedException

If the waitFor was interrupted.



Top© 1996 Sun Microsystems, Inc. All rights reserved.