Skip Headers
Oracle® Application Server Adapter for IMS/TM User's Guide
10g Release 2 (10.1.2)
B15805-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

3 Integrating OracleAS Adapter for IMS/TM with OC4J

To deploy and integrate OracleAS Adapter for IMS/TM with Oracle Application Server Containers for J2EE (OC4J), you need to configure the J2CA 1.0 IMS/TM adapter.

This chapter includes the following sections:

Integrating OracleAS Adapter for IMS/TM with OC4J

Oracle Application Server provides a complete Java 2 Enterprise Edition (J2EE) environment that executes on the Java virtual computer (JVM) of the standard Java Development Kit (JDK). OC4J is J2EE certified and provides all the J2EE specific containers, APIs, and services. OC4J supports the J2CA 1.0 standard.

J2CA defines standard Java interfaces for simplifying the integration of applications with the EIS. The Oracle adapters are deployed as a resource adapter (RA) within the OC4J container. The contract between the OC4J client application and the resource adapter is defined by the common client interface (CCI). The contract between the OC4J container and the resource adapter is defined by the service provider interface (SPI). The SPI API addresses the connection management, transaction management and the security management. Connection management enables application components to connect to an EIS and leverage any connection pooling provided by the application server. Transaction management enables an application server to use a transaction manager to manage transactions across multiple resource managers. Security management provides authentication, authorization, and secure communication between the J2EE server and the EIS.

Configuring the J2CA 1.0 IMS/TM Adapter

To connect to the J2CA 1.0 IMS/TM adapter, perform the following steps:

  1. Edit the oc4j-ra-xml file, which is located at the following path:

    root\j2ee\home\application-deployment\default\attunity\oc4j-ra-xml

    Where root is the Oracle Application Server root directory.

  2. Set the following settings for each connection:

    <oc4j-connector-factories>
      <connector-factory location=" " connector-name="Oracle Legacy Adapter">
        <config-property name="userName" value=" "/>
        <config-property name="password" value=" "/>
        <config-property name="eisName" value=" "/>
        <config-property name="serverName" value=" "/>
        <config-property name="workspace" value=" "/>
        <config-property name="portNumber" value=" "/>
        <config-property name="persistentConnection" value=" "/>
        <config-property name="keepAlive" value=" "/>
        <config-property name="firewallProtocol" value=""/>
        <config-property name="connectTimeout" value=""/>
        <config-property name="encryptionProtocol" value=""/>
        <config-property name="encryptionKeyName" value=""/>
        <config-property name="encryptionKeyValue" value=""/>
      </connector-factory>
    </oc4j-connector-factories>
    
    

    The following table lists the properties that must be specified:

    Property Description
    location Specifies the JNDI location where Oracle Application Server should bind the connection factory instance for application components.
    eisName Sets the name of the adapter to use. The adapter is defined in the Oracle Connect server using Oracle Studio, as described in "Setting Up an Oracle Connect Adapter".
    serverName Sets the TCP/IP address or host name where the Oracle Connect daemon is running. The daemon runs on the computer specified at the beginning of "Setting Up the IBM OS/390 or z/OS Platform in Oracle Studio".

    See Also: Appendix C, "Advanced Tuning of the Daemon" for details about the daemon

    workspace Specifies the name of an Oracle Connect server workspace to use. The default workspace is Navigator.

    See Also: "Workspaces" for details about workspaces

    portNumber Specifies the TCP/IP port where the Oracle Connect daemon is running on the server. The default port is 2552.
    userName

    (optional)

    Specifies a user who can access the Oracle Connect server. The user is defined in the Oracle Connect daemon configuration.

    See Also: "Daemon Security" and "WS Security" for details about users allowed to access an Oracle Connect server

    password

    (optional)

    Specifies a valid password for the user..
    persistentConnection

    (optional)

    Set to true or false. When set to true, connections can persist across multiple requests or connection context changes. It is recommended to set this property to true.
    keepAlive

    (optional)

    Set to true or false. When set to true, the socket used for the connection is always kept open. It is recommended to set this property to true.
    firewallProtocol

    (optional)

    Specifies the firewall protocol used: either none or fixedNat (the Nat protocol using a fixed address for the daemon). The default is none.
    connectTimeout

    (optional)

    Specifies the connection timeout in seconds. The default is 0, meaning that there is no connection timeout.
    encryptionProtocol

    (optional)

    Specifies the name of encryption protocol to use. The default is null. The RC4 protocol is supported.
    encryptionKeyName

    (optional)

    Specifies the name of the symmetric encryption key to use.
    encryptionKeyValue

    (optional)

    Specifies the value of the symmetric encryption key to use.

Using the CCI API to Develop Applications

You can develop applications to run adapter interactions using the Common Client Interface (CCI) API.

Perform the following steps to use the CCI API with the J2CA 1.0 IMS/TM adapter:

  1. Select a ConnectionFactory for the J2CA 1.0 IMS/TM adapter.

  2. Create a Connection object using this ConnectionFactory. A Connection is a handle to the underlying network connection to the EIS, which is identified in the oc4j-ra-xml file by the serverName property.

  3. Create a Connection object using this ConnectionFactory. Specify the interaction properties using an AttuInteractionSpec object. The AttuInteractionSpec object has the following format:

    AttuInteractionSpec(java.lang.String name, int verb, int timeOut)
    
    

    The following table describes the properties that can be specified:

    Property Description
    name Specifies the interaction name to be executed.
    verb Specifies the mode for the interaction: SYNC_SEND, SYNC_SEND_RECEIVE, or SYNC_RECEIVE.
    timeOut Specifies the time (in milliseconds) to wait for an EIS to run the specified interaction.

    The following is an InteractionSpec sample:

    AttuInteractionSpec iSpeq = new AttuInteractionSpec("query", javax.resource.cci.InteractionSpec.SYNC_RECEIVE, 60); javax.resource.cci.RecordFactory rf = new AttuRecordFactory(con, mcf.getLogger());
    javax.resource.cci.MappedRecord queryRecord = rf.createMappedRecord("query"), queryRecord.put("##text", "select * from disam:nation"); javax.resource.cci.Record oRec = interaction.execute(iSpec, queryRecord);
    
  4. Invoke the execute method on the interaction to initiate a call to the EIS. Pass any data for the interaction as input and output records.

  5. After the interactions have been processed, close the Interaction and Connection objects.

Configuring Multiple Adapters

Each J2CA 1.0 IMS/TM adapter requires an entry in the oc4j-ra-xml file as described in "Configuring the J2CA 1.0 IMS/TM Adapter".

Updating Configuration Information

You can change configuration settings for a resource adapter by editing the relevant connector-factory entry in the oc4j-ra-xml file. For these changes to take effect, you need to stop and restart Oracle Application Server.