Java Doc for SubProcess.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » rmi » common » 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 » Apache Harmony Java SE » org package » org.apache.harmony.rmi.common 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.harmony.rmi.common.SubProcess

SubProcess
final public class SubProcess (Code)
Allows for execution of external applications as subprocesses.
author:
   Vasily Zakharov
version:
   $Revision: 1.1.2.2 $


Field Summary
final public static  StringREADY_STRING
     Default argument to SubProcess.tell(String) and expect SubProcess.expect(String) methods.

Constructor Summary
public  SubProcess(String[] args)
     Creates subprocess with full control of its streams.
public  SubProcess(String[] args, boolean pipe)
     Creates instance of this class with no control of its streams.
public  SubProcess(String[] args, OutputStream outputStream, InputStream inputStream, OutputStream errorStream)
     Creates instance of this class with no control of its streams.
public  SubProcess(String[] args, boolean inputControl, OutputStream outputStream, boolean outputControl, InputStream inputStream, boolean errorControl, OutputStream errorStream)
     Creates instance of this class.

Method Summary
public  voidcloseOutput()
     Closes the program output.
public  voiddestroy()
     Destroys this subprocess.
public  voiddiscardError()
     Discards the remaining error input.
public  voiddiscardInput()
     Discards the remaining input.
public  voidexpect()
     Waits until the appears in the program input.
public  voidexpect(String str)
     Waits until the specified string appears in the program input.
public  voidexpect(String str, boolean whole, boolean ignoreCase)
     Waits until the specified string appears in the program input.
public  voidexpectError()
     Waits until the appears in the program error input.
public  voidexpectError(String str)
     Waits until the specified string appears in the program error input.
public  voidexpectError(String str, boolean whole, boolean ignoreCase)
     Waits until the specified string appears in the program error input.
public static  voidexpectIn()
     Waits until the appears in .
public static  voidexpectIn(String str)
     Waits until the specified string appears in .
public static  voidexpectIn(String str, boolean whole, boolean ignoreCase)
     Waits until the specified string appears in .
public  voidpipeError()
     Pipes the remaining error input to the target error stream specified in constructor.
public  voidpipeError(OutputStream errorStream)
     Pipes the remaining error input to the specified error stream.
public  voidpipeInput()
     Pipes the remaining input to the target output stream specified in constructor.
public  voidpipeInput(OutputStream outputStream)
     Pipes the remaining input to the specified output stream.
public  voidpipeOutput()
     Pipes the target input stream specified in constructor to the program output stream.
public  voidpipeOutput(InputStream inputStream)
     Pipes the specified input stream to the program output stream.
public  voidtell()
     Writes the to the process output stream.
public  voidtell(String str)
     Writes the specified string to the process output stream.
public static  voidtellError()
     Writes the to the .
public static  voidtellError(String str)
     Writes the specified string to the .
public static  voidtellOut()
     Writes the to the .
public static  voidtellOut(String str)
     Writes the specified string to the .
public  intwaitFor()
     Waits for subprocess to terminate and returns its exit code.

Field Detail
READY_STRING
final public static String READY_STRING(Code)
Default argument to SubProcess.tell(String) and expect SubProcess.expect(String) methods.




Constructor Detail
SubProcess
public SubProcess(String[] args) throws IOException(Code)
Creates subprocess with full control of its streams. Equivalent to SubProcess.SubProcess(String[],boolean,OutputStream,boolean,InputStream,boolean,OutputStream)SubProcess(args, true, System.out, true, System.in, true, System.err) .
Parameters:
  args - Program name and command line arguments(as for Runtime.exec(String[])).
throws:
  IOException -



SubProcess
public SubProcess(String[] args, boolean pipe) throws IOException(Code)
Creates instance of this class with no control of its streams. If pipe is true, the streams are piped to the respective system streams of the current process. This is equivalent to SubProcess.SubProcess(String[],boolean,OutputStream,boolean,InputStream,boolean,OutputStream)SubProcess(args, false, System.out, false, System.in, false, System.err) . If pipe is false, the streams are discarded. This is equivalent to SubProcess.SubProcess(String[],boolean,OutputStream,boolean,InputStream,boolean,OutputStream)SubProcess(args, false, null, false, null, false, null) .
Parameters:
  args - Program name and command line arguments(as for Runtime.exec(String[])).
Parameters:
  pipe - If true, the streams are pipedto the respective system streams of the current process,if false, the streams are discarded.
throws:
  IOException -



