cmsc433.p1
Class LogGatherPoll

java.lang.Object
  extended by java.lang.Thread
      extended by cmsc433.p1.LogGatherPoll
All Implemented Interfaces:
java.lang.Runnable

public class LogGatherPoll
extends java.lang.Thread

Polls a log in a separate thread, periodically printing recent log data.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LogGatherPoll(Log log, long delayMS, long windowMS)
          Extends the Thread class.
 
Method Summary
 void run()
          This method loops forever; every delayMS (passed to the constructor) it will wake up, get all of the records from the last delayMS (also passed to the constructor) and print them out.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogGatherPoll

public LogGatherPoll(Log log,
                     long delayMS,
                     long windowMS)
Extends the Thread class. When run, will print the last windowMS milliseconds worth of log data in log every delayMS milliseconds.

Parameters:
log - The log whose records should be printed.
delayMS - The amount of time to wait between printings.
windowMS - Print the last windowMS milliseconds of log data.
Method Detail

run

public void run()
This method loops forever; every delayMS (passed to the constructor) it will wake up, get all of the records from the last delayMS (also passed to the constructor) and print them out.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread