netcom.log
Class FileWriterThread

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

public class FileWriterThread
extends java.lang.Thread

Title: FileReaderThread This is the thread started by the logger thread to handle all the LogEntries requested by the parent node to write to file. The data recorded will later be used for statistics that will be put into a LogMessage and sent back to the GUI. Copyright: Copyright (c) 2002 Company NETCOM


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FileWriterThread()
          Constructor initializes variables...
 
Method Summary
 void addToQueue(LogEntry le)
          this method is called when the parent thread (Logger) hears that a LogEntry has to be made it then makes a temporary LogEntry holding the what will be needed to complete the LogEntry and adds that to the queue of this Object to be processed
 void finalize()
          public method that makes the die_flag of this thread equal to true, and brings the thread out of its infinite loop
 int getCurrentSession()
          accessor for private variable that keeps track of current session
 void run()
          run method required for threads....
 
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

FileWriterThread

public FileWriterThread()
Constructor initializes variables...

Method Detail

getCurrentSession

public int getCurrentSession()
accessor for private variable that keeps track of current session

Returns:
int returns current session being recorded to the log file

run

public void run()
run method required for threads.... basically has 2 parts.. in part 1 it reads through existing file to see what the current log session will be in part 2, it waits for the queue to tell it that there are log requests waiting, and if so, to process them by writing to file


addToQueue

public void addToQueue(LogEntry le)
                throws Overflow
this method is called when the parent thread (Logger) hears that a LogEntry has to be made it then makes a temporary LogEntry holding the what will be needed to complete the LogEntry and adds that to the queue of this Object to be processed

Parameters:
le - this is a LogENtry that holds the integer type and String Comment that will be recorded to file
Throws:
Overflow

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