com.cometway.util
Class TimeStampedReporter

java.lang.Object
  extended by com.cometway.util.TimeStampedReporter
All Implemented Interfaces:
ReporterInterface

public class TimeStampedReporter
extends java.lang.Object
implements ReporterInterface

Prints all output with the time and date each report happened. Each ReporterInterface method call is output using System.out.println or System.err.println exactly once. Calls to println and debug are output to System.out. Calls to warning and error are output to System.err. This is important when running the AK as a NT Service, which sends each call to System.out.print as an event viewable using the Event Viewer administration utility.


Field Summary
protected static java.lang.String DEBUG_AFTER
           
protected static java.lang.String DEBUG_BEFORE
           
protected static java.lang.String ERROR_AFTER
           
protected static java.lang.String ERROR_BEFORE
           
protected static java.lang.String PRINTLN_AFTER
           
protected static java.lang.String PRINTLN_BEFORE
           
protected static java.text.SimpleDateFormat SDF
           
protected  byte[] synchObject
           
protected static java.lang.String WARNING_AFTER
           
protected static java.lang.String WARNING_BEFORE
           
 
Constructor Summary
TimeStampedReporter()
           
 
Method Summary
 void debug(java.lang.Object objectRef, java.lang.String message)
          Use this method to report an event for debugging.
 void error(java.lang.Object objectRef, java.lang.String message)
          Use this method to report a critical error message.
 void error(java.lang.Object objectRef, java.lang.String message, java.lang.Exception e)
          Use this method to report a critical error with an Exception.
 void println(java.lang.Object objectRef, java.lang.String message)
          Use this method to report an event message.
 void warning(java.lang.Object objectRef, java.lang.String message)
          Use this method to report a warning message.
 void warning(java.lang.Object objectRef, java.lang.String message, java.lang.Exception e)
          Use this method to report a warning message with an Exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SDF

protected static final java.text.SimpleDateFormat SDF

DEBUG_BEFORE

protected static final java.lang.String DEBUG_BEFORE
See Also:
Constant Field Values

DEBUG_AFTER

protected static final java.lang.String DEBUG_AFTER
See Also:
Constant Field Values

ERROR_BEFORE

protected static final java.lang.String ERROR_BEFORE
See Also:
Constant Field Values

ERROR_AFTER

protected static final java.lang.String ERROR_AFTER
See Also:
Constant Field Values

PRINTLN_BEFORE

protected static final java.lang.String PRINTLN_BEFORE
See Also:
Constant Field Values

PRINTLN_AFTER

protected static final java.lang.String PRINTLN_AFTER
See Also:
Constant Field Values

WARNING_BEFORE

protected static final java.lang.String WARNING_BEFORE
See Also:
Constant Field Values

WARNING_AFTER

protected static final java.lang.String WARNING_AFTER
See Also:
Constant Field Values

synchObject

protected final byte[] synchObject
Constructor Detail

TimeStampedReporter

public TimeStampedReporter()
Method Detail

debug

public void debug(java.lang.Object objectRef,
                  java.lang.String message)
Use this method to report an event for debugging.

Specified by:
debug in interface ReporterInterface

warning

public void warning(java.lang.Object objectRef,
                    java.lang.String message)
Use this method to report a warning message.

Specified by:
warning in interface ReporterInterface

warning

public void warning(java.lang.Object objectRef,
                    java.lang.String message,
                    java.lang.Exception e)
Use this method to report a warning message with an Exception.

Specified by:
warning in interface ReporterInterface

error

public void error(java.lang.Object objectRef,
                  java.lang.String message)
Use this method to report a critical error message.

Specified by:
error in interface ReporterInterface

error

public void error(java.lang.Object objectRef,
                  java.lang.String message,
                  java.lang.Exception e)
Use this method to report a critical error with an Exception.

Specified by:
error in interface ReporterInterface

println

public void println(java.lang.Object objectRef,
                    java.lang.String message)
Use this method to report an event message.

Specified by:
println in interface ReporterInterface