Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3)
B14428-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
 

Configuring an EJB 2.1 MDB to Use a J2CA Message Service Provider

You can configure an EJB 3.0 MDB to use a J2CA message service provider using deployment XML (see "Using Deployment XML").

For more information, see "J2EE Connector Architecture (J2CA) Adapter Message Provider".

Using Deployment XML

You must use both ejb-jar.xml and orion-ejb.jar.xml file. You use the orion-ejb-jar.xml file configuration to override settings in ejb-jar.xml and to add the OC4J-specific setting for resource adapter. For example, the connection factory and destination name that you define in ejb-jar.xml may be logical names that may not exist in your local JNDI environment. The deployer can override these settings in the orion-ejb-jar.xml file and map them to the actual names. For more information on mapping logical names, see "Configuring an Environment Reference to a JMS Destination or Connection Resource Manager Connection Factory".

To configure an EJB 3.0 MDB to use a J2CA message service provider:

  1. Configure the ejb-jar.xml file.

    Example 18-2 shows how to configure ejb-jar.xml to configure a message-driven bean to use the Oracle JMS resource adapter named OracleASjms. It assumes that you have defined connection factory OracleASjms/MyQCF in the oc4j-ra.xml file and destination name OracleASjms/MyQueue in the oc4j-connectors.xml. For more information on configuring a J2CA message service provider, see "Configuring a Message Service Provider Using J2CA". To complete this configuration, you must

    Example 18-2 ejb-jar.xml for a J2CA Message Service Provider

    <message-driven>
        <ejb-name>JCA_QueueMDB</ejb-name>
        <ejb-class>test.JCA_MDB</ejb-class>
        <messaging-type>javax.jms.MessageListener</messaging-type>
        <transaction-type>Container</transaction-type>
    
        <activation-config>
            <activation-config-property>
                <activation-config-property-name>
                    DestinationType
                </activation-config-property-name>
                <activation-config-property-value>
                    javax.jms.Queue
                </activation-config-property-value>
            </activation-config-property>
            <activation-config-property>
                <activation-config-property-name>
                    DestinationName
                </activation-config-property-name>
                <activation-config-property-value>
                    OracleASjms/MyQueue
                </activation-config-property-value>
            </activation-config-property>
            <activation-config-property>
                <activation-config-property-name>
                    ConnectionFactoryJndiName
                </activation-config-property-name>
                <activation-config-property-value>
                    OracleASjms/MyQCF
                </activation-config-property-value>
            </activation-config-property>
        </activation-config>
    </message-driven>
    
    
  2. Configure the orion-ejb-jar.xml file.

    Example 18-3 shows how to configure the orion-ejb-jar.xml to configure this message-driven bean to use the Oracle JMS resource adapter named OracleASjms. You must set the resource-adapter attribute. Optionally, you can override or configure additional activation configuration properties using one or more config-property elements.

    Example 18-3 orion-ejb-jar.xml for a J2CA Message Service Provider

    <message-driven-deployment
        name="JCA_QueueMDB"
        resource-adapter="OracleASjms">
        ...
        <config-property>
            <config-property-name>DestinationName</config-property-name>
            <config-property-value>OracleASJMSRASubcontext/MyQ</config-property-value>
        </config-property>
        ...
    </message-driven-deployment>
    
    

For a complete list of all activation configuration properties, download and unzip one of the how-to-gjra-with-xxx.zip files from http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/index.html, where xxx is the name of the relevant resource provider. The orion-ejb-jar.xml demo file contains comments describing all activation configuration properties. For more information, see "JMS Resource Adapter" in the Oracle Containers for J2EE Services Guide.

You may also set the optional attributes that Table A-4 lists.

The actual names you use depend on your message service provider installation. For more information, see "J2CA Message Service Provider Connection Factory Names".