Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libjava / classpath / java / lang / Process.java
blobccaa3f15358b5759d7a20f34b2af79a759d5e3fc
1 /* Process.java - Represent spawned system process
2 Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2005
3 Free Software Foundation, Inc.
5 This file is part of GNU Classpath.
7 GNU Classpath is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GNU Classpath is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU Classpath; see the file COPYING. If not, write to the
19 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 02110-1301 USA.
22 Linking this library statically or dynamically with other modules is
23 making a combined work based on this library. Thus, the terms and
24 conditions of the GNU General Public License cover the whole
25 combination.
27 As a special exception, the copyright holders of this library give you
28 permission to link this library with independent modules to produce an
29 executable, regardless of the license terms of these independent
30 modules, and to copy and distribute the resulting executable under
31 terms of your choice, provided that you also meet, for each linked
32 independent module, the terms and conditions of the license of that
33 module. An independent module is a module which is not derived from
34 or based on this library. If you modify this library, you may extend
35 this exception to your version of the library, but you are not
36 obligated to do so. If you do not wish to do so, delete this
37 exception statement from your version. */
40 package java.lang;
42 import java.io.File;
43 import java.io.InputStream;
44 import java.io.OutputStream;
46 /**
47 * An instance of a subclass of <code>Process</code> is created by the
48 * <code>Runtime.exec</code> methods. Methods in <code>Process</code>
49 * provide a means to send input to a process, obtain the output from a
50 * subprocess, destroy a subprocess, obtain the exit value from a
51 * subprocess, and wait for a subprocess to complete.
53 * <p>This is dependent on the platform, and some processes (like native
54 * windowing processes, 16-bit processes in Windows, or shell scripts) may
55 * be limited in functionality. Because some platforms have limited buffers
56 * between processes, you may need to provide input and read output to prevent
57 * the process from blocking, or even deadlocking.
59 * <p>Even if all references to this object disapper, the process continues
60 * to execute to completion. There are no guarantees that the
61 * subprocess execute asynchronously or concurrently with the process which
62 * owns this object.
64 * @author Brian Jones
65 * @author Tom Tromey (tromey@cygnus.com)
66 * @see Runtime#exec(String[], String[], File)
67 * @since 1.0
68 * @status updated to 1.4
70 public abstract class Process
72 /**
73 * Empty constructor does nothing.
75 public Process()
79 /**
80 * Obtain the output stream that sends data to the subprocess. This is
81 * the STDIN of the subprocess. When implementing, you should probably
82 * use a buffered stream.
84 * @return the output stream that pipes to the process input
86 public abstract OutputStream getOutputStream();
88 /**
89 * Obtain the input stream that receives data from the subprocess. This is
90 * the STDOUT of the subprocess. When implementing, you should probably
91 * use a buffered stream.
93 * @return the input stream that pipes data from the process output
95 public abstract InputStream getInputStream();
97 /**
98 * Obtain the input stream that receives data from the subprocess. This is
99 * the STDERR of the subprocess. When implementing, you should probably
100 * use a buffered stream.
102 * @return the input stream that pipes data from the process error output
104 public abstract InputStream getErrorStream();
107 * The thread calling <code>waitFor</code> will block until the subprocess
108 * has terminated. If the process has already terminated then the method
109 * immediately returns with the exit value of the subprocess.
111 * @return the subprocess exit value; 0 conventionally denotes success
112 * @throws InterruptedException if another thread interrupts the blocked one
114 public abstract int waitFor() throws InterruptedException;
117 * When a process terminates there is associated with that termination
118 * an exit value for the process to indicate why it terminated. A return
119 * of <code>0</code> denotes normal process termination by convention.
121 * @return the exit value of the subprocess
122 * @throws IllegalThreadStateException if the subprocess has not terminated
124 public abstract int exitValue();
127 * Kills the subprocess and all of its children forcibly.
129 public abstract void destroy();
130 } // class Process