(ZOS) Use optimized local adapters for inbound support
Use this task when we are implementing the optimized local adapters support for calling inbound to WebSphere Application Server for z/OS EJB applications.
Use optimized local adapters to make inbound calls from an external address space to EJB applications deployed on a local WAS for z/OS server, and make outbound calls from an application running under WAS for z/OS to a server program running in an external address space. The following steps describe the process required to call an EJB application that is deployed on a local WAS for z/OS server using the optimized local adapters APIs.
The following illustration shows the flow when using optimized local adapters with Customer Information Control System (CICS ).The following illustration shows the flow when using optimized local adapters with Customer Information Control System (CICS).
The next illustration is the flow when using optimized local adapters with Information Management System (IMS™).
Tasks
- Enable the server environment. In this step, activate support for the optimized local adapters with the WebSphere environment variables in the WAS daemon group or cell. This prepares the WAS to receive inbound requests.
- Develop an EJB application. We can develop an EJB application or prepare an existing application. If we are calling to or from a Cobol or C/C++ program, we might want to use the IBM Rational Application Developer assembly tools, such as Rational Application Developer, to create a Java class with getter and setter helper methods that correspond to the Cobol copybook or C/C++ structure, and create an EJB application to start with the optimized local adapter native APIs.
For more information about using the assembly tools to convert a Cobol copybook or C structure into a Java data binding helper class, see the assembly tool information center.
The assembly tools are shipped with the WAS for z/OS and contain the JAR file containing the package, com.ibm.websphere.ola, that we must identify your enterprise bean as a potential target of an optimized local adapter call. This package contains the ExecuteHome and Execute classes that hold the abstract interfaces needed to call the adapter. We must create a stateless session bean that implements a method called execute() which accepts a byte array as input and returns a byte array as output and specifies the name com.ibm.websphere.ola.ExecuteHome for the EJB home interface and com.ibm.websphere.ola.Execute for the remote interface. The enterprise bean to start from an external address space, must include a method called execute that accepts a byte array as input and returns a byte array as output. This is the method that we receive control in when an external address space uses one of the adapter API calls such as Invoke or Send Request. The execute method is defined on the remote interface, com.ibm.websphere.ola.Execute and contains the business logic for the application.
Your EJB implementation must not modify or augment the home and remote interfaces in any way. Application exceptions are not supported on the execute method of the remote interface. If the application must throw an exception, it must throw an EJBException, which can optionally wrap the original exception encountered.
- Deploy the EJB application. After we have developed the EJB application, we must package it in an enterprise archive (EAR) file and deploy it on to WAS. This EJB application uses the home and remote interfaces provided in the com.ibm.websphere.ola package. Enterprise beans developed this way are assigned a JNDI home name and are deployed like any other EJB component. To learn more about installing the application, read the topic, Installing enterprise application files.
- (Optional) Use the CICS environment. Complete this step only if we are connecting to and using Customer Information Control System (CICS). If we are using CICS, use this step to activate the adapters in the CICS region to make outbound calls to EJB applications that we have deployed on the local WAS. The outbound calls are made with the optimized local adapters native APIs. If we are not using CICS, skip to the next step.
Verify the product is using a SAF-based user registry if we plan to propagate a SAF user ID from WAS for z/OS to CICS.
- (Optional) Use the IMS environment. Complete this step if we are connecting to and using IMS applications.
- Register an external address space. For the optimized local adapter to make an inbound call to the local daemon group or WAS cell, we must bind the current address space to the WAS group and establish connection attributes.
- Secure optimized local adapters for inbound support.
- Make inbound calls. Depending on what we want to achieve and what systems we are working with, choose the method we want to use to make calls with the native APIs.
- Use the optimized local adapter native APIs to call a stateless session bean and connect from an external address space to WAS. In this method, we start an EJB application from an external native language program using the primitive APIs and retrieve the response. This method is designed for applications that want more flexibility and where the response area maximum length is not known before the call.
- Use the optimized local adapter Invoke API to call a stateless session bean and connect from an external address space to WAS. In this method, we start an EJB application with the Invoke API from an external native language program and retrieve a response. This method is designed for exploiters that want a simplified path where the response area length is known before the call.
- Use the optimized local adapter to call an EJB application from WAS from an external address space in a client-initiated transaction. In this method, you begin a transaction in a client environment, and call an EJB application running on WAS. The new transaction is propagated to the WAS. This method is only supported when calling from a transaction-enable environment, like CICS.
- Use the optimized local adapter to call an EJB application from WAS while ignoring the transaction context. In this method, you begin a transaction in a client environment, and call an EJB application that is deployed on WAS, and ignore the transaction context. This method is only supported when calling from a transaction-enable environment, like CICS.
- (Optional) Monitor optimized local adapters.
We have implemented the optimized local adapters support to make inbound calls to EJB applications deployed on WAS
Related:
Optimized local adapters on WAS for z/OS Development and assembly tools Optimized local adapters for z/OS APIs Optimized local adapters for z/OS usage scenarios Install a resource adapter archive Enable the server environment to use optimized local adapters Enable optimized local adapters support in CICS Enable optimized local adapters support in IMS Registering an external address space with a local daemon group or cell using optimized local adapters Use the optimized local adapters native APIs to invoke an EJB application from an external address space Use the Invoke API to call an enterprise bean from an external address space Calling an enterprise bean from an external address space within a client-initiated transaction Calling an enterprise bean from an external address space while ignoring the client transaction context Use optimized local adapters to connect to an application in an external address space from a WebSphere application Use the outbound APIs with the external address space or subsystem Install enterprise application files Secure optimized local adapters for inbound support Modify command WAS transactions BBOC, BBO$, BBO#