home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / Process.java < prev    next >
Text File  |  1997-05-20  |  4KB  |  106 lines

  1. /*
  2.  * @(#)Process.java    1.10 97/01/22
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. package java.lang;
  24.  
  25. import java.io.*;
  26.  
  27. /** 
  28.  * The <code>exec</code> methods return an 
  29.  * instance of a subclass of <code>Process</code> that can be used to 
  30.  * control the process and obtain information about it. 
  31.  * <p>
  32.  * The subprocess is not killed when there are no more references to 
  33.  * the <code>Process</code> object, but rather the subprocess 
  34.  * continues executing asynchronously. 
  35.  *
  36.  * @author  unascribed
  37.  * @version 1.10, 01/22/97
  38.  * @see     java.lang.Runtime#exec(java.lang.String)
  39.  * @see     java.lang.Runtime#exec(java.lang.String, java.lang.String[])
  40.  * @see     java.lang.Runtime#exec(java.lang.String[])
  41.  * @see     java.lang.Runtime#exec(java.lang.String[], java.lang.String[])
  42.  * @since   JDK1.0
  43.  */
  44. public abstract class Process 
  45. {
  46.     /**
  47.      * Gets the output stream of the subprocess.
  48.      * This stream is usually buffered.
  49.      *
  50.      * @return  the output stream connected to the normal input of the
  51.      *          subprocess.
  52.      * @since   JDK1.0
  53.      */
  54.     abstract public OutputStream getOutputStream();
  55.  
  56.     /** 
  57.      * Gets the input stream of the subprocess.
  58.      * This stream is usually buffered.
  59.      *
  60.      * @return  the input stream connected to the normal output of the
  61.      *          subprocess.
  62.      * @since   JDK1.0
  63.      */
  64.     abstract public InputStream getInputStream();
  65.  
  66.     /**
  67.      * Gets the error stream of the subprocess.
  68.      * This stream is usually unbuffered.
  69.      *
  70.      * @return  the input stream connected to the error stream of the
  71.      *          subprocess.
  72.      * @since   JDK1.0
  73.      */
  74.     abstract public InputStream getErrorStream();
  75.  
  76.     /**
  77.      * Waits for the subprocess to complete. This method returns 
  78.      * immediately if the subprocess has already terminated. If the
  79.      * subprocess has not yet terminated, the calling thread will be
  80.      * blocked until the subprocess exits.
  81.      *
  82.      * @return     the exit value of the process.
  83.      * @exception  InterruptedException  if the <code>waitFor</code> was
  84.      *               interrupted.
  85.      * @since      JDK1.0
  86.      */
  87.     abstract public int waitFor() throws InterruptedException;
  88.  
  89.     /**
  90.      * Returns the exit value for the subprocess.
  91.      *
  92.      * @return  the exit value of the subprocess.
  93.      * @exception  IllegalThreadStateException  if the subprocess has not yet
  94.      *               terminated.
  95.      * @since      JDK1.0
  96.      */
  97.     abstract public int exitValue();
  98.  
  99.     /**
  100.      * Kills the subprocess. 
  101.      *
  102.      * @since   JDK1.0
  103.      */
  104.     abstract public void destroy();
  105. }
  106.