cmsc433.p1
Class LogGatherProgress

java.lang.Object
  extended by java.lang.Thread
      extended by cmsc433.p1.LogGatherProgress
All Implemented Interfaces:
Listener<LogRecord>, java.lang.Runnable

public class LogGatherProgress
extends java.lang.Thread
implements Listener<LogRecord>

Marks progress by waiting for a designated event e to be generated by each of a number of logs.


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
LogGatherProgress(java.util.List<Log> logs, java.lang.String event)
          Marks progress by printing a designated event once each time that event has been emitted by the given logs.
 
Method Summary
 void notify(java.lang.Object target, LogRecord event)
          This function is called whenever an event occurs that is associated with one of the objects with which this Listener is registered.
 
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, run, 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

LogGatherProgress

public LogGatherProgress(java.util.List<Log> logs,
                         java.lang.String event)
Marks progress by printing a designated event once each time that event has been emitted by the given logs. The only guarantee provided by this class is that, if the event is printed, then every log this object being listened to has emitted the event. It makes no guarantees about whether the event has been emitted at most once by some log.

Parameters:
logs - The list of logs that this LogGatherProgress object should watch.
event - The event that marks progress.
Method Detail

notify

public void notify(java.lang.Object target,
                   LogRecord event)
Description copied from interface: Listener
This function is called whenever an event occurs that is associated with one of the objects with which this Listener is registered.

Specified by:
notify in interface Listener<LogRecord>
Parameters:
target - The object that generated the event. For our logging framework, this is the Log object to which the LogRecord was added.
event - The event that occurred. For our logging framework, this will be a LogRecord.