Request monitoring exits enable Java user exit code to obtain the details of requests as they are processed by CICS Transaction Gateway and Java client applications.
The following flow topology diagrams show when the request monitoring time stamps are generated depending on the CICS Transaction Gateway configuration. In each diagram, points T1, T2, T3, and T4 show where time stamps are collected for each request.
A request monitoring exit is a Java class that implements the com.ibm.ctg.monitoring.RequestExit interface. When the exit is created the default no argument constructor is called. At this point, the exit can create any resources it needs when processing events from the Gateway daemon or Java client application. The eventFired() method is called at each of the exit points; when a systems management command is sent; or when the exit is shutdown. The shutdown event should be used to release any resources obtained during the lifetime of the exit.
When the exit is triggered, the eventFired() method is called and runs on the same thread as the caller. When the eventFired() method returns, the thread continues running as before. Processing performed by the exit on this thread affects performance and must be kept to a minimum. An example exit com.ibm.ctg.samples.requestexit.ThreadedMonitor shows you how to transfer this processing to a separate thread to reduce the impact on performance.
Request monitoring exits running in the Gateway daemon can be controlled through the rmexit option of the the /F <jobname> command.
The enable and disable options allow you to enable or disable all the exits running within the Gateway daemon. When exits are disabled they are not called as part of the Gateway daemon processing.
The the /F <jobname> command allows you to send system management commands to your request monitoring user exits so you can interact with the request monitoring user exits, to perform tasks such as dynamically starting or stopping a particular user exit.
When you issue a system management command with a RequestEvent of Command, the eventFired() method is driven for all request monitoring user exits that are active on the Gateway daemon. The input data is formed of a single entry in the map, with RequestData key "CommandData". The value associated with this key is a string representing the data provided via the system management command.
A simple request monitoring user exit implementation of the RequestExit interface is in the com.ibm.ctg.samples.requestexit.BasicMonitor class. The source code for request monitoring user exits samples is located in /samples/java/com/ibm/ctg/samples/requestexit.