/** * Spawn the application * @throws IOException IO problems */ public void start() throws IOException { spawnChildProcess(); processStreamReader = new ProcessStreamReader(processLog, STREAM_READER_SLEEP_TIME); logExecutor.submit(processStreamReader); processExecutor.submit(this); }
while (!finished.get()) { boolean processed = false; if (readAnyLine(errReader, errorLine, LINE_LENGTH)) { recordRecentLine(errorLine.toString(), true, streamLog); errorLine.setLength(0); processed = true; if (readAnyLine(outReader, outLine, LINE_LENGTH)) { recordRecentLine(outLine.toString(), false, streamLog); outLine.setLength(0); recordFinalOutput(errReader, errorLine, true, streamLog); recordFinalOutput(outReader, outLine, false, streamLog);
while (!finished.get()) { boolean processed = false; if (readAnyLine(errReader, errorLine, LINE_LENGTH)) { recordRecentLine(errorLine.toString(), true, streamLog); errorLine.setLength(0); processed = true; if (readAnyLine(outReader, outLine, LINE_LENGTH)) { recordRecentLine(outLine.toString(), false, streamLog); outLine.setLength(0); recordFinalOutput(errReader, errorLine, true, streamLog); recordFinalOutput(outReader, outLine, false, streamLog);
throws IOException { int next; while ((-1 != (next = readCharNonBlocking(reader)))) { if (next != '\n') { line.append((char) next);
throws IOException { int next; while ((-1 != (next = readCharNonBlocking(reader)))) { if (next != '\n') { line.append((char) next);
/** * Spawn the application * @throws IOException IO problems */ public void start() throws IOException { spawnChildProcess(); processStreamReader = new ProcessStreamReader(processLog, STREAM_READER_SLEEP_TIME); logExecutor.submit(processStreamReader); processExecutor.submit(this); }