- Timestamp:
- 2014-10-10T16:59:53+13:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/util/GS3ServerThread.java
r29356 r29361 78 78 79 79 if (p != null) { 80 int result = p.waitFor(); 81 if(result != 0) { 80 // in order for the process.waitFor() method to work with Java 6 (JRE 6 is included in GS binaries) 81 // need to make sure the IOstreams of the process are not blocked. For Java 7, this is not necessary 82 // and a waitFor() is sufficient. But with Java 6, the waitFor() causes the server to finally start 83 // after the user has quit GLI. 84 85 // Process takes no input, but we will still catch this iostream too 86 // And we'll catch the error and output streams to prevent them from blocking during waitFor() 87 // (For normal input and output stream handling using the Gobblers, see FormatConversionDialog.java) 88 OutputStreamGobbler inputGobbler = new OutputStreamGobbler(p.getOutputStream(), null); 89 InputStreamGobbler errorGobbler = new InputStreamGobbler(p.getErrorStream(), true); 90 InputStreamGobbler outputGobbler = new InputStreamGobbler(p.getInputStream()); 91 92 errorGobbler.start(); 93 outputGobbler.start(); 94 inputGobbler.start(); 95 96 // the important part: wait for the process (ant stop or start or re-start to terminate) 97 int result = p.waitFor(); 98 if(result != 0) { 82 99 System.err.println("**** Failed to successfully " + _ant_command + " the GS3 server."); 83 } 100 } 101 102 outputGobbler.join(); 103 errorGobbler.join(); 104 inputGobbler.join(); 84 105 } else { 85 106 System.err.println("**** Could not start the Process to " + _ant_command + " the GS3 server.");
Note:
See TracChangeset
for help on using the changeset viewer.