CICS® Transaction Gateway Programming Reference V3.1

com.ibm.ctg.client
Class TcpJavaGateway

com.ibm.ctg.client.TcpJavaGateway

public class TcpJavaGateway
implements java.lang.Runnable

This class manages the connection between a program and a CICS Gateway for Java. You will need a TcpJavaGateway object for each Gateway that you wish to talk to. Once a connection has been established, you send GatewayRequest objects (or sub-classes of) to the Gateway via the flow method.

A TcpJavaGateway object has a second thread which is used to listen for in-bound replies from the Gateway.


Method Summary
(package private)  void close()
          Closes the connection to the CICS Gateway for Java.
(package private)  int flow(GatewayRequest gatRequest)
          Flows the specified GatewayRequest to the CICS Gateway for Java and then waits for the reply.
(package private)  void open()
          Opens a TcpJavaGateway, connecting it to the CICS Gateway for Java at the specified IP address and port.
 

Method Detail

open

void open()
    throws java.io.IOException
Opens a TcpJavaGateway, connecting it to the CICS Gateway for Java at the specified IP address and port. Creating a new TcpJavaGateway will cause the creation of a background listener thread associated with that TcpJavaGateway object.
Throws:
java.io.IOException - If an error occurs when creating the TcpJavaGateway

flow

int flow(GatewayRequest gatRequest)
   throws java.io.IOException
Flows the specified GatewayRequest to the CICS Gateway for Java and then waits for the reply. The reply is returned in the original request object.
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

close

void close()
     throws java.io.IOException
Closes the connection to the CICS Gateway for Java. If there were any other threads using this TcpJavaGateway who were in the middle of a flow operation, they will return with a error.
Throws:
java.io.IOException - If a network I/O error occurs during the operation

© Copyright IBM Corp. 1994, 1999