CICS® Transaction Gateway Programming Reference V3.1

com.ibm.ctg.client
Class LocalJavaGateway

com.ibm.ctg.client.LocalJavaGateway

public class LocalJavaGateway

This class allows you to process request locally on a machine. Rather than flowing the request across the network, this class executes them locally using the server-side objects which would have been used to execute the request if it had been received by the Gateway for Java.


Field Summary
 long closeTimeout
          Time given for in-progress work to end when Gateway is closed
 
Method Summary
(package private) static void ()
           
(package private)  void close()
          Closes the logical connection to the local Gateway.
static void destroy()
          When the Gateway for Java is cleanly shutdown, it will run termination routines for all the different type of requests it has seen.
(package private)  int flow(GatewayRequest gatRequest)
          Executes a request locally rather than flowing it across the network to the Gateway for Java.
(package private)  void newExtendedRequest(GatewayRequest gatExtendedRequest)
          Adds a new extended request entry to our hashtable
(package private)  void open()
          Opens a LocalJavaGateway.
(package private)  void removeExtendedRequest(GatewayRequest gatExtendedRequest)
          Removes an existing extended request entry from our hashtable
(package private)  void updateExtendedRequest(GatewayRequest gatExtendedRequest)
          Updates an existing extended request entry in our hashtable
(package private)  void workEnded()
          Decreases our work in progress count
(package private)  void workStarted()
          Increases our work in progress count
 

Field Detail

closeTimeout

public long closeTimeout
Time given for in-progress work to end when Gateway is closed
Method Detail

static void ()

open

void open()
    throws java.io.IOException
Opens a LocalJavaGateway. Checks that local Gateway support has not been terminated. If all OK simply sets up the relevant tables for future use.
Throws:
java.io.IOException - If an error occurs when creating the LocalJavaGateway

flow

int flow(GatewayRequest gatRequest)
   throws java.io.IOException
Executes a request locally rather than flowing it across the network to the Gateway for Java. It executes the request using the server-side objects that the Gateway would have used to execute the request.
Parameters:
gatRequest - GatewayRequest object containing the request
Returns:
Return code from this flow operation
Throws:
java.io.IOException - If a network I/O error occurs during the operation

newExtendedRequest

void newExtendedRequest(GatewayRequest gatExtendedRequest)
Adds a new extended request entry to our hashtable
Parameters:
gatExtendedRequest - Extended GatewayRequest to add to the table

updateExtendedRequest

void updateExtendedRequest(GatewayRequest gatExtendedRequest)
Updates an existing extended request entry in our hashtable
Parameters:
gatExtendedRequest - Extended GatewayRequest to update in table

removeExtendedRequest

void removeExtendedRequest(GatewayRequest gatExtendedRequest)
Removes an existing extended request entry from our hashtable
Parameters:
gatExtendedRequest - Extended GatewayRequest to remove from table

workStarted

void workStarted()
Increases our work in progress count

workEnded

void workEnded()
Decreases our work in progress count

close

void close()
     throws java.io.IOException
Closes the logical connection to the local Gateway. After marking the Gateway closed, the close method waits for a period of time for any progress work to complete. It will then clean up any unfinished extended requests.
Throws:
java.io.IOException - If a network I/O error occurs during the operation

destroy

public static void destroy()
                    throws java.io.IOException
When the Gateway for Java is cleanly shutdown, it will run termination routines for all the different type of requests it has seen. This allows the correct termination in the Gateway of, for example, the CICS EPI prior to the Gateway process ending.

When running using the local Gateway object, it is not possible for the local Gateway code to programatically decide when to run these request termination routines, since it cannot tell when the program using the local Gateway is about to end.

The destroy method is provided to allow a programmer to explictly say that it has finished using the local Gateway support, and WILL NOT use it again in the program. When called the termination routines of all the used request types will be run. Once called it will not be possible to create another local Gateway for the rest of the life-time of the program.


© Copyright IBM Corp. 1994, 1999