01: /*
02:
03: Loader - tool for transfering data from one JDBC source to another and
04: doing transformations during copy.
05:
06: Copyright (C) 2002 Together
07:
08: This library is free software; you can redistribute it and/or
09: modify it under the terms of the GNU Lesser General Public
10: License as published by the Free Software Foundation; either
11: version 2.1 of the License, or (at your option) any later version.
12:
13: This library is distributed in the hope that it will be useful,
14: but WITHOUT ANY WARRANTY; without even the implied warranty of
15: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: Lesser General Public License for more details.
17:
18: You should have received a copy of the GNU Lesser General Public
19: License along with this library; if not, write to the Free Software
20: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21: */
22:
23: package org.webdocwf.util.loader.task;
24:
25: import java.io.BufferedReader;
26: import java.io.PrintStream;
27: import org.apache.tools.ant.BuildException;
28: import java.io.IOException;
29:
30: /**
31: * Support class for reading error messages from main process (Loader)
32: *
33: */
34:
35: public class ErrorReader extends Thread {
36:
37: BufferedReader er;
38:
39: public ErrorReader(BufferedReader bufferedreader) {
40: er = bufferedreader;
41: //System.out.println("Making ER");
42: }
43:
44: public void run() {
45: try {
46: for (; !er.ready(); Thread.sleep(100L)) {
47: }
48: String s;
49: while ((s = er.readLine()) != null) {
50: System.out.println(s);
51: }
52: } catch (Exception exception) {
53:
54: }
55: }
56: }
|