⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch08s02.html

📁 详细介绍了jboss3.0的配置等
💻 HTML
字号:
<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Introduction</title><link rel="stylesheet" href="styles.css" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets Vimages/callouts/"><link rel="home" href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html" title="JBoss 3.0 Documentation"><link rel="up" href="ch08.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08.html" title="Chapter 8. JBoss and JMS"><link rel="previous" href="ch08.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08.html" title="Chapter 8. JBoss and JMS"><link rel="next" href="ch08s03.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08s03.html" title="Overview"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="jboss.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/jboss.gif" border="0"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch08.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch08.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch08s03.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08s03.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table><div class="section"><a name="jms-introduction"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="jms-introduction"></a>Introduction</h2></div></div><p>This chapter shows how to use the Java Messaging Service (JMS) in JBoss. It is not meant to be a tutorial on JMS in general, but one on how to use JMS with JBoss. For introductions to JMS please read the
<a href="javascript:if(confirm('http://java.sun.com/products/jms/docs.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://java.sun.com/products/jms/docs.html'" tppabs="http://java.sun.com/products/jms/docs.html" target="_top">JMS Specification</a>
 or check out the
<a href="javascript:if(confirm('http://java.sun.com/products/jms/tutorial/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://java.sun.com/products/jms/tutorial/'" tppabs="http://java.sun.com/products/jms/tutorial/" target="_top">JMS tutorial</a>.</p><p>Lately, the JMS support in JBoss has gone through some rapid changes; as a result, there are some marked differences between the 2.2.x releases, the 2.4.x releases and the development version. This chapter is focused on the 2.2.x releases. Features only available in later releases will be marked by the corresponding revision <span class="bold"><b>number</b></span>, either in the text or in a title. In an earlier version of this chapter the version number 2.5.x pointed to features only available in the development version of JBoss. Since then, with the release of JBossMQ 1.0beta, what was then said about 2.5.x is now valid for 2.4.1. References to 2.5.x have therefore been removed from this chapter. The examples covering 2.4.1 features, however, still contain &#8220;"25"&#8221; in their names. New features added to JBoss3.0 will be covered in a later version of this chapter.</p><p>Examples given in this chapter are short and to the point and they are here only to show how JMS may be used in principle. They are almost all of them based on the &#8220;Hello World&#8221; pattern. All the examples can be run through the provided example Ant build file.</p><p>Download the <tt>documentation-example.zip</tt> file and expand it someplace. Build and run the examples from the directory <tt>examples/build</tt>. All the source files for the JMS examples are available in the subdirectories below <tt>examples/org/jboss/docs/jms</tt>. In what follows, any mention of example source files should be understood to be relative to the <tt>examples</tt> directory.</p><p>To be able to build and run the JBoss documentation examples, the following environment variables need to be defined:</p><div class="table"><p><a name="d0e3007"></a><b>Table 8.1. Environment variables needed to run the examples</b></p><table summary="Environment variables needed to run the examples" border="1"><colgroup><col><col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>JAVA_HOME</tt></td><td>The location of a JDK 1.3, e.g. <tt>/opt/jdk1.3</tt></td></tr><tr><td><tt>JBOSS_DIST</tt></td><td>The location of the JBoss installation, e.g. <tt>/opt/JBoss-2.2.2</tt></td></tr></tbody></table></div><p>The Ant <tt>bin</tt> directory and the JDK <tt>bin</tt> directory must also be in your PATH as
described in <a href="ch01s05.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch01s05.html" title="Installing Ant">the section called &#8220;Installing Ant&#8221;</a> in the First Steps chapter of this manual.</p><p>As different examples work with different versions of JBoss, you will have to make sure that the <tt>JBOSS_DIST</tt> environment variable points to the correct version of JBoss for each particular example.</p><p>When this is done you may build the JMS examples like this:</p><div class="figure"><p><a name="d0e3051"></a><b>Figure 8.1. Build JMS examples</b></p><pre class="programlisting">
cd examples/build
ant jms-compile

</pre></div><p>When cutting and pasting code examples it is always best to use the example source files and not the examples in the manual; the source files are checked both at compile time and at run time, but the text in the manual, although it should be the same, only goes through a visual inspection.</p><p>For some of the examples, under directory <tt>org/jboss/docs/jms/bin</tt> you will find Unix shell scripts and Microsoft batch files made available to make it easier to see the files that have to be included in the classpath.</p><p>Most stuff is hardcoded and all the files that contain some code that differs from the code for JBoss version 2.2.x will be named with the applicable JBoss version. This might be a Java source file, a deployment descriptor or a shell script.</p></div><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="432" height="79"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch08.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch08.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch08s03.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch08s03.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -