📄 cmp6.html
字号:
<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <title>A Guided Tour of the RosterApp Settings</title> <link rel="StyleSheet" href="document.css" type="text/css" media="all" /> <link rel="StyleSheet" href="catalog.css" type="text/css" media="all" /> <link rel="Table of Contents" href="J2EETutorialTOC.html" /> <link rel="Previous" href="CMP5.html" /> <link rel="Next" href="CMP7.html" /> <link rel="Index" href="J2EETutorialIX.html" /> </head> <body> <table width="550" summary="layout" id="SummaryNotReq1"> <tr> <td align="left" valign="center"> <font size="-1"> <a href="http://java.sun.com/j2ee/1.4/download.html#tutorial" target="_blank">Download</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/faq.html" target="_blank">FAQ</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/history.html" target="_blank">History</a> </td> <td align="center" valign="center"><a accesskey="p" href="CMP5.html"><img id="LongDescNotReq1" src="images/PrevArrow.gif" width="26" height="26" border="0" alt="Prev" /></a><a accesskey="c" href="J2EETutorialFront.html"><img id="LongDescNotReq1" src="images/UpArrow.gif" width="26" height="26" border="0" alt="Home" /></a><a accesskey="n" href="CMP7.html"><img id="LongDescNotReq3" src="images/NextArrow.gif" width="26" height="26" border="0" alt="Next" /></a><a accesskey="i" href="J2EETutorialIX.html"></a> </td> <td align="right" valign="center"> <font size="-1"> <a href="http://java.sun.com/j2ee/1.4/docs/api/index.html" target="_blank">API</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/search.html" target="_blank">Search</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/sendusmail.html" target="_blank">Feedback</a></font> </font> </td> </tr> </table> <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider"> <blockquote><a name="wp83001"> </a><h2 class="pHeading1">A Guided Tour of the RosterApp Settings</h2><a name="wp83002"> </a><p class="pBody">This section introduces you to the settings of the deployment descriptors for entity beans with container-managed persistence and relationships. As this tour guides you through the <code class="cCode">deploytool</code> screens, it discusses the highlights of the tabs and dialog boxes that appear.</p><a name="wp83004"> </a><p class="pBody">To begin our tour, please run <code class="cCode">deploytool</code> and open the <code class="cCode">RosterApp.ear</code> file, which is in the <code class="cCode"><</code><code class="cVariable">INSTALL</code><code class="cCode">>/j2eetutorial14/examples/ejb/provided-ears/</code> directory.</p><a name="wp83005"> </a><h3 class="pHeading2">RosterApp</h3><a name="wp83006"> </a><p class="pBody">To view the deployment settings for the application, select the <code class="cCode">RosterApp</code> node in the tree view.</p><a name="wp83007"> </a><h4 class="pHeading3">General Tab (RosterApp)</h4><a name="wp83008"> </a><p class="pBody">The Contents field displays the files contained in the <code class="cCode">RosterApp.ear</code> file, including the two EJB JAR files (<code class="cCode">ejb-jar-ic.jar</code>, <code class="cCode">ejb-jar-ic1.jar</code>) and the J2EE application client JAR file (<code class="cCode">app-client-ic.jar</code>). See <a href="CMP6.html#wp83021">Figure 22-2</a>.</p><a name="wp83019"> </a><p class="pBody"></p><div align="left"><img src="images/Fig502.gif" height="382" width="446" alt="General tab of RosterApp" border="0" hspace="0" vspace="0"/></div><p class="pBody"></p><p> <a name="83021"> </a><strong><font >Figure 22-2 General Tab of <code class="cCode">RosterApp</code></font></strong></p><a name="wp83022"> </a><h4 class="pHeading3">JNDI Names Tab (RosterApp)</h4><a name="wp83024"> </a><p class="pBody">The Application table lists the JNDI names for the enterprise beans in the <code class="cCode">RosterApp</code> application.</p><a name="wp83025"> </a><p class="pBody">The References table has one entry. The EJB Ref entry maps the coded name (<code class="cCode">ejb/SimpleRoster</code>) in the <code class="cCode">RosterClient</code> to the JNDI name of the <code class="cCode">RosterEJB</code> session bean.</p><a name="wp83026"> </a><h3 class="pHeading2">RosterClient</h3><a name="wp83027"> </a><p class="pBody">To view this client, expand the <code class="cCode">RosterApp</code> node by clicking its adjacent key icon in the tree view. Next, select <code class="cCode">RosterClient</code>.</p><a name="wp83028"> </a><h4 class="pHeading3">JAR File Tab (RosterClient)</h4><a name="wp83029"> </a><p class="pBody">The Contents field shows the files contained by the <code class="cCode">app-client-ic.jar</code> file: two XML files (the deployment descriptors) and the class files (<code class="cCode">RosterClient.class</code>, <code class="cCode">Debug.class</code>, <code class="cCode">LeagueDetails.class</code>, <code class="cCode">PlayerDetails.class</code>, <code class="cCode">TeamDetails.class</code>).</p><a name="wp83030"> </a><h4 class="pHeading3">EJB Refs Tab (RosterClient)</h4><a name="wp83031"> </a><p class="pBody">The <code class="cCode">RosterClient</code> accesses a single bean, the <code class="cCode">RosterEJB</code> session bean. Because this access is remote, the value in the Interfaces column is Remote and the value for the Local/Remote Interface column is the bean's remote interface (<code class="cCode">roster.Roster</code>).</p><a name="wp83032"> </a><h3 class="pHeading2">RosterJAR </h3><a name="wp83033"> </a><p class="pBody">In the tree view, select <code class="cCode">RosterJAR</code>. This JAR file contains the <code class="cCode">RosterEJB</code> session bean. </p><a name="wp83034"> </a><h4 class="pHeading3">General Tab (RosterJAR)</h4><a name="wp83035"> </a><p class="pBody">The Contents field lists three packages of class files. The <code class="cCode">roster</code> package contains the class files required for <code class="cCode">RosterEJB</code>--the session bean class, remote interface, and home interface. The <code class="cCode">team</code> package includes the local interfaces for the entity beans accessed by the <code class="cCode">RosterEJB</code> session bean. The <code class="cCode">util</code> package holds the utility classes for this application.</p><a name="wp83036"> </a><h4 class="pHeading3">RosterEJB</h4><a name="wp83037"> </a><p class="pBody">In the tree view, expand the <code class="cCode">RosterJAR</code> node and select <code class="cCode">RosterEJB</code>.</p><a name="wp83038"> </a><h5 class="pHeading4">General Tab (RosterEJB)</h5><a name="wp83039"> </a><p class="pBody">This tab shows that <code class="cCode">RosterEJB</code> is a stateful session bean with remote access. Because it allows no local access, the Local Interfaces fields are empty. </p><a name="wp83040"> </a><h5 class="pHeading4">EJB Refs Tab (RosterEJB)</h5><a name="wp83041"> </a><p class="pBody">The <code class="cCode">RosterEJB</code> session bean accesses three entity beans: <code class="cCode">PlayerEJB</code>, <code class="cCode">TeamEJB</code>, and <code class="cCode">LeagueEJB</code>. Because this access is local, the entries in the Interfaces columns are defined as Local. The Home Interface column lists the local home interfaces of the entity beans. The Local/Remote Interfaces column displays the local interfaces of the entity beans.</p><a name="wp83042"> </a><p class="pBody">To view the runtime deployment settings, select a row in the table. For example, when you select the row with the Coded Name of <code class="cCode">ejb/SimpleLeague</code>, the <code class="cCode">LeagueEJB</code> name appears in the Enterprise Bean Name field. If a component references a local entity bean, then you must enter the name of the referenced bean in the Enterprise Bean Name field.</p><a name="wp83043"> </a><h3 class="pHeading2">TeamJAR </h3><a name="wp83044"> </a><p class="pBody">In the tree view, select the <code class="cCode">TeamJAR</code> node. This JAR file contains the three related entity beans: <code class="cCode">LeagueEJB</code>, <code class="cCode">TeamEJB</code>, and <code class="cCode">PlayerEJB</code>.</p><a name="wp83045"> </a><h4 class="pHeading3">General Tab (TeamJAR)</h4><a name="wp83046"> </a><p class="pBody">The Contents field shows two packages of class files: <code class="cCode">team</code> and <code class="cCode">util</code>. The <code class="cCode">team</code> package has the entity bean classes, local interfaces, and local home interfaces for all three entity beans. The <code class="cCode">util</code> package contains utility classes. It also shows the database schema file used to map the enterprise bean's fields to the database.</p><a name="wp83047"> </a><h4 class="pHeading3">Relationships Tab (TeamJAR)</h4><a name="wp83052"> </a><p class="pBody">On this tab (<a href="CMP6.html#wp83062">Figure 22-3</a>) you define the relationships between entity beans with container-managed persistence.</p><a name="wp83060"> </a><p class="pBody"></p><div align="left"><img src="images/Fig513.gif" height="234" width="358" alt="Relationships Tab of TeamJAR" border="0" hspace="0" vspace="0"/></div><p class="pBody"></p><p> <a name="83062"> </a><strong><font >Figure 22-3 Relationships Tab of <code class="cCode">TeamJAR</code></font></strong></p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -