Java Doc for NativeCommandExec.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » controller » backup » backupers » 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 » Database JDBC Connection Pool » sequoia 2.10.9 » org.continuent.sequoia.controller.backup.backupers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.continuent.sequoia.controller.backup.backupers.NativeCommandExec

NativeCommandExec
public class NativeCommandExec (Code)
This class defines a NativeCommandExec, which abstracts out native command execution logic into a small and easily verified class that does not have dependencies on backuper implementations. Once instantiated this class can execute a series of commands in sequence.
author:
   Robert Hodges
version:
   1.0

Inner Class :class NativeCommand

Field Summary
 ArrayListstderr
    
 ArrayListstdout
    

Constructor Summary
public  NativeCommandExec()
    

Method Summary
public  intexecuteNativeCommand(String command, NativeCommandInputSource input, OutputStream output, int timeout, File workingDirectory, boolean ignoreStdErrOutput)
     Executes a native operating system command expressed as a String.
public  intexecuteNativeCommand(String command, NativeCommandInputSource input, OutputStream output, int timeout, boolean ignoreStdErrOutput)
    
public  intexecuteNativeCommand(String[] commands, NativeCommandInputSource input, OutputStream output, int timeout, File workingDirectory, boolean ignoreStdErrOutput)
     Executes a native operating system command expressed as an array.
public  intexecuteNativeCommand(String[] commands, NativeCommandInputSource input, OutputStream output, int timeout, boolean ignoreStdErrOutput)
    
public  ArrayListgetStderr()
     Returns all stderr from the most recent command.
public  ArrayListgetStdout()
     Returns all stdout from the most recent command.
public  voidinitOutput()
     Clears output arrays.
protected  voidlog(String name, ArrayList outArray)
     Utility routine to log output.
public  voidlogErrors()
     Write process error output to development log.
public  voidlogOutput()
     Write process standard output to development log.
protected  intmanageCommandExecution(String commandText, Process process, NativeCommandInputSource inputSource, OutputStream output, int timeout, boolean ignoreStdErrOutput)
     Manages execution of a command once it has been started as a process.
public  booleansafelyExecNativeCommand(String cmd, NativeCommandInputSource input, OutputStream output, int timeout, File workingDirectory, boolean ignoreStdErrOutput)
     Utility method to execute a native command with careful logging and coverage of all command outcomes.
public  booleansafelyExecNativeCommand(String cmd, NativeCommandInputSource input, OutputStream output, int timeout, boolean ignoreStdErrOutput)
    
public  booleansafelyExecNativeCommand(String[] cmds, NativeCommandInputSource input, OutputStream output, int timeout, File workingDirectory, boolean ignoreStdErrOutput)
     Utility method to execute a native command with careful logging and coverage of all command outcomes.
public  booleansafelyExecNativeCommand(String[] cmds, NativeCommandInputSource input, OutputStream output, int timeout, boolean ignoreStdErrOutput)
    
protected  booleansafelyExecNativeCommand0(NativeCommand nc, NativeCommandInputSource input, OutputStream output, int timeout, File workingDirectory, boolean ignoreStdErrOutput)
     Internal method to execute a native command with careful logging and coverage of all command outcomes.

Field Detail
stderr
ArrayList stderr(Code)



stdout
ArrayList stdout(Code)




Constructor Detail
NativeCommandExec
public NativeCommandExec()(Code)
Creates a new NativeCommandExec object




Method Detail
executeNativeCommand
public int executeNativeCommand(String command, NativeCommandInputSource input, OutputStream output, int timeout, File workingDirectory, boolean ignoreStdErrOutput) throws IOException, InterruptedException(Code)
Executes a native operating system command expressed as a String.
Parameters:
  command - String of command to execute
Parameters:
  input - Native command input
Parameters:
  output - Optional output to catch standard out
Parameters:
  timeout - Time in seconds to await command (0 = forever)
Parameters:
  workingDirectory - working directory for the command (null to inheritfrom Sequoia working dir)
Parameters:
  ignoreStdErrOutput - true if output on std error should be ignored,else any output on stderr will be considered as a failure 0 if successful, any number otherwise
exception:
  IOException - if an I/O error occurs
throws:
  InterruptedException - If there is a timeout failure



executeNativeCommand
public int executeNativeCommand(String command, NativeCommandInputSource input, OutputStream output, int timeout, boolean ignoreStdErrOutput) throws IOException, InterruptedException(Code)

See Also:   NativeCommandExec.executeNativeCommand(String,NativeCommandInputSource,OutputStream,int,File)



executeNativeCommand
public int executeNativeCommand(String[] commands, NativeCommandInputSource input, OutputStream output, int timeout, File workingDirectory, boolean ignoreStdErrOutput) throws IOException, InterruptedException(Code)
Executes a native operating system command expressed as an array.
Parameters:
  commands - Array of strings (command + args) to execute
Parameters:
  input - Native command input
Parameters:
  output - Command output stream
Parameters:
  timeout - Time in seconds to await command (0 = forever)
Parameters:
  workingDirectory - working directory for the command (null to inheritfrom Sequoia working dir)
Parameters:
  ignoreStdErrOutput - true if output on std error should be ignored,else any output on stderr will be considered as a failure 0 if successful, any number otherwise
exception:
  IOException - if an I/O error occurs
throws:
  InterruptedException - If there is a timeout failure



executeNativeCommand
public int executeNativeCommand(String[] commands, NativeCommandInputSource input, OutputStream output, int timeout, boolean ignoreStdErrOutput) throws IOException, InterruptedException(Code)

See Also:   NativeCommandExec.executeNativeCommand(String[],NativeCommandInputSource,OutputStream,int,File)



getStderr
public ArrayList getStderr()(Code)
Returns all stderr from the most recent command. stderr contents (may be truncated)



getStdout
public ArrayList getStdout()(Code)
Returns all stdout from the most recent command. stdout contents (may be truncated)



initOutput
public void initOutput()(Code)
Clears output arrays.



log
protected void log(String name, ArrayList outArray)(Code)
Utility routine to log output.
Parameters:
  name - Output type e.g., stdout or stderr
Parameters:
  outArray - List of lines of output



logErrors
public void logErrors()(Code)
Write process error output to development log.



logOutput
public void logOutput()(Code)
Write process standard output to development log.



manageCommandExecution
protected int manageCommandExecution(String commandText, Process process, NativeCommandInputSource inputSource, OutputStream output, int timeout, boolean ignoreStdErrOutput) throws InterruptedException(Code)
Manages execution of a command once it has been started as a process.
Parameters:
  commandText - The command text for logging messages
Parameters:
  process - The process object used to manage the command
Parameters:
  inputSource - Input source object or null if no input
Parameters:
  output - Optional output stream to catch standard out
Parameters:
  timeout - Time in seconds to await command (0 = forever)
Parameters:
  ignoreStdErrOutput - true if output on std error should be ignored,else any output on stderr will be considered as a failure 0 if successful, any number otherwise
throws:
  InterruptedException - If there is a timeout failure



safelyExecNativeCommand
public boolean safelyExecNativeCommand(String cmd, NativeCommandInputSource input, OutputStream output, int timeout, File workingDirectory, boolean ignoreStdErrOutput)(Code)
Utility method to execute a native command with careful logging and coverage of all command outcomes.
Parameters:
  cmd - Command string
Parameters:
  input - Array containing lines of input
Parameters:
  output - Optional output stream to catch data written to standardoutput
Parameters:
  timeout - Timeout in seconds (0 = infinite)
Parameters:
  workingDirectory - working directory for the command (null to inheritfrom Sequoia working dir)
Parameters:
  ignoreStdErrOutput - true if output on std error should be ignored,else any output on stderr will be considered as a failure true if command is successful



safelyExecNativeCommand
public boolean safelyExecNativeCommand(String cmd, NativeCommandInputSource input, OutputStream output, int timeout, boolean ignoreStdErrOutput)(Code)

See Also:   NativeCommandExec.safelyExecNativeCommand(String,NativeCommandInputSource,OutputStream,int,File)



safelyExecNativeCommand
public boolean safelyExecNativeCommand(String[] cmds, NativeCommandInputSource input, OutputStream output, int timeout, File workingDirectory, boolean ignoreStdErrOutput)(Code)
Utility method to execute a native command with careful logging and coverage of all command outcomes.
Parameters:
  cmds - Command array
Parameters:
  input - Input source for native command
Parameters:
  output - Optional output stream to catch data written to standardoutput
Parameters:
  timeout - Timeout in seconds (0 = infinite)
Parameters:
  workingDirectory - working directory for the command (null to inheritfrom Sequoia working dir)
Parameters:
  ignoreStdErrOutput - true if output on std error should be ignored,else any output on stderr will be considered as a failure true if command is successful



safelyExecNativeCommand
public boolean safelyExecNativeCommand(String[] cmds, NativeCommandInputSource input, OutputStream output, int timeout, boolean ignoreStdErrOutput)(Code)

See Also:   NativeCommandExec.safelyExecNativeCommand(String[],NativeCommandInputSource,OutputStream,int,File)



safelyExecNativeCommand0
protected boolean safelyExecNativeCommand0(NativeCommand nc, NativeCommandInputSource input, OutputStream output, int timeout, File workingDirectory, boolean ignoreStdErrOutput)(Code)
Internal method to execute a native command with careful logging and coverage of all command outcomes. This method among other things logs output fully in the event of a failure.
Parameters:
  cmd - Command holder object
Parameters:
  input - Command input source
Parameters:
  output - Optional output stream to catch data written to standardoutput
Parameters:
  timeout - Timeout in seconds (0 = infinite)
Parameters:
  workingDirectory - working directory for the command (null to inheritfrom Sequoia working dir)
Parameters:
  ignoreStdErrOutput - true if output on std error should be ignored,else any output on stderr will be considered as a failure true if command is successful



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.