src/share/classes/java/lang/Process.java
Print this page
@@ -89,11 +89,11 @@
* output stream to be buffered.
*
* @return the output stream connected to the normal input of the
* subprocess
*/
- abstract public OutputStream getOutputStream();
+ public abstract OutputStream getOutputStream();
/**
* Returns the input stream connected to the normal output of the
* subprocess. The stream obtains data piped from the standard
* output of the process represented by this {@code Process} object.
@@ -115,11 +115,11 @@
* input stream to be buffered.
*
* @return the input stream connected to the normal output of the
* subprocess
*/
- abstract public InputStream getInputStream();
+ public abstract InputStream getInputStream();
/**
* Returns the input stream connected to the error output of the
* subprocess. The stream obtains data piped from the error output
* of the process represented by this {@code Process} object.
@@ -136,11 +136,11 @@
* input stream to be buffered.
*
* @return the input stream connected to the error output of
* the subprocess
*/
- abstract public InputStream getErrorStream();
+ public abstract InputStream getErrorStream();
/**
* Causes the current thread to wait, if necessary, until the
* process represented by this {@code Process} object has
* terminated. This method returns immediately if the subprocess
@@ -154,11 +154,11 @@
* @throws InterruptedException if the current thread is
* {@linkplain Thread#interrupt() interrupted} by another
* thread while it is waiting, then the wait is ended and
* an {@link InterruptedException} is thrown.
*/
- abstract public int waitFor() throws InterruptedException;
+ public abstract int waitFor() throws InterruptedException;
/**
* Returns the exit value for the subprocess.
*
* @return the exit value of the subprocess represented by this
@@ -165,13 +165,28 @@
* {@code Process} object. By convention, the value
* {@code 0} indicates normal termination.
* @throws IllegalThreadStateException if the subprocess represented
* by this {@code Process} object has not yet terminated
*/
- abstract public int exitValue();
+ public abstract int exitValue();
/**
+ * Kills the subprocess. Whether the subprocess represented by this
+ * {@code Process} object is forcibly terminated or not is
+ * implementation dependent.
+ */
+ public abstract void destroy();
+
+ /**
* Kills the subprocess. The subprocess represented by this
* {@code Process} object is forcibly terminated.
*/
- abstract public void destroy();
+ public abstract Process destroyForcibly();
+
+ /**
+ * Returns a boolean indicating whether the subprocess is alive.
+ *
+ * @return {@code true} if the subprocess represented by this
+ * {@code Process} object has not yet terminated.
+ */
+ public abstract boolean isAlive();
}