Source Code Cross Referenced for AnyProcess.java in  » Web-Framework » anvil » anvil » core » io » 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 » Web Framework » anvil » anvil.core.io 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: AnyProcess.java,v 1.14 2002/09/16 08:05:02 jkl Exp $
003:         *
004:         * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
005:         *
006:         * Use is subject to license terms, as defined in
007:         * Anvil Sofware License, Version 1.1. See LICENSE 
008:         * file, or http://njet.org/license-1.1.txt
009:         */
010:        package anvil.core.io;
011:
012:        import anvil.core.Any;
013:        import anvil.core.AnyAbstractClass;
014:        import anvil.script.Context;
015:        import java.io.BufferedOutputStream;
016:
017:        /// @class Process
018:        /// Native process created by <code>exec</code>.
019:
020:        /**
021:         * class AnyProcess
022:         *
023:         * @author: Jani Lehtimäki
024:         */
025:        public class AnyProcess extends AnyAbstractClass {
026:
027:            public static final anvil.script.compiler.NativeClass __class__ = new anvil.script.compiler.NativeClass(
028:                    "Process",
029:                    AnyProcess.class,
030:                    //DOC{{
031:                    ""
032:                            + " @class Process\n"
033:                            + " Native process created by <code>exec</code>.\n"
034:                            + " @method getInputStream\n"
035:                            + " Gets the input stream of the subprocess.\n"
036:                            + " @synopsis InputStream getInputStream()\n"
037:                            + " @method getErrorStream\n"
038:                            + " Gets the error stream of the subprocess.\n"
039:                            + " @synopsis OutputStream getErrorStream()\n"
040:                            + " @method getOutputStream\n"
041:                            + " Gets the output stream of the subprocess.\n"
042:                            + " @synopsis OutputStream getOutputStream()\n"
043:                            + " @method waitFor\n"
044:                            + " causes the current thread to wait, if necessary, until the \n"
045:                            + " process represented by this Process object hasterminated.\n"
046:                            + " @synopsis int waitFor()\n"
047:                            + " @return the exit value of the process. \n"
048:                            + " By convention, 0 indicates normal termination.\n"
049:                            + " @throws Interrupted if the current thread is interrupted \n"
050:                            + " by another thread while it is waiting, then the wait is ended \n"
051:                            + " and an Interrupted is thrown.\n"
052:                            + " @method exitValue\n"
053:                            + " Returns the exit value of process.\n"
054:                            + " @synopsis int exitValue()\n"
055:                            + " @return Exit value of process, or <code>null</code> if the\n"
056:                            + " process is not yet terminated.\n"
057:                            + " @method destroy\n"
058:                            + " Kills the subprocess. The subprocess represented by this \n"
059:                            + " Process is forcibly terminated.\n"
060:                            + " @synopsis void destroy()\n"
061:            //}}DOC
062:            );
063:            static {
064:                IOModule.class.getName();
065:            }
066:
067:            private Process _process;
068:
069:            public AnyProcess(Process process) {
070:                _process = process;
071:            }
072:
073:            public final anvil.script.ClassType classOf() {
074:                return __class__;
075:            }
076:
077:            public Object toObject() {
078:                return _process;
079:            }
080:
081:            /// @method getInputStream
082:            /// Gets the input stream of the subprocess.
083:            /// @synopsis InputStream getInputStream()
084:            public Any m_getInputStream() {
085:                return new AnyInputStream(_process.getInputStream());
086:            }
087:
088:            /// @method getErrorStream
089:            /// Gets the error stream of the subprocess.
090:            /// @synopsis OutputStream getErrorStream()
091:            public Any m_getErrorStream() {
092:                return new AnyInputStream(_process.getErrorStream());
093:            }
094:
095:            /// @method getOutputStream
096:            /// Gets the output stream of the subprocess.
097:            /// @synopsis OutputStream getOutputStream()
098:            public Any m_getOutputStream() {
099:                return new AnyOutputStream(new BufferedOutputStream(_process
100:                        .getOutputStream()));
101:            }
102:
103:            /// @method waitFor
104:            /// causes the current thread to wait, if necessary, until the 
105:            /// process represented by this Process object hasterminated.
106:            /// @synopsis int waitFor()
107:            /// @return the exit value of the process. 
108:            /// By convention, 0 indicates normal termination.
109:            /// @throws Interrupted if the current thread is interrupted 
110:            /// by another thread while it is waiting, then the wait is ended 
111:            /// and an Interrupted is thrown.
112:            public Any m_waitFor(Context context) {
113:                try {
114:                    return Any.create(_process.waitFor());
115:                } catch (InterruptedException e) {
116:                    throw context.Interrupted(e.getMessage());
117:                }
118:            }
119:
120:            /// @method exitValue
121:            /// Returns the exit value of process.
122:            /// @synopsis int exitValue()
123:            /// @return Exit value of process, or <code>null</code> if the
124:            /// process is not yet terminated.
125:            public Any m_exitValue(Context context) {
126:                try {
127:                    return Any.create(_process.exitValue());
128:                } catch (IllegalThreadStateException e) {
129:                    throw context.BadState(e.getMessage());
130:                }
131:            }
132:
133:            /// @method destroy
134:            /// Kills the subprocess. The subprocess represented by this 
135:            /// Process is forcibly terminated.
136:            /// @synopsis void destroy()
137:            public Any m_destroy() {
138:                _process.destroy();
139:                return this;
140:            }
141:
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.