Migrating Resource Adapters from OC4J to WebLogic, Part 1 Outbound

Both OC4J and WebLogic server support Connector 1.5 specification. If customer's resource adapters were developed based on SPEC and don't depend on OC4J proprietary extensions or features, it would be relatively easy to migrate the adapters from OC4J to WebLogic. During migration, one of the key steps is mapping OC4J's proprietary descriptors to WebLogic's descriptors. Here in this article we will show you how to migrate the descriptors for standalone adapters.

 

Resource adapters can be classified into three categories: outbound, inbound or bi-directional. This article will show you how to deal with outbound case. Inbound case will be shown in next article. It would be easy to understand how to deal with bi-directional case after reading outbound case and inbound case.

 

l       Overview of Descriptors

Many adapters may just support outbound communication from application server to EIS. The descriptor used in this scenario is oc4j-ra.xml. It contains OC4J specific configuration for outbound communication such as connection factories/pools, and should be mapped to weblogic-ra.xml.

 

If an adapter also supports inbound communication from EIS to application server, there is another descriptor for adapter: oc4j-connectors.xml. It defines admin objects for inbound communication, and also should be mapped to weblogic-ra.xml.

 

So there is just one single descriptor file used on WebLogic: weblogic-ra.xml for all types of adapters: outbound, inbound, and bidirectional.

 

For inbound, MDB should be used as message endpoint in standard Java EE environment. In this case, orion-ejb-jar.xml is required for the MDB (note: this file is packaged inside MDB jar, not adapter). It associates MDB with adapter, and should be mapped to weblogic-ejb-jar.xml in the MDB jar.

 

l       Mapping for Outbound Case

Here is a sample descriptor of OC4J which show a typical configuration for outbound connection factory. It should be packaged as META-INF\oc4j-ra.xml in the RAR file.

<?xml version="1.0"?>

<oc4j-connector-factories xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.oracle.com/technology/oracleas/schema/oc4j-connector-factories-10_0.xsd" schema-major-version="10" schema-minor-version="0" >

 

     <connector-factory location="eis/fooConnectionFactory" connector-name="fooConnector">

                <config-property name="serverName" value="localhost"/>

                <config-property name="port" value="80"/>

                <connection-pooling use="private">

                          <property name="minConnections" value="1" />

                          <property name="initial-capacity" value="1" />

                          <property name="maxConnections" value="10" />

                </connection-pooling>

                <connectionfactory-interface>foo.bar.MyConnectionFactory</connectionfactory-interface>

     </connector-factory>

 

</oc4j-connector-factories>

 

One big difference is that an adapter instance is uniquely identified by connector-name on OC4J; but on WebLogic, the adapter java bean instance will be bound to JNDI and uniquely identified by its JNDI name. So, the connector-name="fooConnector" on OC4J should be mapped to <jndi-name>fooConnector</jndi-name> on WebLogic. Please note that enable-global-access-to-classes should be enabled on WebLogic in general so as to let other deployed applications to access this standalone adapter. You will see later that connector-name on OC4J and corresponding jndi-name on WebLogic is also used when associating MDB with adapter in inbound case.

 

On OC4J, each connection factory instance is defined by one connector-factory element. It should be mapped to outbound-resource-adapter\connection-definition-group\connection-instance element on WebLogic. There might be multiple connector-factory elements on OC4J. Correspondingly, they can be mapped to multiple connection-instance elements on WebLogic.

 

Each connection factory instance must have a connectionfactory-interface element. This is same for both OC4J and WebLogic. So it is just needed to map connector-factory\connectionfactory-interface on OC4J to outbound-resource-adapter\connection-definition-group\onnection-factory-interface on WebLogic.

 

It is same for OC4J and WebLogic that connection factory should be bind to JNDI, and the mapping is quite straightforward. The location="eis/fooConnectionFactory" defines the JNDI name for the connector-factory on OC4J and should be mapped directly to <jndi-name> element under connection-instance on WebLogic.

 

The mapping for config-property is also straightforward. Each property should be mapped to connection-instance\connection-properties\properties\property on WebLogic.

 

The mapping for connection-pooling is a little complex, since OC4J and WebLogic have different set of configurations for the connection pool and each has some options that are hard to be mapped to the options of the other. One difference is that OC4J support "shared connection pool" concept that several connection factory instances can share a single connection pool; whereas on WebLogic each connection factory instance has its own connection pool. If, for example, 2 connection factory instances on OC4J share one connection pool, it would be required to define two separate connection-instance elements on WebLogic and each connection-instance will maintain its own connection pool internally. The maxConnections can be directly mapped to max-capacity on WebLogic and keep same effect. But the minConnections and initial-capacity are a little confusing and both can be mapped to initial-capacity on WebLogic. Other configurations may not be directly mapped to WebLogic straightforwardly. The detail description of all available configuration options for WebLogic's pool can be found at " Configuring Connection Pool Parameters" http://download.oracle.com/docs/cd/E12839_01/web.1111/e13732/connect.htm#i1251021

 

 

Here is the result after performing above mapping, and the result file should be packaged as META-INF\weblogic-ra.xml in the RAR file.

<?xml version = "1.0"?>

<weblogic-connector xmlns="http://www.bea.com/ns/weblogic/90">

 

           <jndi-name>fooConnector</jndi-name>

           <enable-global-access-to-classes>true</enable-global-access-to-classes>

   <outbound-resource-adapter>

    <connection-definition-group>

      <connection-factory-interface>foo.bar.MyConnectionFactory</connection-factory-interface>

      <connection-instance>

        <jndi-name>eis/fooConnectionFactory</jndi-name>

        <connection-properties>

          <pool-params>

            <initial-capacity>1</initial-capacity>

            <max-capacity>10</initial-capacity>

          </pool-params>

          <transaction-support>NoTransaction</transaction-support>

          <properties>
              <property>
                  <name>serverName</name>
                  <value>localhost</value>
              </property>
              <property>
                  <name>port</name>
                  <value>80</value>
              </property>
          </properties>
     </connection-properties>

      </connection-instance>

    </connection-definition-group>

   </outbound-resource-adapter>

 

