--- projects/cms/source/conient/uk/org/iscream/cms/conient/DataReader.java 2001/03/15 01:05:46 1.11 +++ projects/cms/source/conient/uk/org/iscream/cms/conient/DataReader.java 2001/03/23 03:58:26 1.12 @@ -11,7 +11,7 @@ import uk.org.iscream.util.*; * it to its Queue for anything that wants it. * * @author $Author: ajm $ - * @version $Id: DataReader.java,v 1.11 2001/03/15 01:05:46 ajm Exp $ + * @version $Id: DataReader.java,v 1.12 2001/03/23 03:58:26 ajm Exp $ */ public class DataReader extends Thread { @@ -20,7 +20,7 @@ public class DataReader extends Thread { /** * The current CVS revision of this class */ - public final String REVISION = "$Revision: 1.11 $"; + public final String REVISION = "$Revision: 1.12 $"; //---STATIC METHODS--- @@ -32,8 +32,10 @@ public class DataReader extends Thread { * * @param inBound the BufferedReader this class should use * @param dataQueue the queue new data should be placed on + * @param ch the connection handler in use */ - public DataReader(BufferedReader inBound, Queue dataQueue) { + public DataReader(BufferedReader inBound, Queue dataQueue, ConnectionHandler ch) { + _ch = ch; _inBound = inBound; _dataQueue = dataQueue; } @@ -45,6 +47,9 @@ public class DataReader extends Thread { * It does this until either there is a problem * or it is told to stop. * + * If there is a problem it calls shutdownLinks in the + * ConnectionHandler. + * * Any data it reads it converts to XML and then * adds to its queue. */ @@ -67,6 +72,8 @@ public class DataReader extends Thread { } catch (IOException e) { Conient.addMessage("WARNING{data reader}: inbound data stopped - "+e); _running = false; + // tell the ConnectionHandler to shut down the links + _ch.shutdownLinks(); } } @@ -87,17 +94,22 @@ public class DataReader extends Thread { /** * The reader we are reading from. */ - BufferedReader _inBound; + private BufferedReader _inBound; /** * The Queue we place data on. */ - Queue _dataQueue; + private Queue _dataQueue; /** * The state of this thread. */ - boolean _running = true; + private boolean _running = true; + + /** + * A reference to the ConnectionHandler in use + */ + private ConnectionHandler _ch; //---STATIC ATTRIBUTES---