netcom.log
Class FileReaderThread

java.lang.Object
  extended byjava.lang.Thread
      extended bynetcom.log.FileReaderThread
All Implemented Interfaces:
java.lang.Runnable

public class FileReaderThread
extends java.lang.Thread

Title: FileReaderThread This is a Thread used by the Logger to process LogSession requests from the GUI It has the ability to go into the file and make a resulting packet of information and LogEntries in the form of a LogMessage Copyright: Copyright (c) 2002 Company NETCOM


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FileReaderThread(LoggerInterface the_interface)
          Constructor method
 
Method Summary
 void addToQueue(LogMessage lm)
          this method is called when the parent thread (Logger) hears that a LogMessage wants the file to be read for info to be sent back in the form of a LogMessage it adds a LogMessage so that to the queue so that it can wait to be processed
 void beginAgain()
          public method called to allow the FileReaderThread to continue processing
 void finalize()
          public method that makes the die_flag of this thread equal to true, and brings the thread out of its infinite loop to terminate it
 LogMessage getReturnMessage()
          returns the LogMessage that has just been made by processing to the Logger class
 void halt()
          public method that evokes the flag in the FileReaderThread to stop processing until all entries waiting to be written to file are processed first.
 void run()
          run method inherent to threads keeps on running till die_flag is activated..
 
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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileReaderThread

public FileReaderThread(LoggerInterface the_interface)
Constructor method

Parameters:
the_interface - takes an interface that implements LoggerInterface so that info about the parent can be accessed
Method Detail

run

public void run()
run method inherent to threads keeps on running till die_flag is activated.. processes read requests appropriately depending on type of request


addToQueue

public void addToQueue(LogMessage lm)
                throws Overflow
this method is called when the parent thread (Logger) hears that a LogMessage wants the file to be read for info to be sent back in the form of a LogMessage it adds a LogMessage so that to the queue so that it can wait to be processed

Parameters:
lm - this is a LogMessage that holds the relevant information to process the GUI's request
Throws:
Overflow

getReturnMessage

public LogMessage getReturnMessage()
returns the LogMessage that has just been made by processing to the Logger class

Returns:
lm LogMessage that has just been made by processing to be sent back to GUI

halt

public void halt()
public method that evokes the flag in the FileReaderThread to stop processing until all entries waiting to be written to file are processed first. after they are processed, it's set back to false again.


beginAgain

public void beginAgain()
public method called to allow the FileReaderThread to continue processing


finalize

public void finalize()
public method that makes the die_flag of this thread equal to true, and brings the thread out of its infinite loop to terminate it