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.11 by ajm, Thu Mar 15 01:05:46 2001 UTC vs.
Revision 1.15 by tdb, Sat May 18 18:15:56 2002 UTC

# Line 1 | Line 1
1 + /*
2 + * i-scream central monitoring system
3 + * Copyright (C) 2000-2002 i-scream
4 + *
5 + * This program is free software; you can redistribute it and/or
6 + * modify it under the terms of the GNU General Public License
7 + * as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * This program is distributed in the hope that it will be useful,
11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 + * GNU General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU General Public License
16 + * along with this program; if not, write to the Free Software
17 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 + */
19 +
20   //---PACKAGE DECLARATION---
21 < package uk.org.iscream.conient;
21 > package uk.org.iscream.cms.conient;
22  
23   //---IMPORTS---
24   import java.io.*;
25 < import uk.org.iscream.util.*;
25 > import uk.org.iscream.cms.server.util.*;
26  
27   /**
28   * The class reads in data from a BufferedReader,
# Line 32 | Line 51 | public class DataReader extends Thread {
51       *
52       * @param inBound the BufferedReader this class should use
53       * @param dataQueue the queue new data should be placed on
54 +     * @param ch the connection handler in use
55       */
56 <    public DataReader(BufferedReader inBound, Queue dataQueue) {
56 >    public DataReader(BufferedReader inBound, Queue dataQueue, ConnectionHandler ch) {
57 >        _ch = ch;
58          _inBound = inBound;
59          _dataQueue = dataQueue;
60      }
# Line 45 | Line 66 | public class DataReader extends Thread {
66       * It does this until either there is a problem
67       * or it is told to stop.
68       *
69 +     * If there is a problem it calls shutdownLinks in the
70 +     * ConnectionHandler.
71 +     *
72       * Any data it reads it converts to XML and then
73       * adds to its queue.
74       */
# Line 67 | Line 91 | public class DataReader extends Thread {
91          } catch (IOException e) {
92              Conient.addMessage("WARNING{data reader}: inbound data stopped - "+e);
93              _running = false;
94 +            // tell the ConnectionHandler to shut down the links
95 +            _ch.shutdownDataLink();
96          }
97      }
98  
# Line 87 | Line 113 | public class DataReader extends Thread {
113      /**
114       * The reader we are reading from.
115       */
116 <    BufferedReader _inBound;
116 >    private BufferedReader _inBound;
117      
118      /**
119       * The Queue we place data on.
120       */
121 <    Queue _dataQueue;
121 >    private Queue _dataQueue;
122      
123      /**
124       * The state of this thread.
125       */
126 <    boolean _running = true;
126 >    private boolean _running = true;
127 >    
128 >    /**
129 >     * A reference to the ConnectionHandler in use
130 >     */
131 >    private ConnectionHandler _ch;
132      
133   //---STATIC ATTRIBUTES---
134  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines