📄 jmsj2eeex.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>J2EE Examples Using the JMS API</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="JMS8.html" /> <link rel="Next" href="JMSJ2EEex2.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="JMS8.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="JMSJ2EEex2.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="wp81128"> </a><h2 class="pTitle">J2EE Examples Using the JMS API</h2><a name="wp78299"> </a><p class="pBody">This chapter provides examples that show how to use the JMS API within a J2EE application in the following ways:</p><div class="pSmartList1"><ul class="pSmartList1"><a name="wp85857"> </a><div class="pSmartList1"><li>Using a session bean to send messages that are consumed by a message-driven bean using a message selector and a durable subscription</li></div><a name="wp78304"> </a><div class="pSmartList1"><li>Using an application client to send messages that are consumed by two message-driven beans; the information from them is stored in an entity bean</li></div><a name="wp78305"> </a><div class="pSmartList1"><li>Using an application client to send messages that are consumed by a message-driven bean on a remote server</li></div><a name="wp81742"> </a><div class="pSmartList1"><li>Using an application client to send messages that are consumed by message-driven beans on two different servers</li></div></ul></div><a name="wp81260"> </a><p class="pBody">The examples are in the following directory:</p><div class="pPreformattedRelative"><pre class="pPreformattedRelative"> <<code class="cVariable">INSTALL</code>>/j2eetutorial14/examples/jms/<a name="wp90598"> </a></pre></div><a name="wp90597"> </a><p class="pBody">To build and run the examples, you will do the following:</p><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp85990"> </a><div class="pSmartList1"><li>Use the <code class="cCode">asant</code> tool to create resources and compile the example</li></div><a name="wp93455"> </a><div class="pSmartList1"><li>Use the Admin Console to create resources</li></div><a name="wp85992"> </a><div class="pSmartList1"><li>Use the <code class="cCode">deploytool</code> to package and deploy the example</li></div><a name="wp85993"> </a><div class="pSmartList1"><li>Use the <code class="cCode">appclient</code> command to run the client</li></div></ol></div><a name="wp85991"> </a><p class="pBody">Each example has a <code class="cCode">build.xml</code> file that refers to a <code class="cCode">targets.xml</code> file and a <code class="cCode">build.properties</code> file in the following directory:</p><div class="pPreformattedRelative"><pre class="pPreformattedRelative"><<code class="cVariable">INSTALL</code>>/j2eetutorial14/examples/jms/common/<a name="wp90603"> </a></pre></div><a name="wp91085"> </a><p class="pBody">The following directory contains built versions of each application:</p><div class="pPreformattedRelative"><pre class="pPreformattedRelative"><<code class="cVariable">INSTALL</code>>/j2eetutorial14/examples/jms/provided-ears<a name="wp91080"> </a></pre></div><a name="wp91106"> </a><p class="pBody">If you run into difficulty at any time, you can open the appropriate EAR file in <code class="cCode">deploytool</code> and compare that file to your own version.</p><a name="wp92620"> </a><p class="pBody">See Chapter <a href="MDB.html#wp79663">23</a> for a simpler example of a J2EE application that uses the JMS API.</p> </blockquote> <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider"> <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="JMS8.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="JMSJ2EEex2.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"><p><font size="-1">All of the material in <em>The J2EE(TM) 1.4 Tutorial</em> is <a href="J2EETutorialFront2.html">copyright</a>-protected and may not be published in other workswithout express written permission from Sun Microsystems.</font> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -