cmsc433.p1
Class LogGatherListen

java.lang.Object
  extended by cmsc433.p1.LogGatherListen
All Implemented Interfaces:
Listener<LogRecord>

public class LogGatherListen
extends java.lang.Object
implements Listener<LogRecord>

Class that prints log contents using the Listener interface. Registering this object as a listener with some log (either via the LogGatherListen(Log) constructor or by explicitly passing this to Log.register) will cause every event added to the log to be printed on standard out.


Constructor Summary
LogGatherListen()
          Construct a LogGatherListen object that is not initially registered as a listener with any log.
LogGatherListen(Log l)
          Construct a LogGatherListen object that is initially registered as a listener with l.
 
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.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogGatherListen

public LogGatherListen()
Construct a LogGatherListen object that is not initially registered as a listener with any log.


LogGatherListen

public LogGatherListen(Log l)
Construct a LogGatherListen object that is initially registered as a listener with l.

Parameters:
l - The log to listen to.
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.