Source Code Cross Referenced for Process.java in  » 6.0-JDK-Modules » j2me » java » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » java.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#)Process.java	1.26 06/10/10
003:         *
004:         * Copyright  1990-2006 Sun Microsystems, Inc. All Rights Reserved.  
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER  
006:         *   
007:         * This program is free software; you can redistribute it and/or  
008:         * modify it under the terms of the GNU General Public License version  
009:         * 2 only, as published by the Free Software Foundation.   
010:         *   
011:         * This program is distributed in the hope that it will be useful, but  
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of  
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  
014:         * General Public License version 2 for more details (a copy is  
015:         * included at /legal/license.txt).   
016:         *   
017:         * You should have received a copy of the GNU General Public License  
018:         * version 2 along with this work; if not, write to the Free Software  
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
020:         * 02110-1301 USA   
021:         *   
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa  
023:         * Clara, CA 95054 or visit www.sun.com if you need additional  
024:         * information or have any questions. 
025:         *
026:         */
027:
028:        package java.lang;
029:
030:        import java.io.*;
031:
032:        /**
033:         * The <code>Runtime.exec</code> methods create a native process and
034:         * return an instance of a subclass of <code>Process</code> that can 
035:         * be used to control the process and obtain information about it. 
036:         *  The class <code>Process</code> provides methods for performing 
037:         * input from the process, performing output to the process, waiting 
038:         * for the process to complete, checking the exit status of the process, 
039:         * and destroying (killing) the process. 
040:         * <p>
041:         * The <code>Runtime.exec</code> methods may not work well for special
042:         * processes on certain native platforms, such as native windowing
043:         * processes, daemon processes, Win16/DOS processes on Microsoft Windows, or shell
044:         * scripts. The created subprocess does not have its own terminal or
045:         * console. All its standard io (i.e. stdin, stdout, stderr)  operations
046:         * will be redirected to the parent process through three streams
047:         * (<code>Process.getOutputStream()</code>,
048:         * <code>Process.getInputStream()</code>,
049:         * <code>Process.getErrorStream()</code>).
050:         * The parent process uses these streams to feed input to and get output
051:         * from the subprocess. Because some native platforms only provide
052:         * limited buffer size for standard input and output streams, failure
053:         * to promptly write the input stream or read the output stream of
054:         * the subprocess may cause the subprocess to block, and even deadlock.
055:         * <p>
056:         * The subprocess is not killed when there are no more references to 
057:         * the <code>Process</code> object, but rather the subprocess 
058:         * continues executing asynchronously. 
059:         * <p>
060:         * There is no requirement that a process represented by a <code>Process</code> 
061:         * object execute asynchronously or concurrently with respect to the Java 
062:         * process that owns the <code>Process</code> object.
063:         *
064:         * @author  unascribed
065:         * @version 1.17, 02/02/00
066:         * @see     java.lang.Runtime#exec(java.lang.String)
067:         * @see     java.lang.Runtime#exec(java.lang.String, java.lang.String[])
068:         * @see     java.lang.Runtime#exec(java.lang.String[])
069:         * @see     java.lang.Runtime#exec(java.lang.String[], java.lang.String[])
070:         * @since   JDK1.0
071:         */
072:        public abstract class Process {
073:            /**
074:             * Gets the output stream of the subprocess.
075:             * Output to the stream is piped into the standard input stream of 
076:             * the process represented by this <code>Process</code> object. 
077:             * <p>
078:             * Implementation note: It is a good idea for the output stream to 
079:             * be buffered.
080:             *
081:             * @return  the output stream connected to the normal input of the
082:             *          subprocess.
083:             */
084:            abstract public OutputStream getOutputStream();
085:
086:            /**
087:             * Gets the input stream of the subprocess.
088:             * The stream obtains data piped from the standard output stream 
089:             * of the process represented by this <code>Process</code> object. 
090:             * <p>
091:             * Implementation note: It is a good idea for the input stream to 
092:             * be buffered.
093:             *
094:             * @return  the input stream connected to the normal output of the
095:             *          subprocess.
096:             */
097:            abstract public InputStream getInputStream();
098:
099:            /**
100:             * Gets the error stream of the subprocess.
101:             * The stream obtains data piped from the error output stream of the 
102:             * process represented by this <code>Process</code> object. 
103:             * <p>
104:             * Implementation note: It is a good idea for the input stream to be 
105:             * buffered.
106:             *
107:             * @return  the input stream connected to the error stream of the
108:             *          subprocess.
109:             */
110:            abstract public InputStream getErrorStream();
111:
112:            /**
113:             * causes the current thread to wait, if necessary, until the 
114:             * process represented by this <code>Process</code> object has 
115:             * terminated. This method returns 
116:             * immediately if the subprocess has already terminated. If the
117:             * subprocess has not yet terminated, the calling thread will be
118:             * blocked until the subprocess exits.
119:             *
120:             * @return     the exit value of the process. By convention, 
121:             *             <code>0</code> indicates normal termination.
122:             * @exception  InterruptedException  if the current thread is 
123:             *             {@link Thread#interrupt() interrupted} by another thread 
124:             *             while it is waiting, then the wait is ended and an 
125:             *             <code>InterruptedException</code> is thrown.
126:             */
127:            abstract public int waitFor() throws InterruptedException;
128:
129:            /**
130:             * Returns the exit value for the subprocess.
131:             *
132:             * @return  the exit value of the subprocess represented by this 
133:             *          <code>Process</code> object. by convention, the value 
134:             *          <code>0</code> indicates normal termination.
135:             * @exception  IllegalThreadStateException  if the subprocess represented 
136:             *             by this <code>Process</code> object has not yet terminated.
137:             */
138:            abstract public int exitValue();
139:
140:            /**
141:             * Kills the subprocess. The subprocess represented by this 
142:             * <code>Process</code> object is forcibly terminated.
143:             */
144:            abstract public void destroy();
145:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.