Example 9 ejb-jar.xml file
The following code extract shows a deployment descriptor ejb-jar.xml
for a JAR file that describes three OLTP message-driven beans. The OLTP message-driven beans implement three different message listener interfaces.
<ejb-jar id="ejb-jar_ID" metadata-complete="false" version="3.1" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"> <description xml:lang="en">Code Samples for Inbound Communication</description> <display-name xml:lang="en">SampleMessageDrivenBeans</display-name> <enterprise-beans> <message-driven> <description xml:lang="en"> Code Sample for Dialog Inbound Communication </description> <ejb-name>SampleDialogOltpMdbBean</ejb-name> <ejb-class>net.fsc.jca.beanconnect.oltpmdb.SampleDialogOltpMdbBean </ejb-class> <messaging-type>net.fsc.jca.communication.OltpMessageListener </messaging-type> <transaction-type>Container</transaction-type> <activation-config> <activation-config-property> <activation-config-property-name>messageEndpoint </activation-config-property-name> <activation-config-property-value>SampleDialogOltpMdb </activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>encodingActive </activation-config-property-name> <activation-config-property-value>true </activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>encoding </activation-config-property-name> <activation-config-property-value>OSD_EBCDIC_DF04_15 (1) </activation-config-property-value> </activation-config-property> </activation-config> </message-driven> <message-driven> <description xml:lang="en"> Code Sample for Asynchronous Inbound Communication </description> <ejb-name>SampleAsynOltpMdbBean</ejb-name> <ejb-class>net.fsc.jca.beanconnect.oltpmdb.SampleAsynOltpMdbBean </ejb-class> <messaging-type>net.fsc.jca.communication.AsyncOltpMessageListener </messaging-type> <transaction-type>Container</transaction-type> <activation-config> <activation-config-property> <activation-config-property-name>messageEndpoint </activation-config-property-name> <activation-config-property-value>SampleAsynOltpMdb </activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>encodingActive </activation-config-property-name> <activation-config-property-value>true </activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>encoding </activation-config-property-name> <activation-config-property-value>OSD_EBCDIC_DF04_15 (1) </activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>redeliveryThreshold </activation-config-property-name> <activation-config-property-value>1</activation-config-property-value </activation-config-property> </activation-config> </message-driven> <message-driven> <description xml:lang="en"> Code Sample for CCI Inbound Communication</description> <ejb-name>SampleCciOltpMdbBean</ejb-name> <ejb-class>net.fsc.jca.beanconnect.oltpmdb.SampleCciOltpMdbBean </ejb-class> <messaging-type>javax.resource.cci.MessageListener</messaging-type> <transaction-type>Bean</transaction-type> <activation-config> <activation-config-property> <activation-config-property-name>messageEndpoint </activation-config-property-name> <activation-config-property-value>SampleCciOltpMdbBean </activation-config-property-value> </activation-config-property> </activation-config> </message-driven> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>SampleDialogOltpMdbBean</ejb-name> <method-name>onMessage</method-name> <method-params> <method-param>net.fsc.jca.communication.OltpMessage</method-param> </method-params> </method> <trans-attribute>Required</trans-attribute> </container-transaction> <container-transaction> <method> <ejb-name>SampleAsynOltpMdbBean</ejb-name> <method-name>onMessage</method-name> <method-params> <method-param>net.fsc.jca.communication.OltpMessage</method-param> </method-params> </method> <trans-attribute>Required</trans-attribute> </container-transaction> <container-transaction> <method> <ejb-name>SampleCciOltpMdbBean</ejb-name> <method-name>onMessage</method-name> <method-params> <method-param>net.fsc.jca.communication.OltpMessage</method-param> </method-params> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar>
(1) For CICS partners: <activation-config-property-value>jdk:Cp1047
Example 10 weblogic-ejb-jar.xml file
The first code extract presents the section of the application server-specific deployment descriptor weblogic-ra.xml
for the resource adapter. The name of the resource adapter is defined in this section. The following application server-specific deployment descriptor weblogic-ejb-jar.xml
then refers to this name:
<?xml version="1.0" encoding="UTF-8" ?> <weblogic-connector xmlns="http://xmlns.oracle.com/weblogic/weblogic-connector" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-connector http://www.oracle.com/technology/weblogic/weblogic-connector/1.3/weblogic-connector.xsd"> <jndi-name>BeanConnect</jndi-name>
Next comes the code extract from the application server-specific deployment descriptor weblogic-ejb-jar.xml
which refers to the EJB for the three OLTP message-driven beans from Example: weblogic-ra.xml (UPIC)
<weblogic-ejb-jar xmlns="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.1/weblogic-ejb-jar.xsd"> <weblogic-enterprise-bean> <ejb-name>SampleDialogOltpMdbBean</ejb-name> <message-driven-descriptor> <resource-adapter-jndi-name>BeanConnect</resource-adapter-jndi-name> </message-driven-descriptor> </weblogic-enterprise-bean> <weblogic-enterprise-bean> <ejb-name>SampleAsynOltpMdbBean</ejb-name> <message-driven-descriptor> <resource-adapter-jndi-name>BeanConnect</resource-adapter-jndi-name> </message-driven-descriptor> </weblogic-enterprise-bean> <weblogic-enterprise-bean> <ejb-name>SampleCciOltpMdbBean</ejb-name> <message-driven-descriptor> <resource-adapter-jndi-name>BeanConnect</resource-adapter-jndi-name> </message-driven-descriptor> </weblogic-enterprise-bean> </weblogic-ejb-jar>