Websphere MQ Everyplace

com.ibm.mqe.trace
Class MQeTraceToReadable

java.lang.Object
  |
  +--com.ibm.mqe.trace.MQeTraceToReadable
All Implemented Interfaces:
MQeTraceHandler

public class MQeTraceToReadable
extends java.lang.Object
implements MQeTraceHandler

A trace handler which outputs readable trace to a specified output stream.

An instance of this class can be used to collect trace from the mechanism provided by the MQeTrace class.

Use the MQeTrace.setHandler(com.ibm.mqe.MQeTraceHandler) method to cause trace information to flow into an instance of this class, and from there into a java.io.PrintStream object.

See Also:
MQeTrace, MQeTrace.setHandler(com.ibm.mqe.MQeTraceHandler)

Constructor Summary
MQeTraceToReadable()
          Creates a trace handler which outputs readable information to System.out, using a default trace renderer object.
MQeTraceToReadable(java.io.PrintStream outStream, MQeTraceRenderer renderer)
          Creates a trace handler which will output readable information to the specified output stream.
 
Method Summary
 void setOutputStream(java.io.PrintStream newStream)
          Sets up the print stream to which readable trace information will be written.
 void setRenderer(MQeTraceRenderer renderer)
          Sets, or re-sets the trace renderer to be used to map from a trace message number to a set of associated properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.mqe.MQeTraceHandler
setFilter, traceMessage, traceMessage, traceMessage, traceMessage, traceMessage
 

Constructor Detail

MQeTraceToReadable

public MQeTraceToReadable(java.io.PrintStream outStream,
                          MQeTraceRenderer renderer)
Creates a trace handler which will output readable information to the specified output stream.

Use the setOutputStream(java.io.PrintStream) method to change the output stream specified by this constructor.

Parameters:
outStream - The open output stream to which readable trace output should be directed. This might be a file for example, or System.out. Specify null here if you want to suppress output for now.
renderer - An MQeTraceRenderer object, capable of mapping from a trace point number to a set of associated data. Specifying null here will cause a cut-down, less meaningful output to be generated.

MQeTraceToReadable

public MQeTraceToReadable()
Creates a trace handler which outputs readable information to System.out, using a default trace renderer object.

Output from this trace handler is deposited on the System.out stream.

A new instance of the MQeTraceRenderer class is created and used to map from trace point numbers, to decoded strings.

Method Detail

setRenderer

public void setRenderer(MQeTraceRenderer renderer)
Sets, or re-sets the trace renderer to be used to map from a trace message number to a set of associated properties.

Parameters:
renderer - The new renderer to use. Null will cause a cut-down, less meaningful output to be generated.
Returns:
void

setOutputStream

public void setOutputStream(java.io.PrintStream newStream)
Sets up the print stream to which readable trace information will be written.

Parameters:
newStream - The new output stream to which output will be directed. A null value will suppress any trace output until an output stream is set.
Returns:
void

Websphere MQ Everyplace