01: package org.enhydra.kelp.common.dods;
02:
03: import java.io.BufferedReader;
04: import java.io.PrintStream;
05: import org.enhydra.kelp.common.AbstractEchoBuilder;
06:
07: /**
08: * This thread used for read error messages from executing process
09: */
10: public class ErrorReader extends Thread {
11: BufferedReader er;
12: AbstractEchoBuilder aeg;
13:
14: public ErrorReader(BufferedReader bufferedreader,
15: AbstractEchoBuilder aEcho) {
16: aeg = aEcho;
17: er = bufferedreader;
18: }
19:
20: public void run() {
21: try {
22: for (; !er.ready(); Thread.sleep(100L)) {
23: }
24: String s;
25: while ((s = er.readLine()) != null) {
26: aeg.echo(s + "\n");
27: }
28: } catch (Exception exception) {
29: }
30: }
31: }
|