</weblogic-connector>

 

You may have noted that WebLogic allows overriding transaction-support in weblogic-ra.xml while this is not allowed on OC4J. This allows extra useful flexibility in some cases. For example, if you have 1 connection-definition in ra.xml which supports LocalTransaction but some times you want to configure a connection factory instance and don't want it to participate in any global transaction, you can configure 2 connection-instances in weblogic-ra.xml and one as LocalTransaction while the other as NoTransaction.

 

l       Reference

Detailed information on configuring and developing resource adapters on WebLogic is available at Programming Resource Adapters for Oracle WebLogic Server. You can find detail explanation for weblogic-ra.xml schema in appendix "A. weblogic-ra.xml Schema"

Comments:

Online articles directories have gained in popularity during the last few years. The main reason for this are many SEO coupled features and possibilities an article directory made available to authors and content seekers. Some of the popular articles directories allow authors to submit their work for free while some charge a tiny one-time registration fee. Submit your articles to a SEO directory and get your article published within a day!

Posted by Jacqulyn Hearing on February 17, 2010 at 01:37 AM PST #

Nice post. Just found it on Yahoo. Thank u for the useful information. Keep up the excellent work :)

Posted by Colin Fava on June 19, 2010 at 10:41 AM PDT #

Hopefully I can get this to work for me. It sure can't hurt to try to implement some of these tips.

Posted by Tom Casey on August 01, 2010 at 08:18 AM PDT #

Great and useful method, I have been doing this with great results. Like anything else though you have to think outside the box.

Posted by Anthony Jones on August 01, 2010 at 08:34 AM PDT #

I really enjoy reading your blog. Great work and keep it up.

Posted by Carne on October 07, 2010 at 03:28 PM PDT #

You may gain real hard earned by buying and selling within the FX market. This market place offers a variety of possibilities to individuals interested in the sector of trade. inspite of this there are cerainly limitless speculations on how to trade foreign exchange efficiently. You might as well find instances wherever individuals have misplaced their complete moolah while trading in this market. You can find also situations of people acquiring a regular income from all of these markets. These instances point out that many people take chances with their deals. They don't have appropriate fully understanding on the Foreign exchange advertise that can result in large losses. The trades in Forex markets attain as much as 2 trillion each dayHence it is important for you to adopt definite foreign currency trading suggestions on your trade to be productive.

Posted by australian exchange rate on November 15, 2010 at 12:54 PM PST #

A terrific handy device to have if your a student, a teacher, or perhaps even work in an workplace surroundings is a pen scanner. What is a pen scanner you could ask? A pen scanning device works precisely similar to that of a highlighter. You slide the scanner throughout textual content and the pen scanning device will scan it, outlet it, after which transfer it onto your personal computer when needed. It may also allow you to scan small images, and some models can read the textual content to you as you scan it.

Posted by pen scanners on November 18, 2010 at 07:57 AM PST #

It appears that you have put a good amount of effort into your blog and this world require more of these on the Internet these days. The both of us actually enjoyed your post. I do not have a great deal to say in reply, I just wanted to sign up to reply well done.I always learn something new from your post!

Posted by pres on December 02, 2010 at 11:14 AM PST #

You make blogging look like a walk in the park! I've been trying to blog daily but I just cant find writing material.. you're an inspiration to me and i'm sure many others!

Posted by Link Building Services on December 30, 2010 at 07:39 AM PST #

Where are you?

Posted by hello on January 04, 2011 at 09:07 PM PST #

hello!,I like your writing so much! share we communicate more about your article on AOL? I require a specialist on this area to solve my problem. Maybe that's you! Looking forward to see you.

Posted by Adam Haybarger on January 08, 2011 at 08:30 PM PST #

This is getting a bit more subjective, but I much prefer the Zune Marketplace. The interface is colorful, has more flair, and some cool features like 'Mixview' that let you quickly see related albums, songs, or other users related to what you're listening to. Clicking on one of those will center on that item, and another set of "neighbors" will come into view, allowing you to navigate around exploring by similar artists, songs, or users. Speaking of users, the Zune "Social" is also great fun, letting you find others with shared tastes and becoming friends with them. You then can listen to a playlist created based on an amalgamation of what all your friends are listening to, which is also enjoyable. Those concerned with privacy will be relieved to know you can prevent the public from seeing your personal listening habits if you so choose.

Posted by Paxil generic on March 06, 2011 at 07:45 AM PST #

I found your site from altavista and it is eye-popping. Thank you for sharing such an incredible article...

Posted by Diflucan on March 07, 2011 at 12:49 AM PST #

Simply desire to say your article is as surprising. The clarity in your post is just spectacular and i can assume you're an expert on this subject. Well with your permission let me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the gratifying work.

Posted by biuro rachunkowe wrocław on March 10, 2011 at 06:41 AM PST #

The only place you'll find success before work is in the dictionary

Posted by tricor dangers on March 12, 2011 at 07:10 PM PST #

There are certainly a couple more details to take into consideration, but thank you for sharing this information.

Posted by Keflex on March 21, 2011 at 12:49 AM PDT #

What makes Fake COACH Handbags very popular is that they are very useful and functional for all ages. From children to elders, bags are used to wear many treasures.

Posted by Louis Vuitton Handbags on April 14, 2011 at 05:14 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The official blog for Oracle WebLogic Server fans and followers!

Stay Connected

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today