com.cometway.io
Class OutputStreamReporter

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

public class OutputStreamReporter
extends java.lang.Object
implements ReporterInterface

This uses an OutputStream for directing reporting information. Output may be lost if the OutputStream throws an IOException.


Field Summary
protected  byte[] endOfLine
           
protected  java.io.OutputStream err
           
protected  java.io.OutputStream out
           
protected  byte[] synchObject
           
 
Constructor Summary
OutputStreamReporter(java.io.OutputStream out)
          Constructor for combined println, debug, warning, and error output to one OutputStream.
OutputStreamReporter(java.io.OutputStream out, java.io.OutputStream err)
          Constructor for sending println, debug reporting to one OutputStream, and warning and error output to another OutputStream.
OutputStreamReporter(java.io.OutputStream out, java.io.OutputStream err, java.lang.String lineSeparator)
          Constructor for sending println, debug reporting to one OutputStream, and warning and error output to another OutputStream.
 
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

synchObject

protected final byte[] synchObject

out

protected java.io.OutputStream out

err

protected java.io.OutputStream err

endOfLine

protected byte[] endOfLine
Constructor Detail

OutputStreamReporter

public OutputStreamReporter(java.io.OutputStream out)
Constructor for combined println, debug, warning, and error output to one OutputStream.

Parameters:
out - The OutputStream to be used for all reporting output.

OutputStreamReporter

public OutputStreamReporter(java.io.OutputStream out,
                            java.io.OutputStream err)
Constructor for sending println, debug reporting to one OutputStream, and warning and error output to another OutputStream.

Parameters:
out - The OutputStream to be used for println and debug output.
err - The OutputStream to be used for warning and error output.

OutputStreamReporter

public OutputStreamReporter(java.io.OutputStream out,
                            java.io.OutputStream err,
                            java.lang.String lineSeparator)
Constructor for sending println, debug reporting to one OutputStream, and warning and error output to another OutputStream. An alternate line separator byte sequence can be specified (System.getProperty("line.separator") is used by default for other constructors).

Parameters:
out - The OutputStream to be used for println and debug output.
err - The OutputStream to be used for warning and error output.
lineSeparator - Contains the sequence of bytes to be sent when the end of a line has been reached.
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