ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/conient/uk/org/iscream/cms/conient/DataReader.java
(Generate patch)

Comparing projects/cms/source/conient/uk/org/iscream/cms/conient/DataReader.java (file contents):
Revision 1.4 by ajm, Mon Jan 15 03:15:06 2001 UTC vs.
Revision 1.5 by ajm, Sat Jan 20 16:06:53 2001 UTC

# Line 2 | Line 2
2  
3   //---IMPORTS---
4   import java.io.*;
5 + import uk.ac.ukc.iscream.util.*;
6  
7   /**
8   * Reads in bound data and presents it as it comes
# Line 23 | Line 24 | public class DataReader extends Thread {
24  
25   //---CONSTRUCTORS---
26  
27 <    public DataReader(BufferedReader inBound) {
27 >    public DataReader(BufferedReader inBound, Queue dataQueue) {
28          _inBound = inBound;
29 +        _dataQueue = dataQueue;
30      }
31  
32   //---PUBLIC METHODS---
# Line 33 | Line 35 | public class DataReader extends Thread {
35          boolean running = true;
36          try {
37              while (true) {
38 <                _xml = _inBound.readLine();
39 <                synchronized (this) {
38 <                    notifyAll();
39 <                }
40 <            }
38 >                _dataQueue.add(_inBound.readLine());
39 >                            }
40          } catch (IOException e) {
41                  System.err.println("This DataReader thread has been shut down as an exception occured: "+e);
42                  running = false;
# Line 49 | Line 48 | public class DataReader extends Thread {
48  
49   //---ACCESSOR/MUTATOR METHODS---
50  
52    public String getXML() {
53        return _xml;
54    }
55
51   //---ATTRIBUTES---
52  
53      BufferedReader _inBound;
54 <    String _xml;
54 >    Queue _dataQueue;
55  
56   //---STATIC ATTRIBUTES---
57  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines