KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > console > ExecHandle


1 package org.sapia.console;
2
3 import java.io.IOException JavaDoc;
4 import java.io.InputStream JavaDoc;
5
6
7 /**
8  * Wraps a Java <code>Process</code> object.
9  *
10  * @see CmdLine
11  * @see CmdLine#exec()
12  * @see org.sapia.console.CmdLineThread
13  *
14  * @author Yanick Duchesne
15  * <dl>
16  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
17  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
18  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
19  * </dl>
20  */

21 public class ExecHandle {
22   private CmdLineThread _cmdThread;
23
24   /**
25    * Constructor for ExecHandle.
26    */

27   ExecHandle(CmdLineThread cmdThread) {
28     _cmdThread = cmdThread;
29   }
30
31   /**
32    * @see CmdLineThread#getInputStream()
33    */

34   public InputStream JavaDoc getInputStream() throws IOException JavaDoc {
35     return _cmdThread.getInputStream();
36   }
37
38   /**
39    * @see CmdLineThread#getErrStream()
40    */

41   public InputStream JavaDoc getErrStream() throws IOException JavaDoc {
42     return _cmdThread.getErrStream();
43   }
44
45   /**
46    * @return the <code>Process</code> held within this instance.
47    */

48   public Process JavaDoc getProcess() {
49     return _cmdThread.getProcess();
50   }
51
52   /**
53    *
54    *
55    */

56   public void close() {
57     _cmdThread.close();
58   }
59 }
60
Popular Tags