站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档

Class java.lang.Process - JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.lang.Process

java.lang.Object
   |
   +----java.lang.Process

public abstract class Process
extends Object
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.

See Also:
exec, exec, exec, exec

Constructor Index

 o Process()

Method Index

 o destroy()
Kills the subprocess.
 o exitValue()
Returns the exit value for the subprocess.
 o getErrorStream()
Gets the error stream of the subprocess.
 o getInputStream()
Gets the input stream of the subprocess.
 o getOutputStream()
Gets the output stream of the subprocess.
 o waitFor()
Waits for the subprocess to complete.

Constructors

 o Process
 public Process()

Methods

 o getOutputStream
 public abstract OutputStream getOutputStream()
Gets the output stream of the subprocess. This stream is usually buffered.

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

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

Returns:
the input stream connected to the error stream of the subprocess.
 o waitFor
 public abstract int waitFor() throws InterruptedException
Waits for the subprocess to complete. This method returns immediately if the subprocess has already terminated. If the subprocess has not yet terminated, the calling thread will be blocked until the subprocess exits.

Returns:
the exit value of the process.
Throws: InterruptedException
if the waitFor was interrupted.
 o exitValue
 public abstract int exitValue()
Returns the exit value for the subprocess.

Returns:
the exit value of the subprocess.
Throws: IllegalThreadStateException
if the subprocess has not yet terminated.
 o destroy
 public abstract void destroy()
Kills the subprocess.


All Packages  Class Hierarchy  This Package  Previous  Next  Index

Submit a bug or feature - Version 1.1.8 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1995-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.