SubProcess
public SubProcess(String[] args, OutputStream outputStream, InputStream inputStream, OutputStream errorStream) throws IOException(Code)
Creates instance of this class with no control of its streams. This is equivalent to SubProcess.SubProcess(String[],boolean,OutputStream,boolean,InputStream,boolean,OutputStream)SubProcess(args, false, outputStream, false, inputStream, false, errorStream) .
Parameters:
  args - Program name and command line arguments(as for Runtime.exec(String[])).
Parameters:
  outputStream - Output stream to pipe program input toif inputControl is false.May be null,in this case input from the program is discarded.
Parameters:
  inputStream - Input stream to pipe to the program output streamif outputControl is false.May be null,in this case the program output stream is closed.
Parameters:
  errorStream - Error stream to pipe program error input toif errorControl is false.May be null,in this case error input from the program is discarded.
throws:
  IOException -



SubProcess
public SubProcess(String[] args, boolean inputControl, OutputStream outputStream, boolean outputControl, InputStream inputStream, boolean errorControl, OutputStream errorStream) throws IOException(Code)
Creates instance of this class.
Parameters:
  args - Program name and command line arguments(as for Runtime.exec(String[])).
Parameters:
  inputControl - If true, input from the program is availableto SubProcess.expect() methods and outputStreamparameter is ignored, otherwise it is piped to the specifiedoutputStream.
Parameters:
  outputStream - Output stream to pipe program input toif inputControl is false.May be null,in this case input from the program is discarded.
Parameters:
  outputControl - If true, output stream to the program is availableto SubProcess.tell() methods and inputStreamparameter is ignored, otherwise the specifiedinputStream is piped to program output stream.
Parameters:
  inputStream - Input stream to pipe to the program output streamif outputControl is false.May be null,in this case the program output stream is closed.
Parameters:
  errorControl - If true, error input from the program is availableto SubProcess.expectError() methods and errorStreamparameter is ignored, otherwise it is piped to the specifiederrorStream.
Parameters:
  errorStream - Error stream to pipe program error input toif errorControl is false.May be null,in this case error input from the program is discarded.
throws:
  IOException -




Method Detail
closeOutput
public void closeOutput()(Code)
Closes the program output. Usable when outputControl is enabled but there's nothing else to .



destroy
public void destroy()(Code)
Destroys this subprocess.



discardError
public void discardError()(Code)
Discards the remaining error input. Usable when errorControl is enabled but there's nothing else to .



discardInput
public void discardInput()(Code)
Discards the remaining input. Usable when inputControl is enabled but there's nothing else to .



expect
public void expect() throws IllegalStateException, IOException(Code)
Waits until the appears in the program input. Equivalent to SubProcess.expect(String,boolean,boolean) expect(READY_STRING, false, false) .
throws:
  IllegalStateException - If subprocess input stream control is disabled.
throws:
  IOException - If I/O error occurs.



expect
public void expect(String str) throws IllegalStateException, IOException(Code)
Waits until the specified string appears in the program input. Equivalent to SubProcess.expect(String,boolean,boolean) expect(str, false, false) .
Parameters:
  str - String to wait for.
throws:
  IllegalStateException - If subprocess input stream control is disabled.
throws:
  IOException - If I/O error occurs.



expect
public void expect(String str, boolean whole, boolean ignoreCase) throws IllegalStateException, IOException(Code)
Waits until the specified string appears in the program input.
Parameters:
  str - String to wait for.
Parameters:
  whole - If true, the whole input lines are comparedto the specified string, otherwise the string is consideredto be found if it appears as a substring in any input line.
Parameters:
  ignoreCase - If true, case-insensitive comparison is performed.
throws:
  IllegalStateException - If subprocess input stream control is disabled.
throws:
  IOException - If I/O error occurs.



expectError
public void expectError() throws IllegalStateException, IOException(Code)
Waits until the appears in the program error input. Equivalent to SubProcess.expectError(String,boolean,boolean) expectError(READY_STRING, false, false) .
throws:
  IllegalStateException - If subprocess error stream control is disabled.
throws:
  IOException - If I/O error occurs.



expectError
public void expectError(String str) throws IllegalStateException, IOException(Code)
Waits until the specified string appears in the program error input. Equivalent to SubProcess.expectError(String,boolean,boolean) expectError(str, false, false) .
Parameters:
  str - String to wait for.
throws:
  IllegalStateException - If subprocess error stream control is disabled.
