The com.ibm.mq.ipt.exit.IPTTrace class in MQIPT
The MQIPT trace functions provide entry and exit calls,that can be used on entry to and exit from a method. There are also various data calls to trace useful information.
Methods
- public void entry(String fid)
Where fid is used to identify where the call was made, for example the class and method name.
This method writes an entry to the trace output file with the appropriate level of indentation to record the point at which the flow of control enters a method. This call is optional, but if it is used, a matching call to "exit(String)" must also be used within the same method.
- public void exit(String fid)
Where fid is used to identify where the call was made, for example the class and method name.
This method writes an exit to the trace output file with the appropriate level of indentation to record the point at which the flow of control leaves a method. This method is used only when a call to "entry(String)" has previously been used within the same method.
- public void exit(String fid, int rc)
Where fid is used to identify where the call was made, for example the class and method name, and rc is the numeric return code from the method. This trace method should be used to record the exit from methods that return an integer.
This method writes an exit to the trace output file with the appropriate level of indentation to record the point at which the flow of control leaves a method and the numeric return code from that method. This method is used only when a call to "entry(String)" has previously been used within the same method.
- public void exit(String fid, boolean rc)
Where fid is used to identify where the call was made, for example the class and method name, and rc is the Boolean return code from the method. This trace method should be used to record the exit from methods that return a Boolean.
This method writes an exit to the trace output file with the appropriate level of indentation to record the point at which the flow of control leaves a method and the Boolean return code from that method. This method is used only when a call to "entry(String)" has previously been used within the same method.
- public void data(String fid, String data)
Where fid is used to identify where the call was made, for example the class and method name.
This method writes some string data to the trace output file.
- public void data(String fid, int data)
Where fid is used to identify where the call was made, for example the class and method name.
This method writes some integer data to the trace output file.
- public void data(String fid, byte[])
Where fid is used to identify where the call was made, for example the class and method name.
This method writes some binary data to the trace output file.
Sample trace
/**
* This method is called to initialize the exit (for example, for
* loading validation information) and place itself in a ready
* state to validate connection requests.
*/
public int init(IPTTrace t) {
final String fid = "MyExit.init";
// Trace entry into this method
t.entry(fid);
// Trace useful information
t.data(fid, "Starting exit - MQIPT version " + getVersion());
// Perform initialization and load any data
t.data(fid, "Ready for work");
// Trace exit from this method
t.exit(fid);
return ExitRc.OK;
}
16:36:48.625 14 5000-1s ------{ ConnectionThread.setCertificateExit()
16:36:48.625 14 5000-1s Creating instance of certificate exit
16:36:48.625 14 5000-1s Calling init() of certificate exit
16:36:48.625 14 5000-1s -------{ MyExit.init()
16:36:48.625 14 5000-1s Starting exit - MQIPT version 2.1.0.0
16:36:48.625 14 5000-1s Ready for work
16:36:48.625 14 5000-1s -------} MyExit.init() rc=0
16:36:48.625 14 5000-1s ------} ConnectionThread.setCertificateExit() rc=0