com.ibm.ctg.client

Interface GatewayIntercept



  • public interface GatewayIntercept
    Provides a plug-in interface that allows JavaGateway method calls to be intercepted. A Gateway Intercept Plug-in is a class that, when enabled, is notified before a connection to a Gateway daemon is opened or closed, and before a request is sent to the Gateway daemon. This allows a variety of scenarios to be simulated for application testing without a running CICS Transaction Gateway or CICS server.

    Before a connection is opened, the interceptOpen method is invoked on the plug-in object. The plug-in can change properties of the JavaGateway object, such as the protocol, host name and port number. The plug-in then returns a value indicating whether the connection should be opened or not.

    Before a request is sent over a connection, the interceptFlow method is invoked on the plug-in object, and the plug-in can change properties of the GatewayRequest object. The plug-in then returns a value indicating whether the request should be flowed to the Gateway daemon or returned to the application. If the plug-in modifies the size of the ECIRequest.Commarea byte array, it must also modify the ECIRequest.Commarea_Length field to avoid unpredictable results.

    Before a connection is closed, the interceptClose method is invoked on the plug-in object, and the plug-in returns a value indicating whether the connection should be closed or not.

    • Field Detail

      • CTG_PROP_INTERCEPT_PLUGIN

        static final java.lang.String CTG_PROP_INTERCEPT_PLUGIN
        The Java property that can be used to set the GatewayIntercept plug-in class to use.
        See Also:
        Constant Field Values
    • Method Detail

      • interceptOpen

        GatewayIntercept.InterceptAction interceptOpen(JavaGateway gateway)
                                                       throws java.io.IOException
        Allows the JavaGateway.open() method to be intercepted. Implementations can modify the properties of the JavaGateway before it is opened, and can prevent connection from being opened.

        Implementations must not call open, flow or close on the passed in JavaGateway object.

        Parameters:
        gateway - the JavaGateway object being opened
        Returns:
        Continue to open the connection, or Return to leave the connection closed
        Throws:
        java.io.IOException - if an error occurs
      • interceptFlow

        GatewayIntercept.InterceptAction interceptFlow(JavaGateway gateway,
                                                     GatewayRequest request)
                                                       throws java.io.IOException
        Allows the JavaGateway.flow(GatewayRequest) method to be intercepted. Implementations can modify the properties of the GatewayRequest and can choose to send the request to the Gateway or return the request to the calling application.

        Implementations must not call open, flow or close on the passed in JavaGateway object.

        Parameters:
        gateway - the JavaGateway object on which flow was called
        request - the CICS TG request being flowed
        Returns:
        Continue to flow the request, or Return to return the request to the caller
        Throws:
        java.io.IOException - if an error occurs
      • interceptClose

        GatewayIntercept.InterceptAction interceptClose(JavaGateway gateway)
                                                        throws java.io.IOException
        Allows the JavaGateway.close() method to be intercepted. This method is invoked even if the previous call to interceptOpen returned Return. Implementations can prevent the connection from closing.

        Implementations must not call open, flow or close on the passed in JavaGateway object.

        Parameters:
        gateway - the JavaGateway object being closed
        Returns:
        Continue to close the connection, or Return to leave the connection open
        Throws:
        java.io.IOException - if an error occurs

©Copyright IBM Corp. 1994, 2017


Legal