throws:
  IOException - If I/O error occurs.



expectError
public void expectError(String str, boolean whole, boolean ignoreCase) throws IllegalStateException, IOException(Code)
Waits until the specified string appears in the program error input.
Parameters:
  str - String to wait for.
Parameters:
  whole - If true, the whole input lines are comparedto the specified string, otherwise the string is consideredto be found if it appears as a substring in any input line.
Parameters:
  ignoreCase - If true, case-insensitive comparison is performed.
throws:
  IllegalStateException - If subprocess error stream control is disabled.
throws:
  IOException - If I/O error occurs.



expectIn
public static void expectIn() throws IOException(Code)
Waits until the appears in . Equivalent to SubProcess.expectIn(String,boolean,boolean) expectIn(READY_STRING, false, false) . This static method is usable by child subprocesses for communication with the parent process.
throws:
  IOException - If I/O error occurs.



expectIn
public static void expectIn(String str) throws IOException(Code)
Waits until the specified string appears in . Equivalent to SubProcess.expectIn(String,boolean,boolean) expectIn(str, false, false) . This static method is usable by child subprocesses for communication with the parent process.
Parameters:
  str - String to wait for.
throws:
  IOException - If I/O error occurs.



expectIn
public static void expectIn(String str, boolean whole, boolean ignoreCase) throws IOException(Code)
Waits until the specified string appears in . This static method is usable by child subprocesses for communication with the parent process.
Parameters:
  str - String to wait for.
Parameters:
  whole - If true, the whole input lines are comparedto the specified string, otherwise the string is consideredto be found if it appears as a substring in any input line.
Parameters:
  ignoreCase - If true, case-insensitive comparison is performed.
throws:
  IOException - If I/O error occurs.



pipeError
public void pipeError()(Code)
Pipes the remaining error input to the target error stream specified in constructor. Usable when errorControl is enabled but there's nothing else to .



pipeError
public void pipeError(OutputStream errorStream)(Code)
Pipes the remaining error input to the specified error stream. Usable when errorControl is enabled but there's nothing else to .
Parameters:
  errorStream - Error stream to pipe program error input to.May be null,in this case error input from the program is discarded.



pipeInput
public void pipeInput()(Code)
Pipes the remaining input to the target output stream specified in constructor. Usable when inputControl is enabled but there's nothing else to .



pipeInput
public void pipeInput(OutputStream outputStream)(Code)
Pipes the remaining input to the specified output stream. Usable when inputControl is enabled but there's nothing else to .
Parameters:
  outputStream - Output stream to pipe program input to.May be null,in this case input from the program is discarded.



pipeOutput
public void pipeOutput()(Code)
Pipes the target input stream specified in constructor to the program output stream. Usable when outputControl is enabled but there's nothing else to .



pipeOutput
public void pipeOutput(InputStream inputStream)(Code)
Pipes the specified input stream to the program output stream. Usable when outputControl is enabled but there's nothing else to .
Parameters:
  inputStream - Input stream to pipe to the program output.May be null,in this case the program output stream is closed.



tell
public void tell() throws IllegalStateException, IOException(Code)
Writes the to the process output stream.
throws:
  IllegalStateException - If subprocess output stream control is disabled.
throws:
  IOException - If I/O error occurs.



tell
public void tell(String str) throws IllegalStateException, IOException(Code)
Writes the specified string to the process output stream.
Parameters:
  str - String to write.
throws:
  IllegalStateException - If subprocess output stream control is disabled.
throws:
  IOException - If I/O error occurs.



tellError
public static void tellError() throws IOException(Code)
Writes the to the . This static method is usable by child subprocesses for communication with the parent process.
throws:
  IOException - If I/O error occurs.



tellError
public static void tellError(String str) throws IOException(Code)
Writes the specified string to the . This static method is usable by child subprocesses for communication with the parent process.
Parameters:
  str - String to write.
throws:
  IOException - If I/O error occurs.



tellOut
public static void tellOut() throws IOException(Code)
Writes the to the . This static method is usable by child subprocesses for communication with the parent process.
throws:
  IOException - If I/O error occurs.



tellOut
public static void tellOut(String str) throws IOException(Code)
Writes the specified string to the . This static method is usable by child subprocesses for communication with the parent process.
Parameters:
  str - String to write.
throws:
  IOException - If I/O error occurs.



waitFor
public int waitFor()(Code)
Waits for subprocess to terminate and returns its exit code. The subprocess exit code.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.