com.cometway.io
Class PrintStreamReporter

java.lang.Object
  extended by com.cometway.io.PrintStreamReporter
All Implemented Interfaces:
ReporterInterface

public class PrintStreamReporter
extends java.lang.Object
implements ReporterInterface

This implementation of ReporterInterface streams output using separate PrintStreams for println and debug messages, and warning and debug messages. These streams are set to System.out and and System.err when using the default constructor. Calls to a Reporter instance methods are synchronized. The warning and error methods output stack trace information (if available).


Field Summary
protected static java.lang.String DEBUG_AFTER
           
protected static java.lang.String DEBUG_BEFORE
           
protected  java.io.PrintStream err
           
protected static java.lang.String ERROR_AFTER
           
protected static java.lang.String ERROR_BEFORE
           
protected  java.io.PrintStream out
           
protected static java.lang.String PRINTLN_AFTER
           
protected static java.lang.String PRINTLN_BEFORE
           
protected  java.lang.Object synchObject
           
protected static java.lang.String WARNING_AFTER
           
protected static java.lang.String WARNING_BEFORE
           
 
Constructor Summary
PrintStreamReporter()
           
 
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 with an Exception.
 void error(java.lang.Object objectRef, java.lang.String message, java.lang.Exception e)
          Use this method to report a critical error message.
 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

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 java.lang.Object synchObject

out

protected java.io.PrintStream out

err

protected java.io.PrintStream err
Constructor Detail

PrintStreamReporter

public PrintStreamReporter()
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 with an Exception.

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 message.

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