CICS® Transaction Gateway Programming Reference v1.1.0.0

com.ibm.ctg.monitoring
Interface RequestExit


public interface RequestExit

All implementations of CICS Transaction Gateway RequestExit monitoring classes must implement the RequestExit interface.

Request level monitoring allows a 3rd party application to be called at significant points in the request flow through the Gateway daemon and Java client classes.

A RequestExit object is defined by a class that implements the RequestExit interface. A single RequestExit object is created for each configured request level monitor. Each object receives eventFired() method calls at the start of the request (E1) and at the end of the reply (E2) for each flow. These are shown by E1 and E2 on the diagrams. Timestamps will be taken during the flow at T1, T2, T3 and T4 on the diagrams.

The data provided by the eventFired method is read-only.

This figure shows a 
 request flow through the Gateway daemon.  The FlowTopology is shown 
 as Gateway. Two halves of the path are shown from the Java client 
 through the Gateway daemon to CICS and back. The Java client, 
 Gateway daemon and CICS are shown as distinct. The path arrives in 
 the Protocol Handler of the Gateway daemon from the Java client. A 
 timestamp T1 is taken and the RequestEvent E1 is called.  The path 
 then continues to the Transport Driver, where another timestamp T2 
 is taken before it passes on to CICS. The path then returns from 
 CICS to the Transport Driver, where a third timestamp T3 is taken.  
 The path then continues back to the Protocol Handler where the last 
 timestamp T4 is taken and the RequestEvent E2 is called. The path 
 finishes back in the Java client.

This figure shows a 
 request flow through the Java client in local mode.  The 
 FlowTopology is shown as LocalClient. Two halves of the path are 
 shown from the Java application through the Java client to CICS and 
 back. The Java application, Java client and CICS are shown as 
 distinct. The path arrives in the Java client from the Java 
 application. A timestamp T1 is taken and the RequestEvent E1 is 
 called.  The path then continues to the Transport Driver, where 
 another timestamp T2 is taken before it passes on to CICS. The path 
 then returns from CICS to the Transport Driver, where a third 
 timestamp T3 is taken.  The path then continues back until leaving 
 the Java client where the last timestamp T4 is taken and the 
 RequestEvent E2 is called. The path finishes back in the Java 
 application.

This figure shows a 
 request flow through the Java client in remote mode.  The 
 FlowTopology is shown as RemoteClient. Two halves of the path are 
 shown from the Java application through the Java client to the 
 Gateway daemon and back. The Java application, Java client and 
 Gateway daemon are shown as distinct. The path arrives in the Java 
 client from the Java application. A timestamp T1 is taken and the 
 RequestEvent E1 is called.  The path then continues to the Transport 
 Driver, where another timestamp T2 is taken before it passes on to 
 the Gateway daemon. The path then returns from the Gateway daemon to 
 the Transport Driver, where a third timestamp T3 is taken.  The path 
 then continues back until leaving the Java client where the last 
 timestamp T4 is taken and the RequestEvent E2 is called. The path 
 finishes back in the Java application.

The RequestExit object will exist for the lifetime of the Gateway daemon or Java client, or until it throws an exception or run-time error. The eventFired method is called on the same thread as the request. All processing performed by the exit will impact the performance of the Gateway or Java client and should be kept to a minimum. An example exit (com.ibm.ctg.samples.requestexit.ThreadedMonitor.java) is provided to show how to off-load this processing to a separate thread.

Example implementations of the RequestExit interface can be found in the com.ibm.ctg.samples.requestexit.BasicMonitor and com.ibm.ctg.samples.requestexit.ThreadedMonitor class. The source for these can be found in \samples\java\com\ibm\ctg\samples\requestexit


Method Summary
 void eventFired(RequestEvent event, java.util.Map<RequestData,java.lang.Object> data)
          This method will be called for each defined MonitorEvent.
 

Method Detail

eventFired

void eventFired(RequestEvent event,
                java.util.Map<RequestData,java.lang.Object> data)
This method will be called for each defined MonitorEvent. Exits can selectively process these using the event parameter. In each call the data will contain a read-only Map of the data available at that point for this flow. Any processing in this method should be kept to a minimum to reduce the impact on the flows.

Parameters:
event - at which the exit is called
data - read-only Map of monitoring data

©Copyright IBM Corp. 1994, 2014
Legal