2002 Prentice Hall. All rights reserved. Chapter 21 Application Servers Outline 21.1 Introduction 21.2 J2EE Specification and Benefits 21.3 Commercial Application Servers 21.3.1 BEA WebLogic 6.0 21.3.2 iPlanet Application Server 6.0 21.3.3 IBM WebSphere Advanced Application Server 4.0 21.3.4 JBoss 2.2.2 Application Server 21.4 Deploying the Deitel Bookstore on BEA WebLogic 21.5 Deploying the Deitel Bookstore on IBM WebSphere 21.6 Internet and World Wide Web Resources
49
Embed
2002 Prentice Hall. All rights reserved. Chapter 21 Application Servers Outline 21.1 Introduction 21.2 J2EE Specification and Benefits 21.3 Commercial.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
2002 Prentice Hall. All rights reserved.
Chapter 21 Application ServersOutline21.1 Introduction21.2 J2EE Specification and Benefits21.3 Commercial Application Servers21.3.1 BEA WebLogic 6.021.3.2 iPlanet Application Server 6.021.3.3 IBM WebSphere Advanced Application Server 4.021.3.4 JBoss 2.2.2 Application Server21.4 Deploying the Deitel Bookstore on BEA WebLogic21.5 Deploying the Deitel Bookstore on IBM WebSphere21.6 Internet and World Wide Web Resources
2002 Prentice Hall. All rights reserved.
21.1 Introduction
• Java 2 Enterprise Edition• BEA WebLogic• IBM WebSphere• iPlanet Application Server• JBoss open-source application server
21.4 Deploying the Deitel Bookstore on BEA WebLogic (Cont.)
Parent Element Element Description caching-descriptor max-beans-in-free-pool Valid for stateless
session EJBs, defines the maximum number of free beans to keep in the pool. The default is no limit.
caching-descriptor initial-beans-in-free-pool
Valid for stateless session EJBs, defines the number of initial bean instances. The default is 0.
persistence-descriptor
is-modified-method-name Method name to be called when EJB is stored, method must return a boolean value. If method returns true EJB is saved.
persistence-descriptor
delay-updates-until-end-of-tx
When set to false, the beans database table is updated after every method. If true database is updated at the end of the transaction. The default is true.
Fig. 21.5 (Part 1 of 3) Optional tags for weblogic-ejb-jar.xml not used in text
2002 Prentice Hall. All rights reserved.
21.4 Deploying the Deitel Bookstore on BEA WebLogic (Cont.)
persistence-descriptor
finders-call-ejbload Valid for entity beans, the value true specifies that bean is loaded after it is first referenced with a finder method. Value false specifies that the bean is loaded when first invoked. The default is false.
persistence-descriptor
db-is-shared Valid for entity beans, For value false bean assumes it has exclusive access to database and does not reload data. For value true data is reloaded before each transaction. The default is true.
reference-descriptor resource-descriptor Contains description of resource factories referenced in ejb-jar.xml
resource-descriptor res-ref-name Resource reference name found in ejb-jar.xml
resource-descriptor jndi-name Assigns a JNDI name for resource factory
Fig. 21.5 (Part 2 of 3) Optional tags for weblogic-ejb-jar.xml not used in text
2002 Prentice Hall. All rights reserved.
21.4 Deploying the Deitel Bookstore on BEA WebLogic (Cont.)
security-role-assignment
role-name Security role name defined in ejb-jar.xml
security-role--assignment
principal-name Maps the role name to a principal defined in WebLogic. Consult edocs.bea.com for valid principal names.
weblogic-enterprise-bean
enable-call-by-reference
When EJBs are on the same server arguments are passed by reference, setting this value to false will cause variables to be passed by value.
Fig. 21.5 (Part 3 of 3) Optional tags for weblogic-ejb-jar.xml not used in text
persistence.dtd'>9 10 11 <!-- element containing rdbms properties for OrderEJB -->12 <weblogic-rdbms-bean>13 14 <!-- assigns this bean to pool named BookstorePool -->15 <pool-name>BookstorePool</pool-name>16 17 18 <!-- assigns this bean to table named CUSTOMERORDERS -->19 <table-name>CustomerOrders</table-name>20 21 <!-- element containing field mappings -->22 <attribute-map>23 24 25 <!-- field mapping for orderDate -->26 <object-link>27 <bean-field>orderDate</bean-field>28 <dbms-column>orderDate</dbms-column>29 </object-link>30 31 32 <!-- field mapping for shipped -->33 <object-link>
persistence.dtd'>9 10 <!-- element containing rdbms properties for OrderProductsEJB -->11 <weblogic-rdbms-bean>12 13 <!-- assigns this bean to pool named BookstorePool -->14 <pool-name>BookstorePool</pool-name>15 16 <!-- assigns this bean to table named ORDERPRODUCT -->17 <table-name>OrderProduct</table-name>18 19 <!-- element containing field mappings -->20 <attribute-map> 21 22 <!-- field mapping for quantity -->23 <object-link>24 <bean-field>quantity</bean-field>25 <dbms-column>quantity</dbms-column>26 </object-link>27 28 <!-- field mapping for ISBN -->29 <object-link>30 <bean-field>ISBN</bean-field>31 <dbms-column>ISBN</dbms-column>32 </object-link>33
2002 Prentice Hall.All rights reserved.
Outline
Fig. 21.10 Weblogic-cmp-rdbms-jar-orderProduct.xml defines WebLogic CMP database properties for the OrderProduct EJB.
34 <!-- field mapping for orderID -->35 <object-link>36 <bean-field>orderID</bean-field>37 <dbms-column>orderID</dbms-column>38 </object-link>39 40 </attribute-map>41 42 43 <finder-list>44 45 <!-- finder for findByOrderID -->46 <finder>47 <method-name>findByOrderID</method-name>48 <method-params>49 <method-param>java.lang.Integer</method-param>50 </method-params>51 52 <!-- select fields where orderID matches argument -->53 <finder-query>54 <![CDATA[( like orderID $0 )]]>55 </finder-query>56 </finder>57 58 </finder-list>59 60 <!-- additional options -->61 <options>62 <use-quoted-names>false</use-quoted-names>63 </options>64 65 </weblogic-rdbms-bean> <!-- end OrderProduct Descriptor -->
2002 Prentice Hall.All rights reserved.
Outline
Fig. 21.11 Weblogic-cmp-rdbms-jar-product.xml defines WebLogic CMP database properties for the Product EJB.
1 <?xml version = "1.0" encoding = "UTF-8"?>2 3 <!-- weblogic-cmp-rdbms-jar-product.xml ejb descriptor for -->4 <!-- ProductEJB defines rdbms properties for WebLogic -->5 6 <!DOCTYPE weblogic-rdbms-bean PUBLIC 7 '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS
persistence.dtd'>9 10 <!-- element containing rdbms properties for ProductEJB -->11 <weblogic-rdbms-bean>12 13 <!-- assigns this bean to pool named BookstorePool -->14 <pool-name>BookstorePool</pool-name>15 16 <!-- assigns this bean to table named PRODUCT -->17 <table-name>Product</table-name>18 19 <!-- element containing field mappings -->20 <attribute-map>21 22 <!-- field mapping for pages -->23 <object-link>24 <bean-field>pages</bean-field>25 <dbms-column>pages</dbms-column>26 </object-link>27 28 <!-- field mapping for author -->29 <object-link>30 <bean-field>author</bean-field>31 <dbms-column>author</dbms-column>32 </object-link>33
2002 Prentice Hall.All rights reserved.
Outline
Fig. 21.11 Weblogic-cmp-rdbms-jar-product.xml defines WebLogic CMP database properties for the Product EJB.
34 <!-- field mapping for publisher -->35 <object-link>36 <bean-field>publisher</bean-field>37 <dbms-column>publisher</dbms-column>38 </object-link>39 40 <!-- field mapping for price -->41 <object-link>42 <bean-field>price</bean-field>43 <dbms-column>price</dbms-column>44 </object-link>45 46 <!-- field mapping for image -->47 <object-link>48 <bean-field>image</bean-field>49 <dbms-column>image</dbms-column>50 </object-link>51 52 <!-- field mapping for ISBN -->53 <object-link>54 <bean-field>ISBN</bean-field>55 <dbms-column>ISBN</dbms-column>56 </object-link>57 58 <!-- field mapping for title -->59 <object-link>60 <bean-field>title</bean-field>61 <dbms-column>title</dbms-column>62 </object-link>63 64 </attribute-map>65 66 <finder-list>67
2002 Prentice Hall.All rights reserved.
Outline
Fig. 21.11 Weblogic-cmp-rdbms-jar-product.xml defines WebLogic CMP database properties for the Product EJB.
68 <!-- finder for findAllProducts -->69 <finder> 70 <method-name>findAllProducts</method-name>71 72 <!-- select fields where ISBN is not null -->73 <finder-query>74 <![CDATA[( isNotNull ISBN )]]>75 </finder-query>76 </finder>77 78 <!-- finder for findByTitle -->79 <finder>80 <method-name>findByTitle</method-name>81 <method-params>82 <method-param>java.lang.String</method-param>83 </method-params>84 85 <!-- select fields that title matches argument -->86 <finder-query>87 <![CDATA[( like title $0 )]]>88 </finder-query>89 </finder>90 91 </finder-list>92 93 94 <!-- additional options -->95 <options>96 <use-quoted-names>false</use-quoted-names>97 </options>98 99 </weblogic-rdbms-bean> <!-- end ProductEJB Descriptor -->
2002 Prentice Hall.All rights reserved.
Outline
Fig. 21.12 Weblogic-cmp-rdbms-jar-sequence.xml defines WebLogic CMP database properties for the SequenceFactory EJB.
1 <?xml version = "1.0" encoding = "UTF-8"?>2 3 <!-- weblogic-cmp-rdbms-jar-sequence.xml ejb descriptor for -->4 <!-- SequenceFactory defines rdbms properties for WebLogic -->5 6 <!DOCTYPE weblogic-rdbms-bean PUBLIC 7 '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS
persistence.dtd'>9 10 <!-- element containing rdbms properties for SequenceFactoryEJB -->11 <weblogic-rdbms-bean>12 13 <!-- assigns this bean to pool named BookstorePool -->14 <pool-name>BookstorePool</pool-name>15 16 <!-- assigns this bean to table SEQUENCEFACTORY -->17 <table-name>SequenceFactory</table-name>18 19 <!-- element containing field mappings -->20 <attribute-map>21 22 <!-- field mapping for addressID -->23 <object-link>24 <bean-field>tableName</bean-field>25 <dbms-column>tableName</dbms-column>26 </object-link>27 28 <!-- field mapping for primaryKey -->29 <object-link>30 <bean-field>nextID</bean-field>31 <dbms-column>nextID</dbms-column>32 </object-link>33
2002 Prentice Hall.All rights reserved.
Outline
Fig. 21.12 Weblogic-cmp-rdbms-jar-sequence.xml defines WebLogic CMP database properties for the SequenceFactory EJB.