* @author jimp
*
*/
- private static class Worker extends Thread
+ public static class Worker extends Thread
{
private final Process process;
return classpath;
}
- private Worker getJalviewDesktopRunner(boolean withAwt, String cmd,
+ public static Worker getJalviewDesktopRunner(boolean withAwt, String cmd,
int timeout)
{
// Note: JAL-3065 - don't include quotes for lib/* because the arguments are
new InputStreamReader(ls2_proc.getInputStream()));
BufferedReader errorReader = new BufferedReader(
new InputStreamReader(ls2_proc.getErrorStream()));
- worker = new Worker(ls2_proc);
+ worker = new CommandLineOperations.Worker(ls2_proc);
worker.start();
try
{
String ln = null;
while ((ln = worker.getOutputReader().readLine()) != null)
{
- System.out.println(ln);
+ System.out.println("STDOUT: " + ln);
successfulCMDs.add(ln);
}
while ((ln = worker.getErrorReader().readLine()) != null)
{
- System.err.println(ln);
+ System.err.println("STDERR: " + ln);
+ successfulCMDs.add(ln);
}
}
// number of lines expected on STDERR when Jalview starts up normally
// may need to adjust this if Jalview is excessively noisy ?
+ final int STDOUT_SETUPLINES = 50;
final int STDERR_SETUPLINES = 50;
// thread monitors stderr - bails after SETUP_TIMEOUT or when
public void run()
{
String ln = null;
- int count = 0;
+ int stdoutcount = 0;
+ int stderrcount = 0;
try
{
while ((ln = worker.getOutputReader().readLine()) != null)
{
System.out.println(ln);
successfulCMDs.add(ln);
- if (++count > STDERR_SETUPLINES)
+ if (++stdoutcount > STDOUT_SETUPLINES)
+ {
+ break;
+ }
+ }
+ while ((ln = worker.getErrorReader().readLine()) != null)
+ {
+ System.err.println(ln);
+ successfulCMDs.add(ln);
+ if (++stderrcount > STDERR_SETUPLINES)
{
break;
}