ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

J2EE Connector Architecture
Pages: 1, 2, 3

1. Tuxedo

Set up Tuxedo 8.1 on a Solaris system, and start the stock quote example (under the samples/atmi/xmlstockquote directory of the Tuxedo installation). The instructions are included in the same directory. Then, configure the Tuxedo Work Station Listener to listen on port 8090.



Here's an outline of the relevant part of the ubbconfig configuration file.

*SERVERS
"stockxml" SRVGRP="GROUP1" SRVID=30
   CLOPT="-A -p 1,5:2,5 -o stock.out 
       -e stock.err -r" 
   RQADDR="stockxml"
   RQPERM=0666 REPLYQ=Y RPPERM=0666 
       MIN=1 MAX=5 CONV=N
   SYSTEM_ACCESS=FASTPATH
   MAXGEN=1 GRACE=86400 RESTART=N
   MINDISPATCHTHREADS=0 MAXDISPATCHTHREADS=1 
       THREADSTACKSIZE=0
"WSL" SRVGRP="GROUP2" SRVID=20
   CLOPT="-A -- -n //host1:8090" 
   RQPERM=0660 REPLYQ=Y RPPERM=0660 
       MIN=1 MAX=1 CONV=N
   SYSTEM_ACCESS=FASTPATH
   MAXGEN=5 GRACE=86400 RESTART=Y
   MINDISPATCHTHREADS=0 MAXDISPATCHTHREADS=1 
       THREADSTACKSIZE=0
   SICACHEENTRIESMAX="500"

*SERVICES
"STOCKQUOTE"
   LOAD=50 PRIO=50
   BUFTYPE="ALL"
   TRANTIME=30
   AUTOTRAN=N

2. Attunity Tuxedo J2EE CA Resource Adapter

The Attunity Connect solution consists of a J2EE CA resource adapter, an integration engine (Attunity Connect Engine), and a design time environment (Attunity Connect Studio). To set up the adapter, follow these steps:

  • Configure the integration engine to communicate with the Tuxedo installation by modifying the nav_login script. In this example, the WSNADDR is set to point to: //localhost:8090

  • Define the interaction for invoking the stock quote Tuxedo service from the EJB, and the data structures for the input argument and return type for the interaction, using Attunity Connect Studio. The interaction is named STOCKQUOTE. Its input argument is defined as a MappedRecord (as defined in CCI) named Record1. Its return type is defined as a MappedRecord named STOCKQUOTE_Response.

First, define a MappedRecord called Record1 for a new interaction, which contains a single field of type String. Record1 is used as the input record for the interaction, as seen in Figure 2.

Click for larger view
Figure 2. Defining MappedRecord Record1 using Attunity Connect Studio. (You can click on the screenshot to open a full-size view.)

Next, define the STOCKQUOTE_Response MappedRecord as the output record of the new interaction. The Record1 field within STOCKQUOTE_Response has the same structure as the Record1 record defined earlier (see Figure 3.)

Click for larger view
Figure 3. Defining the STOCKQUOTE_Response MappedRecord. (You can click on the screenshot to open a full-size view.)

Then define the new STOCKQUOTE interaction (see Figure 4.)

Click for larger view
Figure 4. Defining the STOCKQUOTE Interaction. (You can click on the screenshot to open a full-size view.)

Finally, deploy the Attunity resource adapter into OC4J using OC4J's deployment tool, and configure the adapter to communicate with Tuxedo through Attunity Connect. Do this by setting properties in the OC4J resource adapter-specific oc4j-ra.xml configuration file. The following lists the properties you must set.

  • userName/password
    The username and password of the user who started the Attunity Connect daemon process.

  • eisName
    The name of the adapter as defined during design time (in this example, stockquote).

  • serverName
    The machine on which the integration server runs.

The following code example outlines the resulting oc4j-ra.xml file.

<connector-factory location="eis/attunityForTuxedo" 
   connector-name="Attunity Connect Legacy Adapter">
   <config-property name="userName" 
       value="foo"/>
   <config-property name="password" 
       value="bar"/>
   <config-property name="eisName" 
       value="stockquote"/>
   <config-property name="serverName" 
       value="host1"/>
   <config-property name="workspace" 
       value="stockquoteEvent"/>
   <config-property name="portNumber" 
       value="2552"/>
   <config-property name="persistentConnection" 
       value="true"/>
   <config-property name="keepAlive" 
       value="true"/>
   <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>

Pages: 1, 2, 3

Next Pagearrow