net.codesmarts.log4j
Class BugReportController

java.lang.Object
  extended bynet.codesmarts.log4j.BugReportController
All Implemented Interfaces:
java.lang.Runnable

public class BugReportController
extends java.lang.Object
implements java.lang.Runnable

Controller singleton that coordinates bugreport appenders and bug reports

Author:
Fred McCann

Constructor Summary
protected BugReportController()
          Constructor
 
Method Summary
 void addEvent(java.lang.Thread thread, BugReportAppender appender, org.apache.log4j.spi.LoggingEvent event)
          Log an event by a specific appender for a specific thread
 int getBugCount(BugReport report)
          Return the number of times this bug has been seen
static BugReportController getInstance()
          Get a reference to the BugReportController
 boolean isNewBugReport(BugReport report)
          Returns true if this is a new bug report
 void registerLog(java.lang.Thread thread, BugReportAppender appender)
          Register a thread and an appender with the controller.
 void run()
          Main Loop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BugReportController

protected BugReportController()
Constructor

Method Detail

getInstance

public static BugReportController getInstance()
Get a reference to the BugReportController


registerLog

public void registerLog(java.lang.Thread thread,
                        BugReportAppender appender)
Register a thread and an appender with the controller. The thread will be watched by the controller.

Parameters:
thread - Thread to watch
appender - Appender writing logs for this thread

addEvent

public void addEvent(java.lang.Thread thread,
                     BugReportAppender appender,
                     org.apache.log4j.spi.LoggingEvent event)
Log an event by a specific appender for a specific thread

Parameters:
thread - the watched thread
appender - Appender writing logs
event - the event to track

isNewBugReport

public boolean isNewBugReport(BugReport report)
Returns true if this is a new bug report

Parameters:
report -
Returns:

getBugCount

public int getBugCount(BugReport report)
Return the number of times this bug has been seen

Parameters:
report -
Returns:

run

public void run()
Main Loop

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()


Copyright © 2005 CodeSmarts. All Rights Reserved.