J2EE Design Mode: CMP to BMP mode (2)

Source: Internet
Author: User
Tags stub
Weblogic-ejb-jar.xml for specific vendors
We first define vendor-specific information in weblogic-ejb-jar.xml. Here we will tell the server where to store the local stub (stub) and where to find the CMP ING.
Persistent ing information:
& Lt; persistence-type & gt;
& Lt; type-identifier & gt; WebLogic_CMP_RDBMS & lt;/type-identifier & gt;
& Lt; type-version & gt; 6.0 & lt;/type-version & gt;
& Lt; type-storage & gt; META-INF/weblogic-cmp-rdbms-jar.xml & lt;
/Type-storage & gt;
& Lt;/persistence-type & gt;
Local JNDI name
& Lt; local-jndi-name & gt; InventoryHome & lt;/local-jndi-name & gt;
Weblogic-cmp-rdbms-jar.xml for specific vendors
Data Source Name: (this data source is created during configuration)
& Lt; data-source-name & gt; InventoryDB & lt;/data-source-name & gt;
Table name:
& Lt; table-name & gt; inventory & lt;/table-name & gt;
Field ing
& Lt; field-map & gt;
& Lt; cmp-field & gt; stock & lt;/cmp-field & gt;
& Lt; dbms-column & gt; stock & lt;/dbms-column & gt;
& Lt;/field-map & gt;
& Lt; field-map & gt;
& Lt; cmp-field & gt; item & lt;/cmp-field & gt;
& Lt; dbms-column & gt; item & lt;/dbms-column & gt;
& Lt;/field-map & gt;
& Lt; field-map & gt;
& Lt; cmp-field & gt; price & lt;/cmp-field & gt;
& Lt; dbms-column & gt; price & lt;/dbms-column & gt;
& Lt;/field-map & gt;
Now we have everything we want. Containers use abstract classes and deployment information to make everything work well. For some reason, we may have this CMPbean transplanted to BMP. Which of the following is why we want to do this?
1. Portability: currently, it only works in WebLogic 6.1, and we do not want to learn other tools. This is normal if we want to sell this database component-it can run on any server.
2. Performance: if we want to run SQL well (using stored procedures, table Union, etc ).
3. Replaceable data sources: if we want to access different data sources rather than RDBMS.
Transplant Bean with BMP
Here we will discuss the porting mode. We can port CMP to BMP in the "change to persistent manager" mode. We can see that the persistent manager extends the abstract class we created and implements the abstract class method! The final design looks like Figure 2:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.