Websphere MQ Everyplace

com.ibm.mqe.trace
Class MQeTraceSplitter

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

public class MQeTraceSplitter
extends java.lang.Object
implements MQeTraceHandler

A trace handler which can plug into the MQeTrace mechanism, and deliver output to multiple trace handlers.

Use the addHandler() and removeHandler() methods to plug other trace handlers into the trace mechanism.


Constructor Summary
MQeTraceSplitter()
          Construct a trace handler splitter.
 
Method Summary
 void addHandler(MQeTraceHandler newHandler)
          Add a trace handler to the list of trace handlers output is being sent to.
 void removeHandler(MQeTraceHandler handlerToRemove)
          Remove the specified trace handler from the list of trace handlers output is being sent to.
 void setFilter(long filterMask)
          Part of the trace handler interface.
 void traceMessage(java.lang.Object selfReference, short messageNumber, long groups)
          Part of the trace handler interface.
 void traceMessage(java.lang.Object selfReference, short messageNumber, long groups, java.lang.Object insert1)
          Part of the trace handler interface.
 void traceMessage(java.lang.Object selfReference, short messageNumber, long groups, java.lang.Object insert1, java.lang.Object insert2)
          Part of the trace handler interface.
 void traceMessage(java.lang.Object selfReference, short messageNumber, long groups, java.lang.Object insert1, java.lang.Object insert2, java.lang.Object insert3)
          Part of the trace handler interface.
 void traceMessage(java.lang.Object selfReference, short messageNumber, long groups, java.lang.Object insert1, java.lang.Object insert2, java.lang.Object insert3, java.lang.Object insert4)
          Part of the trace handler interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MQeTraceSplitter

public MQeTraceSplitter()
Construct a trace handler splitter. The list of trace handlers trace output is sent to is empty to start with.

Method Detail

traceMessage

public void traceMessage(java.lang.Object selfReference,
                         short messageNumber,
                         long groups)
Part of the trace handler interface. This stimulus is passed on to each trace handler in our list.

Specified by:
traceMessage in interface MQeTraceHandler
Parameters:
selfReference - A reference to the object which is issuing the trace. Will be null if the trace point is not associated with this trace point, for example, when the trace is generated from within a static method. If non-null, the class name, and hash code of the object can be obtained to provide extra information to accompany the other trace information.
messageNumber - The trace message number is a unique, single point in source code. Can be mapped to other information relating to this point in the code using the MQeTracePoint, MQeTracePointGroup and MQeTraceRenderer classes.
groups - A bitmasked field comprised of one or more MQeTrace.GROUP_* constants bit-ORed together. This information can be used to dynamically filter out these course groupings in a simple way, without having to load the MQeTraceRenderer and associated classes.
Returns:
void

traceMessage

public void traceMessage(java.lang.Object selfReference,
                         short messageNumber,
                         long groups,
                         java.lang.Object insert1)
Part of the trace handler interface. This stimulus is passed on to each trace handler in our list.

Specified by:
traceMessage in interface MQeTraceHandler
Parameters:
selfReference - A reference to the object which is issuing the trace. Will be null if the trace point is not associated with this trace point, for example, when the trace is generated from within a static method. If non-null, the class name, and hash code of the object can be obtained to provide extra information to accompany the other trace information.
messageNumber - The trace message number is a unique, single point in source code. Can be mapped to other information relating to this point in the code using the MQeTracePoint, MQeTracePointGroup and MQeTraceRenderer classes.
groups - A bitmasked field comprised of one or more MQeTrace.GROUP_* constants bit-ORed together. This information can be used to dynamically filter out these course groupings in a simple way, without having to load the MQeTraceRenderer and associated classes.
insert1 - A substitution parameter to be substituted for in the trace template so that a readable text string can be built.

Trace handlers will typically use the toString() method on the object passed, though may choose not to use the information at all if the particular trace information carried by this method is not required.

If it derived from java.lang.Throwable then the trace handler may wish to trace a stack trace together with the accompanying error message text.


traceMessage

public void traceMessage(java.lang.Object selfReference,
                         short messageNumber,
                         long groups,
                         java.lang.Object insert1,
                         java.lang.Object insert2)
Part of the trace handler interface. This stimulus is passed on to each trace handler in our list.

