[z/OS]

Using optimized local adapters to connect to an application in an external address space from a WebSphere application

Use this task when you want to use the outbound APIs to connect to an application in an external address space from an application that is deployed on WebSphere® Application Server for z/OS®.

Before you begin

The daemon group, address space, and external address space must be set up to use the optimized local adapters APIs. The external address space must be registered in the daemon group by calling the BBOA1REG API.

The application that is running in the external address space must have established itself as an optimized local adapters server task using one of the APIs, including BBOA1SRV, BBOA1RCA or BBOA1RCS.

The optimized local adapters resource adapter archive (RAR) file, ola.rar, is deployed and configured using the WebSphere Application Server administrative console or the olaRar.py script.

Procedure

  1. Locate the application deployment descriptor in the application that makes the external call.
    This is the application that is deployed on WebSphere Application Server for which you want to make an outbound call from.
  2. Create a resource reference that points to the optimized local adapter connection factory.
    The optimized local adapter connection factory is created when the ola.rar file is installed on WebSphere Application Server.
  3. Locate the connection factory for the optimized local adapter.
    You can find the connection factory by looking up the resource reference in the Java™ Naming Directory Interface (JNDI), for example:
    Context ctx = new InitialContext();
    ConnectionFactory cf = ctx.lookup("java:comp/env/ola");
  4. Create a ConnectionSpecImpl method call and provide the register name to connect to.
    You can either use the Register name as an attribute on the managed connection factory or use the ConnectionSpecImpl method, setRegisterName, to provide the registration name for the application that is running in the external address space or subsystem that you want to connect to. This must be the same registration name that was provided by the application in the external address space or subsystem using one of the server optimized local adapters APIs, BBOA1SRV, BBOA1RCA, or BBOA1RCS. For example,
    ConnectionSpecImpl csi = new ConnectionSpecImpl();
    csi.setRegisterName ("MyRES1");
    Attention: Setting the register name on the ConnectionSpecImpl object is not necessary if the register name was specified using the RegisterName custom property on the ConnectionFactory object.
    Attention: If you want to use the resource adapter high availability feature, you must ensure that your application does not use the setRegisterName method and instead you must configure the target Register name in the managed connection's connection factory attributes. Refer to the topic, Enabling resource adapter high availability support, for more information on how to configure high availability.
  5. Optional: If you are calling an Information Management System (IMS) transaction that does not use the optimized local adapter server APIs, BBOA1SRV, BBOA1RCA, or BBOA1RCS, use this step to set the IMS Open Transaction Manager Access (OTMA) parameters.
    You can either set the IMS OTMA server name, XCF group ID and transaction level as attributes on the managed connection factory, or use the corresponding ConnectionSpecImpl setter methods, setOTMAServerName, setOTMAGroupID, and setOTMATranLevel, to provide this information for the application that is running in the external address space or subsystem that you want to connect to.
    Attention: When you use optimized local adapters over OTMA, the registration name does not have a counterpart on the IMS transaction side. The registration name can be set, but it is not used for optimized local adapter calls over OTMA. For more information, see the topic Calling existing IMS transactions with optimized local adapters over OTMA.
  6. Use the connection factory to create a connection, for example:
    Connection con = cf.getConnection(csi);

Results

Your application that is deployed on WebSphere Application Server is connected to an external address space and ready to call the services that are hosted on the external address space.