Table 1 lists supported Oracle Tuxedo and application server versions.
The RAR file name is com.oracle.tuxedo.TuxedoAdapter.rar. After you modify the Oracle Tuxedo JCA Adapter configuration, it can be archived (using any name) be used to configure Oracle Tuxedo JCA Adapter to the application server.
Table 2 lists the RAR file contents.
The Oracle 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.
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.
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 4 shows a complete Oracle Tuxedo JCA Adapter configuration file 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 Oracle 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 5 shows an
ra.xml file example. You can use the ra.xml file distributed with the Oracle Tuxedo JCA Adapter as a base and customize it as needed.
. 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 Oracle Tuxedo JCA Adapter
ra.xml file.
Click Next; the
General Properties page appears as shown in
Figure 3. Enter the appropriate description in the
Description text entry box.
Click OK, then click
Save.
From 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.
Click OK to complete specification.
Note:
|
You can find a logs/server1/SystemOut.log. Look for “ TCP Channel TCP_3 is listening.”
|
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.
In Path to the new application select
Local file system. Use
Browse to select the
EchoMDB.jar file.
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.
Click Next: the Summary page appears as shown in
Figure 8. Click
Finish. The application server compiles and deploy deploys the MDB.
Listing 1 shows the Oracle Tuxedo UBBCONFIG file used in this example.
Note:
|
The MDB interface is similar to the existing EJB supported by Oracle Tuxedo JCA Adapter; however, they are not the same.
|
This is different from a JMS-based
MDB, it uses the
service() interface instead of the
onMessage() interface.
Listing 3 shows an
MDB code example that implements the “
Tolower” service for an Oracle Tuxedo client.
From menu Window select
Open Perspective, and then select
J2EE.
From menu “File” select
New, then select
Project…. Expand
EJB by clicking it, and then highlight
EJB Project. Click
Next.
In EJB Project menu fill in
Project Name” with “EchoMDB. Click
Next. The “
Select Project Facets” menu will be shown.
In “Select Project Facets” menu, make sure “
EJB Module” version is “
2.1”, “
Java” version is “
5.0”, and “WebSphere EJB (Extended” version is “
6.1”, and make sure these three are selected. Click on “
Next”.
In “EJB Module” menu you uncheck “
create an EJB Client JAR module to hold the client interface and classes” since inbound EJB is invoked by Oracle Tuxedo JCA Adapter so it is not needed. Click on “
Finish”.
Right click on project EchoMDB in the
Project Explorer. Select
Properties from the context menu,
the Properties for EchoMDB window appears as shown in
Figure 9.
Select Add External JARs… from the “Java Build Path”. Add the following two Jar files from Oracle Tuxedo JCA Adapter RAR file. (If you have not unzipped the RAR file, do so now.)
On the left Window pane under the Project Explorer, expand the newly create MDB project EchoMDB. Right click
EchoMDB, select
New, and then select
Other. Select
Enterprise Bean and click
Next. The
Create an Enterprise Bean popup window appears as shown in
Figure 10.
Click Next. The “Message Driven Bean type” popup window appears as shown in
Figure 11. Select
Other Type and then click
Browse. Enter
TuxedoMDBService and select from the list shown in
Figure 11, then click
OK.
The Message Driven Bean type popup window appears. Click
Finish.
Expand ejbModule in the left window pane until you see
EchoMDBBean.java. EchoMDBBean.java must be modified to perform the ECHO service. Double click
EchoMDBBean.java and the edit window pane with default editor appears as shown in
Figure 12.
Right click project EchoMDB in the Project Explorer, and then select
Deploy as shown in
Figure 13. This compiles it into class in the build directory.
In the Export popup window select EJB JAR file. Click
Next. The
EJB Jar Export popup window appears as shown in
Figure 15. Select
EchoMDB from the drop down menu, and enter the complete path of the jar file name in the
Destination: text field. Click
Finish.
The Save Resources popup window appears as shown in
Figure 16 click “OK”.
For Oracle Tuxedo JCA Adapter dispatching-based MDB, you must add
activation-config-property to its
ejb-jar.xml file using one of two ways.
Where eis/echo is the JNDI name of
EchoMDB.
Listing 2 shows the simple Oracle Tuxedo native client that accesses the
ECHO service imported from WebSphere application server.