Specified by:
traceMessage in interface MQeTraceHandler
Parameters:
selfReference - A reference to the object which is issuing the trace. Will be null if the trace point is not associated with this trace point, for example, when the trace is generated from within a static method. If non-null, the class name, and hash code of the object can be obtained to provide extra information to accompany the other trace information.
messageNumber - The trace message number is a unique, single point in source code. Can be mapped to other information relating to this point in the code using the MQeTracePoint, MQeTracePointGroup and MQeTraceRenderer classes.
groups - A bitmasked field comprised of one or more MQeTrace.GROUP_* constants bit-ORed together. This information can be used to dynamically filter out these course groupings in a simple way, without having to load the MQeTraceRenderer and associated classes.
insert1 - A substitution parameter to be substituted for in the trace template so that a readable text string can be built.

Trace handlers will typically use the toString() method on the object passed, though may choose not to use the information at all if the particular trace information carried by this method is not required.

insert2 - As insert1

If it derived from java.lang.Throwable then the trace handler may wish to trace a stack trace together with the accompanying error message text.


traceMessage

public void traceMessage(java.lang.Object selfReference,
                         short messageNumber,
                         long groups,
                         java.lang.Object insert1,
                         java.lang.Object insert2,
                         java.lang.Object insert3)
Part of the trace handler interface. This stimulus is passed on to each trace handler in our list.

Specified by:
traceMessage in interface MQeTraceHandler
Parameters:
selfReference - A reference to the object which is issuing the trace. Will be null if the trace point is not associated with this trace point, for example, when the trace is generated from within a static method. If non-null, the class name, and hash code of the object can be obtained to provide extra information to accompany the other trace information.
messageNumber - The trace message number unique a single point in source code. Can be mapped to other information relating to this point in the code using the MQeTracePoint, MQeTracePointGroup and MQeTraceRenderer classes.
groups - A bitmasked field comprised of one or more MQeTrace.GROUP_* constants bit-ORed together. This information can be used to dynamically filter out these course groupings in a simple way, without having to load the MQeTraceRenderer and associated classes.
insert1 - A substitution parameter to be substituted for in the trace template so that a readable text string can be built.

Trace handlers will typically use the toString() method on the object passed, though may choose not to use the information at all if the particular trace information carried by this method is not required.

insert2 - As insert1
insert3 - As insert1

If it derived from java.lang.Throwable then the trace handler may wish to trace a stack trace together with the accompanying error message text.


traceMessage

public void traceMessage(java.lang.Object selfReference,
                         short messageNumber,
                         long groups,
                         java.lang.Object insert1,
                         java.lang.Object insert2,
                         java.lang.Object insert3,
                         java.lang.Object insert4)
Part of the trace handler interface. This stimulus is passed on to each trace handler in our list.

Specified by:
traceMessage in interface MQeTraceHandler
Parameters:
selfReference - A reference to the object which is issuing the trace. Will be null if the trace point is not associated with this trace point, for example, when the trace is generated from within a static method. If non-null, the class name, and hash code of the object can be obtained to provide extra information to accompany the other trace information.
messageNumber - The trace message number unique a single point in source code. Can be mapped to other information relating to this point in the code using the MQeTracePoint, MQeTracePointGroup and MQeTraceRenderer classes.
groups - A bitmasked field comprised of one or more MQeTrace.GROUP_* constants bit-ORed together. This information can be used to dynamically filter out these course groupings in a simple way, without having to load the MQeTraceRenderer and associated classes.
insert1 - A substitution parameter to be substituted for in the trace template so that a readable text string can be built.

Trace handlers will typically use the toString() method on the object passed, though may choose not to use the information at all if the particular trace information carried by this method is not required.

insert2 - As insert1
insert3 - As insert1
insert4 - As insert1

If it derived from java.lang.Throwable then the trace handler may wish to trace a stack trace together with the accompanying error message text.


setFilter

public void setFilter(long filterMask)
Part of the trace handler interface. This stimulus is passed on to each trace handler in our list.

Specified by:
setFilter in interface MQeTraceHandler
Parameters:
filterMask - A bitmask indicating which subsets, or groups of trace point classifications should be captured, and which groups are discarded.

If the filterMask is changed from a zero value to a non-zero value, partial or full tracing has been turned on.

If the filterMask is changed from a non-zero value to a zero value, partial or full tracing has been turned off.

Exact meaning of the filtermask is explained in the documentation for the MQeTrace class.


addHandler

public void addHandler(MQeTraceHandler newHandler)
Add a trace handler to the list of trace handlers output is being sent to.

Parameters:
newHandler - The trace handler reference to add to our list, to which trace calls are delegated. Null values are ignored.

removeHandler

public void removeHandler(MQeTraceHandler handlerToRemove)
Remove the specified trace handler from the list of trace handlers output is being sent to.

Parameters:
handlerToRemove - To remove from the list to which stimuli are sent. Null value is ignored.

Websphere MQ Everyplace