This document describes the configuration, deployment, and touches some programming aspects of the inflow transaction through connector-based MDB (also called JMS-based MDB) feature. It allows inflow (inbound) transactions from Oracle Tuxedo to a Java application server. It contains the following topics:For more information see, the Tuxedo JCA Adapter Programming Guide and the Tuxedo JCA Adapter Users Guide.The Inflow Transaction feature is delivered as an RAR file; you must un-jar the file and modify the Oracle Tuxedo JCA Adapter (Tuxedo JCA Adapter) configuration before it can be installed on an application server.Table 1 lists supported Oracle Tuxedo and application server versions.
Table 1 Supported Versions The RAR file name is com.oracle.tuxedo.TuxedoAdapter.rar. After you modify the Tuxedo JCA Adapter configuration, it can be archived (using any name) be used to configure Tuxedo JCA Adapter to the application server.Table 2 lists the RAR file contents.
Table 2 RAR File Content Tuxedo JCA Adapter message catalogue . Japanese version of message catalogue of Tuxedo JCA Adapter. Tuxedo JCA Adapter schema file for Oracle . Sample weblogic-ra.xml file for WebLogic Server for connection factory based configuration Sample resource adapter deployment descriptor for dmconfig based configuration Sample weblogic-ra.xml file for WebLogic ServerThe Tuxedo JCA Adapter supports Oracle Tuxedo TDOMAIN protocol including its transaction as shown in Figure 1. When the Tuxedo JCA Adapter receives an inbound request from Oracle Tuxedo, it checks whether there is an associated Oracle Tuxedo transaction context or not. If it does have it, then the Tuxedo JCA Adapter creates a javax.transaction.xa.Xid based on the Oracle Tuxedo transaction context.The Tuxedo JCA Adapter supplies this XID to an ExecutionContext and submits the Work instance along with the ExecutionContext to the application server WorkManager for execution. By propagating an imported transaction to a Java application server this way, the application server and subsequent participants can work as part of the imported transaction.Figure 1 Oracle Tuxedo TDOMAIN Protocol
• An “Exported” service is a Java resource that can be accessed by an Oracle Tuxedo client; in this particular case it is the connector based MDB. You must configure the “Export” element in the dmconfig file for an Oracle Tuxedo client to access resources located in the Java application server.A single “Export” element in the dmconfig file refers to an exported resource to the Oracle Tuxedo client. Listing 1 shows two exported services (Tolower and Echo), to an Oracle Tuxedo client. The RemoteName is the service name the Oracle Tuxedo GWTDOMAIN gateway uses to invoke the service; the name attribute is the service name of the resource. The Type must be MDB for inflow transaction, and the Source is the JNDI binding of the MDB.Listing 1 Exported Services ExampleMultiple exported services using single MDB is also supported. The purpose is to give greater freedom to the adapter application developer. You can configure them using the same JNDI name specified in the dmconfig file Source element; however, since there is only one interface implemented by the application for that MDB, the application must do the dispatching itself. Listing 2 shows an example of multiple exported services using single MDB.This example exports two services INFO and ACCOUNT to an Oracle Tuxedo client using the same MDB that binds to JNDI name eis/services. In this case you must create and deploy one MDB that dispatches using the service name passed to the MDB. Listing 3 shows an example MDB Code Fragment doing its own dispatching.Listing 3 MDB Code FragmentListing 4 shows a complete Tuxedo JCA Adapter configuration file example.Multiple exported service using multiple is also supported. You can configure them using different JNDI name specified in "source" element in the dmconfig; and the Tuxedo JCA Adapter will do the dispatching base on the value in "source" element. Listing 5 shows a dmconfig file configuration example.
•
• You must configure the Resource Adapter Deployment Descriptor (ra.xml). The name, ra.xml, cannot be changed. Every RAR file must contain one ra.xml file. For inflow transactions using MDB to work, you must configure the inbound-resourceadapter element. This element is used to describe the interface and activation specification specific to the Tuxedo JCA Adapter.The inbound-resourceadapter element is fixed. The source property is the only property that you can configure. If configured, the JCA container requires the source property to be specified in the EJB descriptor (ejb-jar.xml), file.Listing 6 shows an ra.xml file example. You can use the ra.xml file distributed with the Tuxedo JCA Adapter as a base and customize it as needed.Listing 6 ra.xml File Exampledefault import will be used and will grant all service request to remote Tuxedo domain</description>. The fully qualified interface name is com.oracle.t uxedo.adapter.intf.TuxedoMDBService. The fully qualified activation specification is com.oracle.tuxedo.adapter.spi.TuxedoActivationSpec. You must not change any one of these two values in the Tuxedo JCA Adapter ra.xml file.For application-based dispatching method, there is no ActivationSpec Java Bean property needs to be configured. For adapter-based dispatching, you must specify the required configuration property "source" in the Resource Adapter Deployment Descriptor.The following configuration fragment is in the Resource Adapter Deployment Descriptor, ra.xml, to enable Oracle Tuxedo JCA Connector to accept inbound service request:Listing 7 Inbound Service Request ExampleListing 8 Inbound MDB Service RequestTo differentiate a none JMS-based MDB to an ordinary EJB, you must configure "Export" with type "MDB”. For application-based dispatch, "Source" and "SourceLocation" are not needed and can be left out; if specified they are ignored.Listing 9 shows an application-based dispatch dmcomfig example.Listing 9 dmconfig ConfigurationTo support none JMS-based MDB for inbound service request using Factory Based Configuration a new property, "exportSpec", is added. Listing 11 defines the recursive descend grammar for "exportSpec".Listing 11 exportSpecListing 12 shows a Factory Based configuration example.Listing 12 Factory Based Configuration ExampleListing 13 is another Factory-Based configuration example that also configures the JNDI name of the MDB.Listing 14 is an MDN interface example.Listing 14 MDB Interface
Note: Listing 15 is shows an MDB code example based on the EJB 3.0 specification that implements this interface.Listing 15 EJB 3.0 specificationListing 16 shows an EJB 2.1 example that does exactly the same thing.Listing 16 sample based on EJB 2.1You must also configure the Oracle Tuxedo GWTDOMAIN gateway to communicate with the Tuxedo JCA Adapter. Listing 17 shows an Oracle Tuxedo /Domain configuration file example.Listing 17 Tuxedo /Domain Configuration File ExampleIn this example, Oracle Tuxedo imports the services TolowerMDB, EchoMDB, INFO, and ACCOUNT; while the Tuxedo JCA Adapter exports them.On the WebSphere Integrated Solution Console, enter https://localhost:9047/ibm/console/logon.jsp (where 9047 is the port number your application server is listening on).Before deploying the Tuxedo JCA Adapter for WebSphere application server, a dmconfig configuration file must be created. Listing 18 shows a dmconfig file example.Listing 18 dmconfig File Websphere ExampleYou can either create the Resource Adapter Deployment Descriptor from scratch or modify an existing one. Listing 8 shows a Deploy Descriptor example.Listing 19 Deploy Descriptor Exampledefault import will be used and will grant all service request to remote Tuxedo domain</description>After logging in to the WebSphere Integrated Solution Console select Resource from the left window pane; select Resource Adapters as shown in Figure 2. The Resource adapter window appears. Click Browse to find your RAR file.Click Next; the General Properties page appears as shown in Figure 3. Enter the appropriate description in the Description text entry box.Figure 3 General Properties PageFrom Resource adapter > Tuxedo JCA Adapter, select J2C activation specification under Additional Properties; the J2C activation specification page appears as shown in Figure 4. Select New; enter a name for the activation specification and its JNDI name (this example uses EchoMDB as name and eis/echo as its JNDI name. This JNDI name is the JNDI name EchoMDB uses.Figure 4 J2C Activation Specification PageClick OK to complete specification.
Note: On the left pane of console select Environment; this expands the menu item with a sub-menu. Select Shared Library; the Shared Library screen appears.Click New; the configuration screen appears. Fill in Name with any name you like. For this example, enter EchoMDBEnv in the Name text entry box. In the Classpath window enter the full path name of the following two JAR files.On left pane of the console, select Applications, then select Install New Application. The Enterprise Application menu appears.In How do you want to install the application, select Show me all installation options and parameters. Click Next; the Select installation options page appears as shown in Figure 5. Select Deploy enterprise beans, then click Next.Figure 5 Select installation Options PageIn the “Step 2: Map modules to servers” select the server where you want your Echo MDB be available. Place a check mark to “EchoMDB” then click Apply. Click Next.Figure 6 Select EchoMDB ModuleIn the “Step 3: Bind listeners for message-driven beans” select Activation Specification as shown in Figure 7 then enter the JNDI name for this MDB (in this case, enter eis/echo).Figure 7 Activation SpecificationClick Next: the Summary page appears as shown in Figure 8. Click Finish. The application server compiles and deploy deploys the MDB.Figure 8 Summary PageClick Save.From the left pane of the console select Applications and then select Enterprise Applications. Select EchoMDB.jar and click Start. Echo” EJB is activated.Listing 63 shows the Oracle Tuxedo UBBCONFIG file used in this example.Listing 63 Oracle Tuxedo UBBCONFIG File ExampleListing 64 shows an i/Domain configuration example.Listing 64 Oracle Tuxedo/Domain Configuration ExampleListing 65 shows the simple Oracle Tuxedo native client that accesses the ECHO service imported from WebSphere application server.