Websphere MQ Everyplace

examples.trace
Class MQeTrace

java.lang.Object
  |
  +--examples.trace.MQeTrace
All Implemented Interfaces:
MQeTraceHandler
Direct Known Subclasses:
MQeTraceToFile

public class MQeTrace
extends java.lang.Object
implements MQeTraceHandler

A dummy trace handler example.

All messages are logged to the basic trace handler provided by the basic trace handler supplied with the WMQe toolkit. Namely the MQeTraceToReadable class.

This example doesn't really do any logic itself except straight pass-through to the product trace handler. It is here mainly because it was here in previous releases of WMQe. If solutions rely on this code being present, and this class being included in their .ini files or solutions, then it still exists.

This trace handler could be used as a basis to provide a trace handler which does more complex filtering on the trace messages, perhaps excluding or including trace messages in certain ranges, or trace groups.

Users of this class must activate the class before the trace handler is plugged-in to handle trace input. If the object is not activated, then it will not pass any trace output onwards.

See Also:
com.ibm.mqe.trace

Field Summary
protected  MQeTraceHandler baseHandler
           
protected  long filter
           
protected  java.lang.String title
           
static short[] version
           
 
Constructor Summary
MQeTrace()
           
MQeTrace(java.lang.String title)
           
 
Method Summary
 void activate(java.lang.String title)
          Common activation code
 void close()
          Close and un-hook the Trace from MQe
 boolean display(long groups)
          decide if the template is viewable or not
 void setFilter(long newFilter)
          Called when the groups filter is changed from above.
 void traceMessage(java.lang.Object selfReference, short messageNumber, long groups)
          Trace a message
 void traceMessage(java.lang.Object selfReference, short messageNumber, long groups, java.lang.Object insert1)
          Trace a message
 void traceMessage(java.lang.Object selfReference, short messageNumber, long groups, java.lang.Object insert1, java.lang.Object insert2)
          Trace a message
 void traceMessage(java.lang.Object selfReference, short messageNumber, long groups, java.lang.Object insert1, java.lang.Object insert2, java.lang.Object insert3)
          Trace a message
 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)
          Trace a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static short[] version

title

protected java.lang.String title

filter

protected long filter

baseHandler

protected MQeTraceHandler baseHandler
Constructor Detail

MQeTrace

public MQeTrace()

MQeTrace

public MQeTrace(java.lang.String title)
Method Detail

setFilter

public void setFilter(long newFilter)
Description copied from interface: MQeTraceHandler
Called when the groups filter is changed from above.

This method is called when the trace filter is changed.

Specified by:
setFilter in interface MQeTraceHandler
Parameters:
newFilter - 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.


activate

public void activate(java.lang.String title)
Common activation code


close

public void close()
Close and un-hook the Trace from MQe


display

public boolean display(long groups)
decide if the template is viewable or not


traceMessage

public void traceMessage(java.lang.Object selfReference,
                         short messageNumber,
                         long groups)
Trace a message

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)
Trace a message

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)
Trace a message

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)
Trace a message

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)
Trace a message.

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.


Websphere MQ Everyplace