From: <fu...@us...> - 2008-01-30 16:55:13
|
Revision: 608 http://cishell.svn.sourceforge.net/cishell/?rev=608&view=rev Author: fugu13 Date: 2008-01-30 08:54:01 -0800 (Wed, 30 Jan 2008) Log Message: ----------- This is the potential fix via spinning off a separate thread for each logStream method. Modified Paths: -------------- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java =================================================================== --- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2008-01-28 22:54:39 UTC (rev 607) +++ trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2008-01-30 16:54:01 UTC (rev 608) @@ -172,10 +172,22 @@ File dir = new File(baseDir); String[] beforeFiles = dir.list(); - Process process = Runtime.getRuntime().exec(cmdarray, null, new File(baseDir)); - - logStream(LogService.LOG_INFO, process.getInputStream()); - logStream(LogService.LOG_ERROR, process.getErrorStream()); + final Process process = Runtime.getRuntime().exec(cmdarray, null, new File(baseDir)); + + process.getOutputStream().close(); + + new Thread(new Runnable() { + public void run() { + logStream(LogService.LOG_INFO, process.getInputStream()); + } + }).start(); + + new Thread(new Runnable() { + public void run() { + logStream(LogService.LOG_INFO, process.getErrorStream()); + } + }).start(); + process.waitFor(); //successfully ran? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |