public interface GatewayIntercept
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.
Modifier and Type | Interface and Description |
---|---|
static class |
GatewayIntercept.InterceptAction
Indicates whether a
JavaGateway method call should continue as normal
or be intercepted. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CTG_PROP_INTERCEPT_PLUGIN
The Java property that can be used to set the
GatewayIntercept
plug-in class to use. |
Modifier and Type | Method and Description |
---|---|
GatewayIntercept.InterceptAction |
interceptClose(JavaGateway gateway)
Allows the
JavaGateway.close() method to be intercepted. |
GatewayIntercept.InterceptAction |
interceptFlow(JavaGateway gateway,
GatewayRequest request)
Allows the
JavaGateway.flow(GatewayRequest) method to be intercepted. |
GatewayIntercept.InterceptAction |
interceptOpen(JavaGateway gateway)
Allows the
JavaGateway.open() method to be intercepted. |
static final java.lang.String CTG_PROP_INTERCEPT_PLUGIN
GatewayIntercept
plug-in class to use.GatewayIntercept.InterceptAction interceptOpen(JavaGateway gateway) throws java.io.IOException
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.
GatewayIntercept.InterceptAction interceptFlow(JavaGateway gateway, GatewayRequest request) throws java.io.IOException
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.
GatewayIntercept.InterceptAction interceptClose(JavaGateway gateway) throws java.io.IOException
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.