uk.org.iscream.cms.conient
Class DataReader

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--uk.org.iscream.cms.conient.DataReader
All Implemented Interfaces:
Runnable

public class DataReader
extends Thread

The class reads in data from a BufferedReader, it then converts it to an XMLPacket and adds it to its Queue for anything that wants it.

Version:
$Id: DataReader.java,v 1.17 2003/02/05 19:35:04 tdb Exp $
Author:
$Author: tdb $

Field Summary
private  ConnectionHandler _ch
          A reference to the ConnectionHandler in use
private  Queue _dataQueue
          The Queue we place data on.
private  BufferedReader _inBound
          The reader we are reading from.
private  boolean _running
          The state of this thread.
 String REVISION
          The current CVS revision of this class
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DataReader(BufferedReader inBound, Queue dataQueue, ConnectionHandler ch)
          Constructs a new data reader, giving it its BufferedReader and Queue.
 
Method Summary
 void run()
          This thread reads data from the BufferedReader.
 void shutdown()
          This method allows other classes to shutdown this data reader.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

_inBound

private BufferedReader _inBound
The reader we are reading from.


_dataQueue

private Queue _dataQueue
The Queue we place data on.


_running

private boolean _running
The state of this thread.


_ch

private ConnectionHandler _ch
A reference to the ConnectionHandler in use

Constructor Detail

DataReader

public DataReader(BufferedReader inBound,
                  Queue dataQueue,
                  ConnectionHandler ch)
Constructs a new data reader, giving it its BufferedReader and Queue.

Parameters:
inBound - the BufferedReader this class should use
dataQueue - the queue new data should be placed on
ch - the connection handler in use
Method Detail

run

public void run()
This thread reads data from the BufferedReader. 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.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

shutdown

public void shutdown()
This method allows other classes to shutdown this data reader.



Copyright © 2000-2003 i-scream. All Rights Reserved.