http://git-wip-us.apache.org/repos/asf/activemq-6/blob/8ecd255f/docs/user-manual/src/main/resources/schemaToTable.xsl
----------------------------------------------------------------------
diff --git a/docs/user-manual/src/main/resources/schemaToTable.xsl 
b/docs/user-manual/src/main/resources/schemaToTable.xsl
new file mode 100644
index 0000000..1f5deda
--- /dev/null
+++ b/docs/user-manual/src/main/resources/schemaToTable.xsl
@@ -0,0 +1,374 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<xsl:stylesheet version="2.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+                xmlns:hq="urn:org.hornetq"
+                xmlns:fn="http://www.w3.org/2005/xpath-functions";>
+
+   <!--
+    XSL to transform HornetQ schemas into DocBook tables to be used in our 
user manual reference.
+
+    For each option element defined in the schema, it tries to create 
something like
+
+ <row>
+    <entry>
+       <link linkend="DocBookIdReference">ELEMENT-NAME</link>
+    </entry>
+    <entry>TYPE</entry>
+    <entry>DESCRIPTION</entry>
+    <entry>DEFAULT_VALUE</entry>
+ </row>
+
+    TODO:
+    - generate Java code with the defaults (instead of duplicating them there).
+   -->
+
+   <xsl:output method="xml" indent="yes"/>
+
+   <xsl:function name="hq:name-or-ref">
+      <xsl:param name="ename"/>
+      <xsl:param name="eref"/>
+      <xsl:choose>
+         <xsl:when test="string-length($ename) > 0 ">
+            <xsl:value-of select="$ename"/>
+         </xsl:when>
+         <xsl:otherwise>
+            <xsl:value-of select="$eref"/>
+         </xsl:otherwise>
+      </xsl:choose>
+   </xsl:function>
+
+   <xsl:template match="/">
+      <tbody>
+
+         <xsl:comment>
+            THIS IS A GENERATED FILE. DO NOT EDIT IT DIRECTLY!
+
+            HornetQ options reference table generated from:
+            <xsl:copy-of select="concat('hornetq-', 
substring-after(base-uri(), 'hornetq-'))"/>
+
+            
=======================================================================
+
+            XSLT Version = <xsl:copy-of 
select="system-property('xsl:version')"/>
+            XSLT Vendor = <xsl:copy-of select="system-property('xsl:vendor')"/>
+            XSLT Vendor URL = <xsl:copy-of 
select="system-property('xsl:vendor-url')"/>
+            <xsl:text>&#xa;</xsl:text>
+         </xsl:comment>
+
+         <!-- Add some new lines of text.. -->
+         <xsl:text>&#xa;</xsl:text>
+         <xsl:text>&#xa;</xsl:text>
+
+         <!-- main 'for-each' for "hornetq-configuration.xsd". Notice the 
attribute matching at the
+              select which ensures this only matches 
"hornetq-configuration.xsd". -->
+         <xsl:for-each-group 
select="xsd:schema/xsd:element[@hq:schema='hornetq-configuration']"
+                             group-by="@name">
+            <!-- the manual reference should list options in sorted order.
+                 Notice that this is only OK because the first level of 
options is "xsd:all".
+
+                 Options of sub-types are not ordered because they are often 
"xsd:sequence" (meaning that
+                 their order matters), so those options should not have its 
order changed.
+            -->
+            <xsl:sort select="@name" data-type="text" />
+
+            <!-- <xsl:if test="not(./xsd:annotation/@hq:linkend)"> -->
+            <!--   <xsl:message terminate="yes"> -->
+            <!--     Error: Lacks proper Docbook link: 
xsd:annotation/@hq:linkend -->
+            <!--     <xsl:copy-of select="."/> -->
+            <!--   </xsl:message> -->
+            <!-- </xsl:if> -->
+            <xsl:call-template name="xsd_element">
+               <xsl:with-param name="prefix"/>
+               <xsl:with-param name="parentLinkend" 
select="xsd:annotation/@hq:linkend"/>
+            </xsl:call-template>
+
+            <!-- Add 2 new lines between each option -->
+            <xsl:text>&#xa;</xsl:text>
+            <xsl:text>&#xa;</xsl:text>
+         </xsl:for-each-group>
+
+         <!-- JMS: main 'for-each' for "hornetq-jms.xsd". Notice the attribute 
matching at the
+              select which ensures this only matches "hornetq-jms.xsd". -->
+         <xsl:for-each 
select="xsd:schema/xsd:element[@hq:schema='hornetq-jms-configuration']/xsd:complexType/xsd:sequence/xsd:element">
+
+            <xsl:call-template name="xsd_element">
+               <xsl:with-param name="prefix"/>
+               <xsl:with-param name="parentLinkend" 
select="xsd:annotation/@hq:linkend"/>
+            </xsl:call-template>
+
+            <!-- Add 2 new lines between each option -->
+            <xsl:text>&#xa;</xsl:text>
+            <xsl:text>&#xa;</xsl:text>
+         </xsl:for-each>
+
+      </tbody>
+   </xsl:template>
+
+   <xsl:template name="xsd_complexType" match="xsd:complexType">
+      <xsl:param name="prefix" />
+      <xsl:param name="linkend" />
+
+      <xsl:comment>
+         &#xa;VALUE OF COMPLEX TYPE&#xa;
+      </xsl:comment>
+
+      <xsl:apply-templates select="xsd:attribute">
+         <xsl:with-param name="prefix" select="$prefix"/>
+         <xsl:with-param name="parentLinkend" select="$linkend"/>
+      </xsl:apply-templates>
+
+      <xsl:for-each select="(xsd:sequence|xsd:all)/xsd:element">
+         <xsl:call-template name="xsd_element">
+            <xsl:with-param name="prefix" select="$prefix"/>
+            <xsl:with-param name="parentLinkend" select="$linkend"/>
+         </xsl:call-template>
+      </xsl:for-each>
+   </xsl:template>
+
+   <xsl:template name="entry-for-default-value">
+      <entry>
+         <xsl:value-of 
select="string-join((@default,xsd:annotation/@hq:default), ' ')"/>
+      </entry>
+   </xsl:template>
+
+   <xsl:template name="entry-for-description">
+      <entry>
+         <xsl:value-of 
select="normalize-space(xsd:annotation/xsd:documentation)"/>
+      </entry>
+   </xsl:template>
+
+   <xsl:template name="entry-for-simple-type">
+      <entry>
+         <xsl:value-of select="@type"/>
+      </entry>
+   </xsl:template>
+
+   <xsl:template name="entry-type-of-complex-element">
+      <entry>
+         <xsl:choose>
+            <xsl:when test="count(xsd:complexType/xsd:sequence/xsd:element)=1">
+               <xsl:value-of
+                       select="concat('Sequence of &lt;', 
xsd:complexType/xsd:sequence/xsd:element/( hq:name-or-ref(@name,@ref) ), 
'/&gt;')"/>
+            </xsl:when>
+            <xsl:otherwise>
+               <xsl:text>Complex element</xsl:text>
+            </xsl:otherwise>
+         </xsl:choose>
+      </entry>
+   </xsl:template>
+
+   <xsl:template match="xsd:attribute">
+      <xsl:param name="prefix" />
+      <xsl:param name="parentLinkend" />
+
+      <xsl:variable name="linkend">
+         <xsl:choose>
+            <xsl:when test="xsd:annotation/@hq:linkend">
+               <xsl:value-of select="xsd:annotation/@hq:linkend"/>
+            </xsl:when>
+            <xsl:otherwise>
+               <xsl:value-of select="$parentLinkend"/>
+            </xsl:otherwise>
+         </xsl:choose>
+      </xsl:variable>
+
+      <row>
+         <entry>
+            <xsl:element name="link">
+               <xsl:attribute name="linkend">
+                  <xsl:value-of select="$linkend"/>
+               </xsl:attribute>
+               <xsl:value-of select="$prefix"/>
+               <xsl:value-of select="@name"/>
+               <xsl:text> (</xsl:text>
+               <xsl:if test="@use = 'required'">
+                  <xsl:text>required </xsl:text>
+               </xsl:if>
+               <xsl:text>attribute)</xsl:text>
+            </xsl:element>
+         </entry>
+         <xsl:call-template name="entry-for-simple-type"/>
+         <xsl:call-template name="entry-for-description"/>
+         <xsl:call-template name="entry-for-default-value"/>
+      </row>
+   </xsl:template>
+
+
+   <!-- ELEMENT -->
+   <xsl:template name="xsd_element">
+      <xsl:param name="prefix" />
+      <xsl:param name="parentLinkend" />
+
+      <xsl:comment>&#xa;ELEMENT TEMPLATE name=<xsl:value-of select="@name"/>
+         <xsl:text>&#xa;</xsl:text>
+      </xsl:comment>
+
+      <xsl:text>&#xa;</xsl:text>
+      <!--
+
+  We handle the following situations (differently):
+  1. <element name="foo" />                     find definition using 'name'
+  2. <element name="foo>....</element>:         complexType,simpleType,etc
+  3. <element name="foo" type="xsd:BUILTIN"/>   'simple' simpleType
+  4. <element name="foo" type="fooType"/>       find definition using 'type'
+  5. <element ref="foo">                        find definition using 'ref'
+
+      -->
+
+      <xsl:variable name="linkend">
+         <xsl:choose>
+            <xsl:when test="xsd:annotation/@hq:linkend">
+               <xsl:value-of select="xsd:annotation/@hq:linkend"/>
+            </xsl:when>
+            <xsl:otherwise>
+               <xsl:value-of select="$parentLinkend"/>
+            </xsl:otherwise>
+         </xsl:choose>
+      </xsl:variable>
+
+      <xsl:choose>
+
+         <xsl:when test="@name">
+            <!-- cases 1,2,3,4 -->
+
+            <xsl:choose>
+               <!-- XSD:BUILT-IN -->
+               <xsl:when test="starts-with(string(@type), 'xsd:')">
+                  <row>
+                     <xsl:call-template name="entry-for-name">
+                        <xsl:with-param name="prefix" select="$prefix"/>
+                        <xsl:with-param name="linkend" select="$linkend"/>
+                     </xsl:call-template>
+                     <xsl:call-template name="entry-for-simple-type"/>
+                     <xsl:call-template name="entry-for-description"/>
+                     <xsl:call-template name="entry-for-default-value"/>
+                  </row>
+               </xsl:when>
+
+               <xsl:when test="not(@type)">
+                  <xsl:choose>
+                     <xsl:when test="xsd:complexType">
+                        <row>
+                           <xsl:call-template name="entry-for-name">
+                              <xsl:with-param name="prefix" select="$prefix"/>
+                              <xsl:with-param name="linkend" 
select="$linkend"/>
+                           </xsl:call-template>
+                           <xsl:call-template 
name="entry-type-of-complex-element"/>
+                           <xsl:call-template name="entry-for-description"/>
+                           <entry/> <!-- complexTypes have no 'default' value. 
-->
+                        </row>
+
+                        <!-- backup-servers is a recursive type, which I need 
to take it out otherwise
+                             there would be an infinite recursive loop -->
+                        <xsl:if test="fn:not(@name='backup-servers')">
+                           <!-- Process child nodes -->
+                           <xsl:apply-templates select="xsd:complexType">
+                              <xsl:with-param name="prefix" 
select="concat($prefix,@name,'.')"/>
+                              <xsl:with-param name="linkend" 
select="$linkend"/>
+                           </xsl:apply-templates>
+                        </xsl:if>
+                     </xsl:when>
+
+                     <!-- simpleType. Normally string restrictions: A|B|C -->
+                     <xsl:when test="xsd:simpleType">
+                        <row>
+                           <xsl:call-template name="entry-for-name">
+                              <xsl:with-param name="prefix" select="$prefix"/>
+                              <xsl:with-param name="linkend" 
select="$linkend"/>
+                           </xsl:call-template>
+                           <entry>
+                              <xsl:if 
test="xsd:simpleType/xsd:restriction[@base='xsd:string']">
+                                 <xsl:value-of 
select="fn:string-join(xsd:simpleType/xsd:restriction/xsd:enumeration/@value,'|')"/>
+                              </xsl:if>
+                           </entry>
+                           <xsl:call-template name="entry-for-description"/>
+                           <xsl:call-template name="entry-for-default-value"/>
+                        </row>
+                     </xsl:when>
+
+                     <xsl:otherwise>
+                        <!-- the NAME is a reference -->
+                        <xsl:comment>&#xa;E.NAME-ref name=<xsl:copy-of 
select="@name"/><xsl:text>&#xa;</xsl:text></xsl:comment>
+                        <xsl:variable name="my-type" select="@name"/>
+                        <row>
+                           <xsl:call-template name="entry-for-name">
+                              <xsl:with-param name="prefix" select="$prefix"/>
+                              <xsl:with-param name="linkend" 
select="$linkend"/>
+                           </xsl:call-template>
+                           <xsl:call-template 
name="entry-type-of-complex-element"/>
+                           <entry>
+                              <xsl:value-of 
select="normalize-space(xsd:annotation/xsd:documentation)"/>
+                              <xsl:value-of 
select="normalize-space(/xsd:schema/xsd:complexType[@name=$my-type]/xsd:annotation/xsd:documentation)"/>
+                           </entry>
+                           <entry/> <!-- no default value -->
+                        </row>
+                        <xsl:apply-templates 
select="/xsd:schema/xsd:complexType[@name=$my-type]">
+                           <xsl:with-param name="prefix" 
select="concat($prefix,@name,'.')"/>
+                           <xsl:with-param name="linkend" select="$linkend"/>
+                        </xsl:apply-templates>
+                     </xsl:otherwise>
+                  </xsl:choose>
+               </xsl:when>
+
+               <xsl:otherwise>
+                  <!-- the TYPE is a reference -->
+                  <!-- There is a type but it is not built-in, so we need to 
find its definition -->
+                  <xsl:variable name="my-type" select="@type"/>
+                  <row>
+                     <xsl:call-template name="entry-for-name">
+                        <xsl:with-param name="prefix" select="$prefix"/>
+                        <xsl:with-param name="linkend" select="$linkend"/>
+                     </xsl:call-template>
+                     <xsl:call-template name="entry-type-of-complex-element"/>
+                     <entry>
+                        <xsl:value-of 
select="normalize-space(xsd:annotation/xsd:documentation)"/>
+                        <xsl:value-of 
select="normalize-space(/xsd:schema/xsd:complexType[@name=$my-type]/xsd:annotation/xsd:documentation)"/>
+                     </entry>
+                     <entry/> <!-- no default value -->
+                  </row>
+                  <xsl:comment>&#xa;ELEMENT TYPE-ref TEMPLATE 
CHILDREN&#xa;</xsl:comment>
+                  <xsl:text>&#xa;</xsl:text>
+                  <xsl:apply-templates 
select="/xsd:schema/xsd:complexType[@name=$my-type]">
+                     <xsl:with-param name="prefix" 
select="concat($prefix,@name,'.')"/>
+                     <xsl:with-param name="linkend" select="$linkend"/>
+                  </xsl:apply-templates>
+               </xsl:otherwise>
+            </xsl:choose>
+
+         </xsl:when>
+
+         <xsl:when test="@ref">
+            <xsl:comment>&#xa;ELEMENT REF TEMPLATE ref=<xsl:copy-of 
select="@ref"/>&#xa;</xsl:comment>
+            <xsl:text>&#xa;</xsl:text>
+
+            <xsl:variable name="my-ref" select="@ref"/>
+            <xsl:for-each select="/xsd:schema/xsd:element[ @name = 
string($my-ref) ]">
+               <xsl:call-template name="xsd_element">
+                  <xsl:with-param name="prefix" select="$prefix"/>
+                  <xsl:with-param name="parentLinkend" select="$linkend"/>
+               </xsl:call-template>
+            </xsl:for-each>
+         </xsl:when>
+         <xsl:otherwise>
+            <!-- FAIL? -->
+         </xsl:otherwise>
+      </xsl:choose>
+   </xsl:template>
+
+   <xsl:template name="entry-for-name">
+      <xsl:param name="prefix" />
+      <xsl:param name="linkend" />
+
+      <entry>
+         <xsl:element name="link">
+            <xsl:attribute name="linkend">
+               <xsl:value-of select="$linkend"/>
+            </xsl:attribute>
+            <xsl:value-of select="$prefix"/>
+            <xsl:value-of select="@name"/>
+         </xsl:element>
+      </entry>
+   </xsl:template>
+
+</xsl:stylesheet>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/8ecd255f/docs/user-manual/user-manual.xpr
----------------------------------------------------------------------
diff --git a/docs/user-manual/user-manual.xpr b/docs/user-manual/user-manual.xpr
new file mode 100644
index 0000000..2f3e5dd
--- /dev/null
+++ b/docs/user-manual/user-manual.xpr
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+    <meta>
+        <filters directoryPatterns="" filePatterns=""
+            positiveFilePatterns="" showHiddenFiles="false"/>
+        <options/>
+    </meta>
+    <projectTree name="user-manual.xpr">
+        <folder name="en">
+            <folder name="diagrams">
+                <file name="en/diagrams/architecture-diagrams.odg"/>
+            </folder>
+            <folder name="images">
+                <file name="en/images/architecture1.jpg"/>
+            </folder>
+            <file name="en/appserver-integration.xml"/>
+            <file name="en/architecture.xml"/>
+            <file name="en/client-classpath.xml"/>
+            <file name="en/client-reconnection.xml"/>
+            <file name="en/clusters.xml"/>
+            <file name="en/configuration-index.xml"/>
+            <file name="en/configuring-transports.xml"/>
+            <file name="en/connection-ttl.xml"/>
+            <file name="en/core-bridges.xml"/>
+            <file name="en/diverts.xml"/>
+            <file name="en/duplicate-detection.xml"/>
+            <file name="en/embedding-hornetq.xml"/>
+            <file name="en/examples.xml"/>
+            <file name="en/filter-expressions.xml"/>
+            <file name="en/flow-control.xml"/>
+            <file name="en/ha.xml"/>
+            <file name="en/intercepting-operations.xml"/>
+            <file name="en/interoperability.xml"/>
+            <file name="en/jms-bridge.xml"/>
+            <file name="en/jms-core-mapping.xml"/>
+            <file name="en/large-messages.xml"/>
+            <file name="en/last-value-queues.xml"/>
+            <file name="en/libaio.xml"/>
+            <file name="en/logging.xml"/>
+            <file name="en/management.xml"/>
+            <file name="en/master.xml"/>
+            <file name="en/message-expiry.xml"/>
+            <file name="en/message-grouping.xml"/>
+            <file name="en/messaging-concepts.xml"/>
+            <file name="en/notice.xml"/>
+            <file name="en/paging.xml"/>
+            <file name="en/perf-tuning.xml"/>
+            <file name="en/persistence.xml"/>
+            <file name="en/pre-acknowledge.xml"/>
+            <file name="en/preface.xml"/>
+            <file name="en/project-info.xml"/>
+            <file name="en/queue-attributes.xml"/>
+            <file name="en/scheduled-messages.xml"/>
+            <file name="en/security.xml"/>
+            <file name="en/send-guarantees.xml"/>
+            <file name="en/thread-pooling.xml"/>
+            <file name="en/transaction-config.xml"/>
+            <file name="en/undelivered-messages.xml"/>
+            <file name="en/using-core.xml"/>
+            <file name="en/using-jms.xml"/>
+            <file name="en/using-server.xml"/>
+            <file name="en/wildcard-routing.xml"/>
+            <file name="en/wildcard-syntax.xml"/>
+        </folder>
+    </projectTree>
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/8ecd255f/docs/user-manual/zh/appserver-integration.xml
----------------------------------------------------------------------
diff --git a/docs/user-manual/zh/appserver-integration.xml 
b/docs/user-manual/zh/appserver-integration.xml
new file mode 100644
index 0000000..a77e810
--- /dev/null
+++ b/docs/user-manual/zh/appserver-integration.xml
@@ -0,0 +1,1001 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
============================================================================= 
-->
+<!-- Copyright © 2009 Red Hat, Inc. and others.                               
     -->
+<!--                                                                           
    -->
+<!-- The text of and illustrations in this document are licensed by Red Hat 
under  -->
+<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license 
("CC-BY-SA"). -->
+<!--                                                                           
    -->
+<!-- An explanation of CC-BY-SA is available at                                
    -->
+<!--                                                                           
    -->
+<!--            http://creativecommons.org/licenses/by-sa/3.0/.                
    -->
+<!--                                                                           
    -->
+<!-- In accordance with CC-BY-SA, if you distribute this document or an 
adaptation -->
+<!-- of it, you must provide the URL for the original version.                 
    -->
+<!--                                                                           
    -->
+<!-- Red Hat, as the licensor of this document, waives the right to enforce,   
    -->
+<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent    
    -->
+<!-- permitted by applicable law.                                              
    -->
+<!-- 
============================================================================= 
-->
+<chapter id="appserver-integration">
+    <title>Java EE和应用服务器的集成</title>
+    <para>HornetQ可以容易地安装到JBoss 4应用服务器及å…
¶ä»¥ä¸Šç‰ˆæœ¬ã€‚有关安装的详细说明请参阅快速指南。</para>
+    <para>HornetQ提供了一个JCA适配器,使得它还可以与其它JEEå…
¼å®¹çš„应用服务器集成。请参阅其它应用服务器的
+          有关JCA适配器集成的说明来操作。</para>
+    <para>JCA适配器的作用是控制消息流å…
¥åˆ°æ¶ˆæ¯Bean(MDB),并控制消息从各种JEE模块中发出(如EJB和Servlet)。</para>
+    <para>本章讲述这些JEE模块配置HornetQ的基本信息。</para>
+    <section>
+        <title>配置消息Bean</title>
+        <para>使用HornetQ向MDB传
递消息,需要在文件<literal>ra.xml</literal>中配置JCA适é…
å™¨ã€‚该文件在
+            <literal>jms-ra.rar</literal>文件中。默认é…
ç½®ä¸‹HornetQ服务使用InVm连接器接收消息。在本章
+            后面列出了可配置的选项。</para>
+        <para>所有MDB都需要有目标类型和目标的相关é…
ç½®ã€‚下面就是一个使用annotation配置MDB的例子:</para>
+        <programlisting>@MessageDriven(name = "MDBExample",
+               activationConfig =
+                     {
+                        @ActivationConfigProperty(propertyName = 
"destinationType", propertyValue = "javax.jms.Queue"),
+                        @ActivationConfigProperty(propertyName = 
"destination", propertyValue = "queue/testQueue")
+                     })
+@ResourceAdapter("hornetq-ra.rar")
+public class MDBExample implements MessageListener
+{
+   public void onMessage(Message message)...
+}</programlisting>
+        <para>上例中é…
ç½®äº†MDB从一个队列中接收消息,它的JNDI绑定名为<literal>queue/testQueue</literal>。
+            这个队列必须事先在HornetQ服务器配置文件中é…
ç½®å¹¶éƒ¨ç½²å¥½çš„。</para>
+        <para><literal>ResourceAdapter</literal> 
annotation用来指出使用哪个适配器。要使用它必须要引入
+            <literal>org.jboss.ejb3.annotation.ResourceAdapter</literal> 
(JBoss AS 5.x或以上)。
+            这个类在
+            
<literal>jboss-ejb3-ext-api.jar</literal>文件中。该文件可以在JBoss的repository中找到。
+            另外一个方法是使用部署描述文件(deployment 
descriptor),即在文件<literal
+            >jboss.xml</literal>中加入类似以下的内容:
+<programlisting>&lt;message-driven>
+   &lt;ejb-name>ExampleMDB&lt;/ejb-name>
+   &lt;resource-adapter-name>hornetq-ra.rar&lt;/resource-adapter-name>
+&lt;/message-driven>
+</programlisting>ä½ 
还可以将hornetq-ra.rar改名为jms-ra.rar而不需要任何annotation或额外的部署描述信息。但是ä½
 éœ€è¦
+            编辑<literal>jms-ds.xml</literal>文件,将å…
¶ä¸­çš„<literal>rar-name</literal>项改成相应的值。</para>
+        <note>
+           <para>HornetQ是JBoss AS 6默认的JMS提供者
。从这个版本开始HornetQ的资源适配器名字是
+               <literal>jms-ra.rar</literal>,并且你
不需要在MDB的annotation中指定它。</para>
+        </note>
+        <para>HornetQ发布包
中的所有例子都使用annotation方法。</para>
+        <section>
+            <title>使用容器管理事务(CMT)</title>
+            <para>当MDB使用容器管理事务时,消息的传递被包
含在一个JTA事务中。事务的提交与回滚是由容器来控制的。如果事务
+                被回滚,消息传
递会进行相应的处理(默认是重新传递消息,如果重新传
递次数超过10次,消息就被发往DLQ)。使用
+                annotation配置如下:</para>
+            <programlisting>@MessageDriven(name = "MDB_CMP_TxRequiredExample",
+               activationConfig =
+                     {
+                        @ActivationConfigProperty(propertyName = 
"destinationType", propertyValue = "javax.jms.Queue"),
+                        @ActivationConfigProperty(propertyName = 
"destination", propertyValue = "queue/testQueue")
+                     })
+@TransactionManagement(value= TransactionManagementType.CONTAINER)
+@TransactionAttribute(value= TransactionAttributeType.REQUIRED)
+@ResourceAdapter("hornetq-ra.rar")
+public class MDB_CMP_TxRequiredExample implements MessageListener
+{
+   public void onMessage(Message message)...
+}</programlisting>
+            <para><literal>TransactionManagement</literal> 
表示这个MDB使用容器管理持久性。
+                <literal>TransactionAttribute</literal> 
表示这个MDB要求JTA事务。注意这个annotation的
+                
另外唯一的合法值是<literal>TransactionAttributeType.NOT_SUPPORTED</literal>,它表示
+                MDB不需要JTA事务支持。</para>
+            
<para>如果要回滚事务,可以调用<literal>MessageDrivenContext</literal>的
+                <literal>setRollbackOnly</literal>方法。如下面的代ç 
æ‰€ç¤ºï¼š</para>
+            <programlisting>   @Resource
+   MessageDrivenContextContext ctx;
+
+   public void onMessage(Message message)
+   {
+      try
+      {
+         //something here fails
+      }
+      catch (Exception e)
+      {
+         ctx.setRollbackOnly();
+      }
+   }</programlisting>
+            <para>如果你不需要使用XA事务,你
可以用一相本地的事务来代替(比如你只有一个JMS资源)。
+                如下所示:</para>
+            <programlisting>@MessageDriven(name = "MDB_CMP_TxLocalExample",
+               activationConfig =
+                     {
+                           @ActivationConfigProperty(propertyName = 
"destinationType", propertyValue = "javax.jms.Queue"),
+                           @ActivationConfigProperty(propertyName = 
"destination", propertyValue = "queue/testQueue"),
+                           @ActivationConfigProperty(propertyName = 
"useLocalTx", propertyValue = "true")
+                     })
+@TransactionManagement(value = TransactionManagementType.CONTAINER)
+@TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)
+@ResourceAdapter("hornetq-ra.rar")
+public class MDB_CMP_TxLocalExample implements MessageListener
+{
+   public void onMessage(Message message)...
+}</programlisting>
+        </section>
+        <section>
+            <title>使用Bean管理事务(BMT)</title>
+            <para>消息Bean可以通过é…
ç½®ä½¿ç”¨Bean管理的事务(BMT)。在种情
况下会创建一个用户事务
+                (User Transaction)。如下所示:</para>
+            <programlisting>@MessageDriven(name = "MDB_BMPExample",
+               activationConfig =
+                     {
+                        @ActivationConfigProperty(propertyName = 
"destinationType", propertyValue = "javax.jms.Queue"),
+                        @ActivationConfigProperty(propertyName = 
"destination", propertyValue = "queue/testQueue"),
+                        @ActivationConfigProperty(propertyName = 
"acknowledgeMode", propertyValue = "Dups-ok-acknowledge")
+                     })
+@TransactionManagement(value= TransactionManagementType.BEAN)
+@ResourceAdapter("hornetq-ra.rar")
+public class MDB_BMPExample implements MessageListener
+{
+   public void onMessage(Message message)
+}</programlisting>
+            <para>使用BMT时,消息的传
递在用户事务的范围之外,它的通知模式由<literal>acknowledgeMode</literal>参数决定。
+                
该参数有两个合法的值,即<literal>Auto-acknowledge</literal>和<literal
+                    
>Dups-ok-acknowledge</literal>。请注意,由于消息的传
递在事务之外,在MDB中如果发生错误消息
+                是不会重新传递的。</para>
+            
<para>用户可以像如下所示控制事务的生命周期:</para>
+            <programlisting>   @Resource
+   MessageDrivenContext ctx;
+
+   public void onMessage(Message message)
+   {
+      UserTransaction tx;
+      try
+      {
+         TextMessage textMessage = (TextMessage)message;
+
+         String text = textMessage.getText();
+
+         UserTransaction tx = ctx.getUserTransaction();
+
+         tx.begin();
+         
+         //do some stuff within the transaction
+
+         tx.commit();
+
+      }
+      catch (Exception e)
+      {
+         tx.rollback();
+      }
+   }</programlisting>
+        </section>
+        <section>
+            <title>在MDB中使用选择器</title>
+            <para>MDB可以配置消息选择器。如下所示:</para>
+            <programlisting>@MessageDriven(name = "MDBMessageSelectorExample",
+               activationConfig =
+                     {
+                        @ActivationConfigProperty(propertyName = 
"destinationType", propertyValue = "javax.jms.Queue"),
+                        @ActivationConfigProperty(propertyName = 
"destination", propertyValue = "queue/testQueue"),
+                        @ActivationConfigProperty(propertyName = 
"messageSelector", propertyValue = "color = 'RED'")
+                     })
+@TransactionManagement(value= TransactionManagementType.CONTAINER)
+@TransactionAttribute(value= TransactionAttributeType.REQUIRED)
+@ResourceAdapter("hornetq-ra.rar")
+public class MDBMessageSelectorExample implements MessageListener
+{
+   public void onMessage(Message message)....
+}</programlisting>
+        </section>
+    </section>
+    <section>
+        <title>在JEE模块内发送消息</title>
+        <para>JCA适配器支持发送消息。连接工厂的默认é…
ç½®åœ¨<literal>jms-ds.xml</literal>文件中,对应的JNDI名字是
+            
<literal>java:/JmsXA</literal>。在JEE中使用它发送消息将作为JTA事务的一部分来对å¾
…。</para>
+        
<para>如果消息发送失败,整个事务将回滚,消息会被重新发送。下面是一个MDB发送消息的例子:</para>
+        <programlisting>@MessageDriven(name = "MDBMessageSendTxExample",
+               activationConfig =
+                     {
+                        @ActivationConfigProperty(propertyName = 
"destinationType", propertyValue = "javax.jms.Queue"),
+                        @ActivationConfigProperty(propertyName = 
"destination", propertyValue = "queue/testQueue")
+                     })
+@TransactionManagement(value= TransactionManagementType.CONTAINER)
+@TransactionAttribute(value= TransactionAttributeType.REQUIRED)
+@ResourceAdapter("hornetq-ra.rar")
+public class MDBMessageSendTxExample implements MessageListener
+{
+   @Resource(mappedName = "java:/JmsXA")
+   ConnectionFactory connectionFactory;
+
+   @Resource(mappedName = "queue/replyQueue")
+   Queue replyQueue;
+
+   public void onMessage(Message message)
+   {
+      Connection conn = null;
+      try
+      {
+         //Step 9. We know the client is sending a text message so we cast
+         TextMessage textMessage = (TextMessage)message;
+
+         //Step 10. get the text from the message.
+         String text = textMessage.getText();
+
+         System.out.println("message " + text);
+
+         conn = connectionFactory.createConnection();
+
+         Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         MessageProducer producer = sess.createProducer(replyQueue);
+
+         producer.send(sess.createTextMessage("this is a reply"));
+
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+      finally
+      {
+         if(conn != null)
+         {
+            try
+            {
+               conn.close();
+            }
+            catch (JMSException e)
+            { 
+            }
+         }
+      }
+   }
+   }</programlisting>
+        <para>在JBoss应用服务器的EJB(包括会话Bean, 
实体Bean和消息Bean)、Servlet(包括jsp)我定制的MBean中
+            都可以使用JMS的JCA适配器来发送消息。</para>
+    </section>
+    <section>
+      <title>MDB与接收池的大小</title>
+      <para>包括JBoss在内的绝大多数应用服务器å…
è®¸ç”¨æˆ·å®šä¹‰ä¸€ä¸ªæ± 
中的MDB数量。在JBoss中这个参数名是<literal>MaxPoolSize</literal>,它在文件
+         ejb3-interceptors-aop.xml中配置。这个参数不影响实际
创建的会话/接收者的数量。资源适配器不知道MDB的å…
·ä½“实现。所以即使你设置MDB池在大小
+         为1,仍然会有15个会话/接收者
被创建(默认值)。如果你想改变会话/接收者
创建的数量,你可以通过设置资源适配器的参数
+         
<literal>maxSession</literal>实现。也可以通过设置MDB的激活é…
ç½®å‚数来完成:</para>
+        <programlisting>@MessageDriven(name = "MDBMessageSendTxExample",
+               activationConfig =
+                     {
+                        @ActivationConfigProperty(propertyName = 
"destinationType", propertyValue = "javax.jms.Queue"),
+                        @ActivationConfigProperty(propertyName = 
"destination", propertyValue = "queue/testQueue"),
+                        @ActivationConfigProperty(propertyName = "maxSession", 
propertyValue = "1")
+                     })
+@TransactionManagement(value= TransactionManagementType.CONTAINER)
+@TransactionAttribute(value= TransactionAttributeType.REQUIRED)
+@ResourceAdapter("hornetq-ra.rar")
+public class MyMDB implements MessageListener
+{ ....}
+      </programlisting>
+   </section>
+    <section>
+        <title>配置JCA适配器</title>
+        <para>通过JCA适配器可以将HornetQ集成到JEEå…
¼å®¹çš„模块中,如MDB和EJB。它的é…
ç½®å†³å®šäº†è¿™äº›æ¨¡å—如何接收和发送消息。</para>
+        <para>HornetQ的JCA适é…
å™¨æ˜¯é€šè¿‡<literal>jms-ra.rar</literal>部署的。它的配置文件中å…
¶ä¸­çš„
+              <literal>META-INF/ra.xml</literal>。</para>
+        <para>下面是它的具体配置内容:</para>
+        <programlisting>&lt;resourceadapter>
+      
&lt;resourceadapter-class>org.hornetq.ra.HornetQResourceAdapter&lt;/resourceadapter-class>
+      &lt;config-property>
+         &lt;description>The transport type&lt;/description>
+         &lt;config-property-name>ConnectorClassName&lt;/config-property-name>
+         &lt;config-property-type>java.lang.String&lt;/config-property-type>
+         
&lt;config-property-value>org.hornetq.core.remoting.impl.invm.InVMConnectorF
+         actory&lt;/config-property-value>
+      &lt;/config-property>
+      &lt;config-property>
+         &lt;description>The transport configuration. These values must be in 
the form of key=val;key=val;&lt;/description>
+         
&lt;config-property-name>ConnectionParameters&lt;/config-property-name>
+         &lt;config-property-type>java.lang.String&lt;/config-property-type>
+         &lt;config-property-value>server-id=0&lt;/config-property-value>
+      &lt;/config-property>
+
+      &lt;outbound-resourceadapter>
+         &lt;connection-definition>
+            
&lt;managedconnectionfactory-class>org.hornetq.ra.HornetQRAManagedConnection
+            Factory&lt;/managedconnectionfactory-class>
+
+            &lt;config-property>
+               &lt;description>The default session type&lt;/description>
+               
&lt;config-property-name>SessionDefaultType&lt;/config-property-name>
+               
&lt;config-property-type>java.lang.String&lt;/config-property-type>
+               
&lt;config-property-value>javax.jms.Queue&lt;/config-property-value>
+            &lt;/config-property>
+            &lt;config-property>
+               &lt;description>Try to obtain a lock within specified number of 
seconds; less
+               than or equal to 0 disable this functionality&lt;/description>
+               &lt;config-property-name>UseTryLock&lt;/config-property-name>
+               
&lt;config-property-type>java.lang.Integer&lt;/config-property-type>
+               &lt;config-property-value>0&lt;/config-property-value>
+            &lt;/config-property>
+
+            
&lt;connectionfactory-interface>org.hornetq.ra.HornetQRAConnectionFactory
+            &lt;/connectionfactory-interface>
+            
&lt;connectionfactororg.hornetq.ra.HornetQConnectionFactoryImplonFactoryImpl
+            &lt;/connectionfactory-impl-class>
+            
&lt;connection-interface>javax.jms.Session&lt;/connection-interface>
+            &lt;connection-impl-class>org.hornetq.ra.HornetQRASession
+            &lt;/connection-impl-class>
+         &lt;/connection-definition>
+         &lt;transaction-support>XATransaction&lt;/transaction-support>
+         &lt;authentication-mechanism>
+            &lt;authentication-mechanism-type>BasicPassword
+            &lt;/authentication-mechanism-type>
+            
&lt;credential-interface>javax.resource.spi.security.PasswordCredential
+            &lt;/credential-interface>
+         &lt;/authentication-mechanism>
+         &lt;reauthentication-support>false&lt;/reauthentication-support>
+      &lt;/outbound-resourceadapter>
+
+      &lt;inbound-resourceadapter>
+         &lt;messageadapter>
+            &lt;messagelistener>
+               
&lt;messagelistener-type>javax.jms.MessageListener&lt;/messagelistener-type>
+               &lt;activationspec>
+                  
&lt;activationspec-class>org.hornetq.ra.inflow.HornetQActivationSpec
+                  &lt;/activationspec-class>
+                  &lt;required-config-property>
+                      
&lt;config-property-name>destination&lt;/config-property-name>
+                  &lt;/required-config-property>
+               &lt;/activationspec>
+            &lt;/messagelistener>
+         &lt;/messageadapter>
+      &lt;/inbound-resourceadapter>
+
+   &lt;/resourceadapter></programlisting>
+        <para>整个配置可以分为三个主要部分</para>
+        <orderedlist>
+            <listitem>
+                <para>适配器的全局参数</para>
+            </listitem>
+            <listitem>
+                <para>适配器外部(outbound)é…
ç½®ã€‚用于在JEE环境中创建JMS资源。</para>
+            </listitem>
+            <listitem>
+                <para>适配器内部(inbound)é…
ç½®ã€‚用于控制MDB的消息接收。 </para>
+            </listitem>
+        </orderedlist>
+        <section>
+            <title>适配器的全局参数</title>
+            <para>首å…
ˆçœ‹åˆ°çš„第一个参数是<literal>resourceadapter-class</literal>。这是HornetQ
+                的适配器类。此参数不可更改。</para>
+            <para>在此之后是可配置的参数。前两个配置适é…
å™¨æ‰€ä½¿ç”¨çš„传输。其余的用来配置连接工厂。</para>
+            
<note><para>所有连接工厂的参数在没有定义时使用默认值。参数<literal>reconnectAttempts</literal>
+                        
的默认值取-1,表示如果连接失败,HornetQ会不停地尝试重新连接。这个参数只适用于创建远程
+                        连接的情
况。如果是InVm连接器,则永远不可能发生连接故
障。</para></note>
+            <para>下面给出了每个参数的说明:</para>
+            <table frame="topbot" border="2">
+                <title>全局配置参数</title>
+                <tgroup cols="3">
+                    <colspec colname="c1" colnum="1"/>
+                    <colspec colname="c2" colnum="2"/>
+                    <colspec colname="c3" colnum="3"/>
+                    <thead>
+                        <row>
+                            <entry>参数名</entry>
+                            <entry>参数类型</entry>
+                            <entry>参数说明</entry>
+                        </row>
+                    </thead>
+                    <tbody>
+                        <row>
+                            <entry>ConnectorClassName</entry>
+                            <entry>String</entry>
+                            <entry>连接器的类名,参见 <xref
+                                    linkend="configuring-transports"/></entry>
+                        </row>
+                        <row>
+                            <entry>ConnectionParameters</entry>
+                            <entry>String</entry>
+                            <entry>传输配置参数。它的值必
须是采用
+                                
<literal>key1=val1;key2=val2;</literal>的形式。不同连接器有不同的参数。</entry>
+                        </row>
+                        <row>
+                            <entry>useLocalTx</entry>
+                            <entry>boolean</entry>
+                            
<entry>设为True,则进行本地事务优化。</entry>
+                        </row>
+                        <row>
+                            <entry>UserName</entry>
+                            <entry>String</entry>
+                            
<entry>用于创建连接时使用的用户名</entry>
+                        </row>
+                        <row>
+                            <entry>Password</entry>
+                            <entry>String</entry>
+                            <entry>用于创建连接时使用的用户密ç 
</entry>
+                        </row>
+                        <row>
+                            <entry>BackupConnectorClassName</entry>
+                            <entry>String</entry>
+                            <entry>发生故障是使用的备份传输</entry>
+                        </row>
+                        <row>
+                            <entry>BackupConnectionParameters</entry>
+                            <entry>String</entry>
+                            <entry>备份传输的配置参数</entry>
+                        </row>
+                        <row>
+                            <entry><link 
linkend="configuration.discovery-group.group-address">DiscoveryAddress</link></entry>
+                            <entry>String</entry>
+                            
<entry>服务器自动检测所使用的发现组(discovery 
group)地址</entry>
+                        </row>
+                        <row>
+                            <entry><link 
linkend="configuration.discovery-group.group-port">DiscoveryPort</link></entry>
+                            <entry>Integer</entry>
+                            <entry>检测所使用的端口号</entry>
+                        </row>
+                        <row>
+                            <entry><link 
linkend="configuration.discovery-group.refresh-timeout">DiscoveryRefreshTimeout</link></entry>
+                            <entry>Long</entry>
+                            
<entry>刷新的时间(timeout)。单位为毫秒</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.discovery-initial-wait-timeout">
+                                  DiscoveryInitialWaitTimeout
+                               </link>
+                            </entry>
+                            <entry>Long</entry>
+                            <entry>检测之前所需等待的时间</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.connection-load-balancing-policy-class-name">
+                                  ConnectionLoadBalancingPolicyClassName</link>
+                            </entry>
+                                   <entry>String</entry>
+                            <entry>负载均衡策略使用的类</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.discovery-initial-wait-timeout">
+                                  DiscoveryInitialWaitTimeout
+                               </link>
+                            </entry>
+                            <entry>Long</entry>
+                            
<entry>向服务器发送ping的周期,单位毫秒</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.connection-ttl">ConnectionTTL</link>
+                            </entry>
+                            <entry>Long</entry>
+                            <entry>连接的存活时间(TTL)</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.call-timeout">CallTimeout</link>
+                            </entry>
+                            <entry>Long</entry>
+                            <entry>每个数据包的调用超
时。单位毫秒</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.dups-ok-batch-size">DupsOKBatchSize</link>
+                            </entry>
+                            <entry>Integer</entry>
+                            <entry>Dups OK的情
况下消息批量的大小。</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.transaction-batch-size">TransactionBatchSize</link>
+                            </entry>
+                            <entry>Integer</entry>
+                            
<entry>在事务中发送消息的批量大小</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.consumer-window-size">ConsumerWindowSize</link>
+                            </entry>
+                            <entry>Integer</entry>
+                            <entry>接收者内部缓存的窗口大小</entry>
+                        </row>
+                    </tbody>
+                </tgroup>
+            </table>
+            <para>接上页..</para>
+            <informaltable frame="topbot">
+                <tgroup cols="3">
+                    <colspec colname="c1" colnum="1"/>
+                    <colspec colname="c2" colnum="2"/>
+                    <colspec colname="c3" colnum="3"/>
+                    <tbody>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.consumer-max-rate">ConsumerMaxRate</link>
+                            </entry>
+                            <entry>Integer</entry>
+                            <entry>接收者接收消息的最大速度</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.confirmation-window-size">ConfirmationWindowSize</link>
+                            </entry>
+                            <entry>Integer</entry>
+                            <entry>用于确认的窗口大小</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.producer-max-rate">ProducerMaxRate</link>
+                            </entry>
+                            <entry>Integer</entry>
+                            <entry>发送者发送消息的最大速度</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.min-large-message-size">MinLargeMessageSize</link>
+                            </entry>
+                            <entry>Integer</entry>
+                            
<entry>大消息的最小数值,单位字节。</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.block-on-acknowledge">BlockOnAcknowledge</link>
+                            </entry>
+                            <entry>Boolean</entry>
+                            
<entry>如果为true,表示以阻塞方法发送消息通知。</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.block-on-non-durable-send">BlockOnNonDurableSend</link>
+                            </entry>
+                            <entry>Boolean</entry>
+                            
<entry>如果为true,表示以阻塞方式发送非持久消息</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.block-on-durable-send">BlockOnDurableSend</link>
+                            </entry>
+                            <entry>Boolean</entry>
+                            
<entry>如果为true,表示以阻塞方式发送持久消息</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.auto-group">AutoGroup</link>
+                            </entry>
+                            <entry>Boolean</entry>
+                            
<entry>如果为true,表示自动消息分组</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.pre-acknowledge">PreAcknowledge</link>
+                            </entry>
+                            <entry>Boolean</entry>
+                            <entry>决定是否进行消息的预å…
ˆé€šçŸ¥ï¼ˆpre-acknowledge)。</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.reconnect-attempts">ReconnectAttempts</link>
+                            </entry>
+                            <entry>Integer</entry>
+                            <entry>连接重试的次数,默认为 -1</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.retry-interval">RetryInterval</link>
+                            </entry>
+                            <entry>Long</entry>
+                            <entry>每次连接重试前等待
的时间,单位毫秒。</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.retry-interval-multiplier">RetryIntervalMultiplier</link>
+                            </entry>
+                            <entry>Double</entry>
+                            <entry>用于计算重试间隔</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.failover-on-server-shutdown">FailoverOnServerShutdown</link>
+                            </entry>
+                            <entry>Boolean</entry>
+                            <entry>如果设为true表示尝试连接å…
¶å®ƒçš„服务器</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.client-id">ClientID</link>
+                            </entry>
+                            <entry>String</entry>
+                            <entry>连接的客户端ID</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.client-failure-check-period">ClientFailureCheckPeriod</link>
+                            </entry>
+                            <entry>Long</entry>
+                            <entry>客户端如果在这个时间内
没有收到服务器数据包,将认为连接出现故障。</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.use-global-pools">UseGlobalPools</link>
+                            </entry>
+                            <entry>Boolean</entry>
+                            <entry>是否使用全局线程池</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.scheduled-thread-pool-max-size">ScheduledThreadPoolMaxSize</link>
+                            </entry>
+                            <entry>Integer</entry>
+                            <entry><emphasis>可计划线程池
</emphasis>的最大线程数</entry>
+                        </row>
+                        <row>
+                            <entry>
+                               <link 
linkend="configuration.connection-factory.thread-pool-max-size">ThreadPoolMaxSize</link>
+                            </entry>
+                            <entry>Integer</entry>
+                            <entry>线程池的大小</entry>
+                        </row>
+                        <row>
+                            <entry>SetupAttempts</entry>
+                            <entry>Integer</entry>
+                            
<entry>尝试建立JMS连接的次数(默认值是10。-1表示无
限次进行尝试)。有时MDB在部署时相å…
³çš„JMS资源还没有准备好,这时通过多次的
+                   尝试直到JMS资源连接上为止。只适用于å†
…部(Inbound)连接的情况。</entry>
+                        </row>
+                        <row>
+                            <entry>SetupInterval</entry>
+                            <entry>Long</entry>
+                            
<entry>每两次相邻尝试之间的时间间隔,以毫秒为单位(默认值为2000毫秒)。只适用于å†
…部(Inbound)连接的情况。</entry>
+                        </row>
+                    </tbody>
+                </tgroup>
+            </informaltable>
+        </section>
+        <section>
+            <title>适配器外部(outbound)配置</title>
+            <para>外部配置参数应该保持不变。这是因
为它所定义的连接工厂要被Java 
EE的模块所使用。这些连接工厂
+                可以定义在名字样式为<literal>*-ds.xml</literal>的é…
ç½®æ–‡ä»¶ä¸­ã€‚在JBoss的部署目录
+                <literal>hornetq.sar</literal>下有一个默认的é…
ç½®æ–‡ä»¶<literal>jms-ds.xml</literal>。
+                在这个文件中的连接工厂的配置从主要的é…
ç½®æ–‡ä»¶<literal>ra.xml</literal>中继承,
+                
但是可以在这里重新定义。下面的例子中给出了重新定义的方法。</para>
+            <note>
+            <para>请注意这里的é…
ç½®åªé€‚用于在JBoss应用服务器中安装的HornetQ。如果要在å…
¶å®ƒJEE应用服务器中
+                使用并配置HornetQ,请参ç…
§ç›¸åº”的应用服务器手册。</para>
+            </note>
+            <programlisting>&lt;tx-connection-factory>
+      &lt;jndi-name>RemoteJmsXA&lt;/jndi-name>
+      &lt;xa-transaction/>
+      &lt;rar-name>jms-ra.rar&lt;/rar-name>
+      &lt;connection-definition>org.hornetq.ra.HornetQRAConnectionFactory
+&lt;/connection-definition>
+      &lt;config-property name="SessionDefaultType" 
type="String">javax.jms.Topic
+      &lt;/config-property>
+      &lt;config-property name="ConnectorClassName" type="String">
+        org.hornetq.core.remoting.impl.netty.NettyConnectorFactory
+      &lt;/config-property>
+      &lt;config-property name="ConnectionParameters" type="String">
+          port=5445&lt;/config-property>
+      &lt;max-pool-size>20&lt;/max-pool-size>
+&lt;/tx-connection-factory></programlisting>
+            
<para>上面的例子中的连接工厂绑定到JNDI名字<literal>RemoteJmsXA</literal>。EJB和MDB可以用
+                下面的方法来得到它:</para>
+            <programlisting>@Resource(mappedName="java:RemoteJmsXA")
+private ConnectionFactory connectionFactory;</programlisting>
+            
<para><literal>config-property</literal>覆盖了<literal>ra.xml</literal>文件中的é
…ç½®ã€‚
+                以此类推,其它有å…
³è¿žæŽ¥å·¥åŽ‚的参数也可以在此覆盖。</para>
+            <para>除了全局的配置参数外,外部的é…
ç½®è¿˜å®šä¹‰äº†å…¶å®ƒä¸€äº›å‚数。</para>
+
+            <table frame="topbot" border="2">
+                <title>外部配置参数</title>
+                <tgroup cols="3">
+                    <colspec colname="c1" colnum="1"/>
+                    <colspec colname="c2" colnum="2"/>
+                    <colspec colname="c3" colnum="3"/>
+                    <thead>
+                        <row>
+                            <entry>参数名</entry>
+                            <entry>参数类型</entry>
+                            <entry>说明</entry>
+                        </row>
+                    </thead>
+                    <tbody>
+                        <row>
+                            <entry>SessionDefaultType</entry>
+                            <entry>String</entry>
+                            <entry>默认的会话类型</entry>
+                        </row>
+                        <row>
+                            <entry>UseTryLock</entry>
+                            <entry>Integer</entry>
+                            <entry>在规定的秒数内
获得锁。如果不想使用这个功能,将它设为0或负数</entry>
+                        </row>
+                     </tbody>
+                  </tgroup>
+               </table>
+        </section>
+        <section>
+            <title>适配器内部(inbound)配置</title>
+            <para>内部é…
ç½®å‚数也应该保持不变。它们控制向MDB转发消息的各种属性。通过在MDB上添åŠ
 ç›¸åº”的激活配置
+                (activation 
configuration)可以覆盖这些参数的值。它可以用来é…
ç½®ä¸€ä¸ªMDB从另外一个服务器
+                接收消息。</para>
+                <para>除了全局的配置参数外,内部的é…
ç½®è¿˜å®šä¹‰äº†å…¶å®ƒä¸€äº›å‚数。</para>
+
+                <table frame="topbot" border="2">
+                    <title>Inbound Configuration Properties</title>
+                    <tgroup cols="3">
+                        <colspec colname="c1" colnum="1"/>
+                        <colspec colname="c2" colnum="2"/>
+                        <colspec colname="c3" colnum="3"/>
+                        <thead>
+                            <row>
+                            <entry>参数名</entry>
+                            <entry>参数类型</entry>
+                            <entry>说明</entry>
+                            </row>
+                        </thead>
+                        <tbody>
+                            <row>
+                                <entry>Destination</entry>
+                                <entry>String</entry>
+                                <entry>目标的JNDI名字</entry>
+                            </row>
+                            <row>
+                                <entry>DestinationType</entry>
+                                <entry>String</entry>
+                                <entry>目æ 
‡çš„类型,<literal>javax.jms.Queue</literal>或者
<literal>javax.jms.Topic</literal>
+                                 (默认是javax.jms.Queue)</entry>
+                            </row>
+                            <row>
+                                <entry>AcknowledgeMode</entry>
+                                <entry>String</entry>
+                                
<entry>通知模式,<literal>Auto-acknowledge</literal> 或 
<literal>Dups-ok-acknowledge</literal>
+                                (默认值是Auto-acknowledge). 
<literal>AUTO_ACKNOWLEDGE</literal>和<literal>DUPS_OK_ACKNOWLEDGE</literal>也是有效值</entry>
+                            </row>
+                            <row>
+                                <entry>MaxSession</entry>
+                                <entry>Integer</entry>
+                                <entry>内部é…
ç½®åˆ›å»ºçš„最大会话数(默认是5)</entry>
+                            </row>
+                            <row>
+                                <entry>MessageSelector</entry>
+                                <entry>String</entry>
+                                <entry>接收者的消息选择器</entry>
+                            </row>
+                            <row>
+                                <entry>SubscriptionDurability</entry>
+                                <entry>String</entry>
+                                <entry>订阅
的类型,<literal>Durable</literal>或者
<literal>NonDurable</literal></entry>
+                            </row>
+                            <row>
+                                <entry>SubscriptionName</entry>
+                                <entry>String</entry>
+                                <entry>订阅的名字</entry>
+                            </row>
+                            <row>
+                                <entry>TransactionTimeout</entry>
+                                <entry>Long</entry>
+                                <entry>事务超
时(毫秒,默认是0,表示事务不会超时)</entry>
+                            </row>
+                            <row>
+                                <entry>UseJNDI</entry>
+                                <entry>Boolean</entry>
+                                <entry>是否使用JNDI来查找目æ 
‡ï¼ˆé»˜è®¤æ˜¯true)</entry>
+                            </row>
+                         </tbody>
+                      </tgroup>
+                   </table>
+        </section>
+       <section>
+          <title>配置适配器访问单独的HornetQ服务器</title>
+          <para>在有的情
况下,消息服务器与应用服务器运行在不同的机器上。这时客户端只需要安è£
…HornetQ的客户端的库文件。本节给出了具体的é…
ç½®å’Œæ‰€éœ€è¦çš„jar文件。</para>
+          <section>
+          <para>你需要配置两个配置文件。一个是MDB所用的内
部适配器,另一个是可以创建外部连接的外部适配器。</para>
+          <section>
+                <title>配置内部适配器</title>
+                <para>首å…
ˆåœ¨<literal>deploy</literal>目录下创建一个以.rar为结尾的文件夹。
+                      在这里我们将å…
¶å‘½åä¸º<literal>hornetq-ra.rar</literal>。主注意这一点很重要,因
为MDB和外部配置都需要引用
+                      该文件夹的名字。
+                </para>
+                <note>
+                   
<para>在JBoss中该文件夹的默认名为<literal>jms-ra.rar</literal>。你
可以直接使用这个名字。但是你可能需要避免
+                      与其它的通用适配器相冲突。
+                   </para>
+                </note>
+                <para>在文件夹
+                   <literal>hornetq-ra.rar</literal>
+                   下创建名为
+                   <literal>META-INF</literal>
+                   的文件夹,然后在些文件夹内创建一个
+                   <literal>ra.xml</literal>配置文件。在HornetQ发布包
中
+                   有一个<literal>ra.xml</literal>模板文件供你
使用。
+                </para>
+                <para>要配置MDB接收远程HornetQ服务器的消息,你
需要修改<literal>deploy/hornet-ra.rar/META-INF</literal>下面的
+                   <literal>ra.xml</literal>文件,将传
输层改为netty连接器(不要使用invm连接器)及å…
¶ç›¸åº”的参数。下面
+                   是一个配置的例子:
+                </para>
+
+          <programlisting>
+            
&lt;resourceadapter-class&gt;org.hornetq.ra.HornetQResourceAdapter&lt;/resourceadapter-class&gt;
+              &lt;config-property&gt;
+                 &lt;description&gt;The transport type&lt;/description&gt;
+                 
&lt;config-property-name&gt;ConnectorClassName&lt;/config-property-name&gt;
+                 
&lt;config-property-type&gt;java.lang.String&lt;/config-property-type&gt;
+                 
&lt;config-property-value&gt;org.hornetq.core.remoting.impl.netty.NettyConnectorFactory&lt;/config-property-value&gt;
+              &lt;/config-property&gt;
+              &lt;config-property&gt;
+                 &lt;description&gt;The transport configuration. These values 
must be in the form of key=val;key=val;&lt;/description&gt;
+                 
&lt;config-property-name&gt;ConnectionParameters&lt;/config-property-name&gt;
+                 
&lt;config-property-type&gt;java.lang.String&lt;/config-property-type&gt;
+                 
&lt;config-property-value&gt;host=127.0.0.1;port=5446&lt;/config-property-value&gt;
+              &lt;/config-property>
+          </programlisting>
+          <para>上面的配置中,适é…
å™¨è¿žæŽ¥åˆ°ä¸€ä¸ªè¿è¡Œåœ¨æœ¬æœºä¸Šç«¯å£ä¸º5446的服务器。</para>
+          </section>
+
+          <section>
+             <title>配置外部适配器</title>
+                <para>ä½ 
还需要创建一个<literal>hornetq-ds.xml</literal>文件来é…
ç½®å¤–部连接。该文件需要放置在<literal>deploy</literal>
+                   下的任意一个文件夹中。在一相标准的安装
中这个文件夹是<literal>horneq</literal> 或者 
<literal>hornetq.sar</literal>。
+                   当然你可以选择å…
¶å®ƒæ–‡ä»¶å¤¹ã€‚该文件的名字只要是以<literal>-ds.xml</literal>即可。在HornetQ的发布åŒ
…中包含有一个模板文件,
+                   
它的名字是<literal>jms-ds.xml</literal>,位置就在config文件夹下。
+                </para>
+          <para>下面是一个配置的例子。</para>
+          <programlisting>
+             &lt;tx-connection-factory&gt;
+              &lt;jndi-name&gt;RemoteJmsXA&lt;/jndi-name&gt;
+              &lt;xa-transaction/&gt;
+              &lt;rar-name&gt;hornetq-ra.rar&lt;/rar-name&gt;
+              
&lt;connection-definition&gt;org.hornetq.ra.HornetQRAConnectionFactory&lt;/connection-definition&gt;
+              &lt;config-property name="SessionDefaultType" 
type="java.lang.String"&gt;javax.jms.Topic&lt;/config-property&gt;
+              &lt;config-property name="ConnectorClassName" 
type="java.lang.String"&gt;org.hornetq.core.remoting.impl.netty.NettyConnectorFactory&lt;/config-property&gt;
+              &lt;config-property name="ConnectionParameters" 
type="java.lang.String"&gt;host=127.0.0.1;port=5446&lt;/config-property&gt;
+              &lt;max-pool-size&gt;20&lt;/max-pool-size&gt;
+           &lt;/tx-connection-factory&gt;
+          </programlisting>
+          <para>这个配置同æ 
·æ˜¯è¿žæŽ¥åˆ°è¿è¡Œåœ¨æœ¬æœºä¸Šçš„端口为5446的HornetQ服务器。JEE模块可以通过JNDI查找
+                
<literal>java:/RemoteJmsXA</literal>(由<literal>jndi-name</literal>参数定义)。如上节所述,
+                资源适配器根据文件夹下的é…
ç½®æ¥åˆ›å»ºå¤–部连接。</para>
+             <section>
+                <title>依赖的jar文件</title>
+                
<para>下面列出了HornetQ所需要的第三方jar文件</para>
+                <table frame="topbot" border="2">
+                    <title>Jar文件</title>
+                    <tgroup cols="3">
+                        <colspec colname="c1" colnum="1"/>
+                        <colspec colname="c2" colnum="2"/>
+                        <colspec colname="c3" colnum="3"/>
+                        <thead>
+                            <row>
+                                <entry>Jar文件名</entry>
+                                <entry>说明</entry>
+                                <entry>位置</entry>
+                            </row>
+                        </thead>
+                        <tbody>
+                            <row>
+                                <entry>hornetq-ra.jar</entry>
+                                <entry>HornetQ资源适配器文件</entry>
+                                
<entry>deploy/hornetq-ra.rar或相应的位置</entry>
+                            </row>
+                            <row>
+                                <entry>hornetq-core-client.jar</entry>
+                                <entry>HornetQ核心客户类库</entry>
+                                <entry>在JBoss的default/lib下或者
是$JBOSS_HOME/common/lib下。 </entry>
+                            </row>
+                            <row>
+                                <entry>hornetq-jms-client.jar</entry>
+                                <entry>HornetQ的JMS类</entry>
+                                <entry>同上</entry>
+                            </row>
+                            <row>
+                                <entry>netty.jar</entry>
+                                <entry>Netty类库</entry>
+                                <entry>同上</entry>
+                            </row>
+                        </tbody>
+                     </tgroup>
+                </table>
+             </section>
+          </section>
+       </section>
+    </section>
+    <section>
+        <title>高可获得性JNDI (HA-JNDI)</title>
+        
<para>采用JNDI来查找JMS对象时(队列,话题及连接工厂),使用HA-JNDI可以增åŠ
 å®¹é”™çš„能力。即当你正在使用
+            的JNDI服务器发生故
障时,客户端可以使用集群中的å…
¶å®ƒJNDI服务器继续工作。</para>
+        
<para>HA-JNDI是JBoss应用服务器的一项服务,它为客户端提供JNDI服务,客户端æ—
 éœ€çŸ¥é“JNDI具体服务器的连接
+            
细节。这个服务只有在集群的JBoss应用服务器上才可使用。</para>
+        <para>要使用HA-JNDI,需要使用下面的JNDI参数。</para>
+        <programlisting>Hashtable&lt;String, String> jndiParameters = new 
Hashtable&lt;String, String>();
+jndiParameters.put("java.naming.factory.initial", 
+    "org.jnp.interfaces.NamingContextFactory");
+jndiParameters.put("java.naming.factory.url.pkgs=", 
+    "org.jboss.naming:org.jnp.interfaces");
+
+initialContext = new InitialContext(jndiParameters);</programlisting>
+        <para>有关HA-JNDI更多的信息请参见<ulink
+                
url="http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Clustering_Guide/5/html/clustering-jndi.html";
+                >JBoss应用服务器集群文档</ulink>。</para>
+    </section>
+    <section id="xa-recovery">
+        <title>XA恢复</title>
+        
<para><emphasis>XA恢复</emphasis>解决的是事务在系统或应用出现故
障时的处理。它可以保证在应用进程或主机出现故障
+            或网络崩溃等情况下,事务内
所有资源的状态的一致性。有关XA恢复的更多信息请见 <ulink
+                
url="http://www.jboss.org/community/wiki/JBossTransactions";>JBoss
+                事务</ulink>。</para>
+        
<para>当HornetQ与JBoss应用服务器集成时,它可以利用JBoss的事务处理来对消息资源进行恢复。如果消息处理åŒ
…括
+            在一个XA事务中,如果服务器出现故
障并重启时,恢复管理器将负责恢复事务,这样å…
¶ä¸­çš„消息要么被提交,要么被回滚(取
+            决于事务的处理决定)。</para>
+        <section>
+            <title>XA恢复的配置</title>
+            <para>要想HornetQ具有XA恢复功能,则必须é…
ç½®æ¢å¤ç®¡ç†å™¨è¿žæŽ¥åˆ°HornetQ并恢复其资源。下面的参数必
须要加到
+                
<literal>conf/jbossts-properties.xml</literal>文件中的<literal>jta</literal>部分:</para>
+            <programlisting>
+&lt;properties depends="arjuna" name="jta"&gt;
+   ...
+                     
+   &lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.HornetQ1"
+                
value="org.hornetq.jms.server.recovery.HornetQXAResourceRecovery;[连接é…
ç½®]"/&gt;
+&lt;/properties&gt;
+            </programlisting>
+            <para>其中<literal>[连接配置]</literal>包
括连接HornetQ节点所必需的信息。
+                它的格式是<literal>[连接工厂类名],[用户名], 
[密码], [连接参数]</literal>。 </para>
+            <itemizedlist>
+                <listitem>
+                    
<para><literal>[连接工厂类名]</literal>指的是<literal>ConnectorFactory</literal>
+                        的类名,用来连接HornetQ服务器。å…
¶å€¼å¯ä»¥æ˜¯<literal
+                            
>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</literal> 或
+                            <literal
+                            
>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</literal></para>
+                </listitem>
+                <listitem>
+                    
<para><literal>[用户名]</literal>是用于创建客户会话的用户名。是可选项。</para>
+                </listitem>
+                <listitem>
+                    <para><literal>[密ç 
]</literal>是创建客户会话时所用的密ç 
ã€‚只有在用户名存在时需要。</para>
+                </listitem>
+                <listitem>
+                    <para><literal>[连接参数]</literal> 
是用逗号分隔的一串键-值对。它们会传递给连接器工厂
+                        (参见 <xref 
linkend="configuring-transports"/>)。</para>
+                </listitem>
+            </itemizedlist>
+            <note>
+                <para>HornetQ必
须有一个与<literal>conf/jbossts-properties.xml</literal>中定义的连接器相对应的接受器(acceptor)。</para>
+            </note>
+            <section>
+                <title>配置参数</title>
+                <para>如果HornetQé…
ç½®äº†ä¸€ä¸ªé»˜è®¤çš„in-vm接受器:</para>
+                <programlisting>
+&lt;acceptor name="in-vm">
+    
&lt;factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory&lt;/factory-class>
+&lt;/acceptor>
+                </programlisting>
+                <para>相应地在 <literal
+                        
>conf/jbossts-properties.xml</literal>文件中:</para>
+                <programlisting>
+&lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.HORNETQ1"
+   
value="org.hornetq.jms.server.recovery.HornetQXAResourceRecovery;org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"/>
                                
+                </programlisting>
+                <para>如果é…
ç½®äº†ä¸€ä¸ªnetty接受器,并且端口不是默认的:</para>
+                <programlisting>
+&lt;acceptor name="netty">
+    
&lt;factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory&lt;/factory-class>
+    &lt;param key="port" value="8888"/>
+&lt;/acceptor>
+                </programlisting>
+                <para>相应的在 <literal
+                        
>conf/jbossts-properties.xml</literal>文件中:</para>
+                <programlisting>
+&lt;property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.HORNETQ1"
+       
value="org.hornetq.jms.server.recovery.HornetQXAResourceRecovery;org.hornetq.core.remoting.impl.netty.NettyConnectorFactory,
 , , port=8888"/>                                               
+                </programlisting>
+                <note>
+                    <para>注意在没有用户名和密ç 
æ—¶ï¼Œé€—号是不能省略的。</para>
+                </note>
+                <para>如果恢复必须要求是<literal>admin, 
adminpass</literal>,则其配置
+                    应为如下所示:</para>
+                <programlisting>
+                    &lt;property 
name="com.arjuna.ats.jta.recovery.XAResourceRecovery.HORNETQ1"
+                           
value="org.hornetq.jms.server.recovery.HornetQXAResourceRecovery;org.hornetq.core.remoting.impl.netty.NettyConnectorFactory,
 admin, adminpass, port=8888"/>                                             
+                </programlisting>
+                <para>推荐在XA恢复中,将HornetQé…
ç½®ä¸€ä¸ªinvm接受器,并配置恢复管理器使用invm连接器。</para>
+            </section>
+        </section>
+        <section>
+            <title>例子</title>
+            <para>参见<xref 
linkend="xa-recovery-example"/>。这个例子展示了如何来é…
ç½®XA恢复以便在服务器崩溃后恢复消息。</para>
+        </section>
+    </section>
+  </section>
+</chapter>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/8ecd255f/docs/user-manual/zh/architecture.xml
----------------------------------------------------------------------
diff --git a/docs/user-manual/zh/architecture.xml 
b/docs/user-manual/zh/architecture.xml
new file mode 100644
index 0000000..d8d12a2
--- /dev/null
+++ b/docs/user-manual/zh/architecture.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
============================================================================= 
-->
+<!-- Copyright © 2009 Red Hat, Inc. and others.                               
     -->
+<!--                                                                           
    -->
+<!-- The text of and illustrations in this document are licensed by Red Hat 
under  -->
+<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license 
("CC-BY-SA"). -->
+<!--                                                                           
    -->
+<!-- An explanation of CC-BY-SA is available at                                
    -->
+<!--                                                                           
    -->
+<!--            http://creativecommons.org/licenses/by-sa/3.0/.                
    -->
+<!--                                                                           
    -->
+<!-- In accordance with CC-BY-SA, if you distribute this document or an 
adaptation -->
+<!-- of it, you must provide the URL for the original version.                 
    -->
+<!--                                                                           
    -->
+<!-- Red Hat, as the licensor of this document, waives the right to enforce,   
    -->
+<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent    
    -->
+<!-- permitted by applicable law.                                              
    -->
+<!-- 
============================================================================= 
-->
+<chapter id="architecture">
+    <title>总体架构</title>
+    <para>本章对HornetQ的总体技术架构进行了概括描述。</para>
+    <section>
+        <title>核心架构</title>
+        <para>HornetQ的æ 
¸å¿ƒæ˜¯ç”±ä¸€ç»„简单Java对象(POJO)构成的。同时在设计HornetQ时将对外部jaråŒ
…的依赖降到最低限度。
+              实际上HornetQ的æ 
¸å¿ƒéƒ¨åˆ†åªæœ‰ä¸€ä¸ªå¤–部依赖,就是netty.jar。HornetQ使用了å…
¶ä¸­çš„用于缓冲的一些类。
+              我们相信这样的理念应该受到用户的欢迎。</para>
+        <para>由于依赖性很小,HornetQ可以非常容易地嵌入到å…
¶å®ƒåº”用中,或者加入到一些依赖注入式的框架中,
+              如JBoss Microcontainer,Spring或Google Guice。</para>
+        <para>每个HornetQ服务器都有自己的超高性能的持久
日志(journal)用于消息和其它信息的持久化。</para>
+        
<para>采用这种独特的高效日志要比采用普通数据库作为持久
层的系统拥有更高的性能。</para>
+        <para>通常情
况下分布在不同物理机器上的客户端同时访问HornetQ服务器。目前HornetQ提供了两套API供客户端使用:</para>
+        <para>
+            <orderedlist>
+                <listitem>
+                    <para>æ 
¸å¿ƒAPI。这是一组普通的Java接口,用它可以访问HornetQ的å…
¨éƒ¨åŠŸèƒ½ã€‚</para>
+                </listitem>
+                <listitem>
+                    <para>JMS客户端API。这是标准的JMS API。</para>
+                </listitem>
+            </orderedlist>
+        </para>
+        <para>实际上JMS API是在核心API的外部加
上一层简单的封装。</para>
+        <para>在HornetQ内核是没有JMS的,这æ 
·è®¾è®¡çš„目的是为了支持多个协议。</para>
+        
<para>当客户端通过JMS接口访问HornetQ时,所有JMS的操作都被转换成相应的æ
 ¸å¿ƒAPI,然后将请求以HornetQ格式发向服务器。</para>
+        <para>HornetQ服务器只接收核心API的访问。</para>
+        <para>图3.1描述了这些操作。</para>
+        <para>
+            <graphic fileref="images/architecture1.jpg" align="center"/>
+        </para>
+        
<para>在图3.1中示出了两个用户访问HornetQ服务器。用户1使用JMS
 API,用户2使用的是核心API。</para>
+        <para>图中清楚的展示出了JMS是如何通过封装
(facade)转化为核心API的。</para>
+    </section>
+    <section>
+        <title>将HornetQ嵌入到你的应用程序中</title>
+        <para>如果你的应用程序内部需要消息服务,但同时你
又不想将消息服务暴露为单独的HornetQ服务器,你
可以在应用中直接将HornetQ实例化。</para>
+        <para>有关嵌入式HornetQ的详细信息请参阅 <xref 
linkend="embedding-hornetq"
+            />。</para>
+    </section>
+    <section>
+        <title>将HornetQ与JEE应用服务器集成</title>
+        <para>HornetQ提供了标准的JCA适é…
å™¨ï¼Œåˆ©ç”¨å®ƒå¯ä»¥å°†HornetQ轻松地集成到任何一个符合JEE规范的应用服务器或servlet容器中。</para>
+        
<para>JEE应用服务品提供了消息Bean(MDB)用于处理来自外部的消息,比如来自JMS系统或邮件系统的消息。</para>
+        
<para>最常见的应用应该是用MDB来接收来自JMS系统中的消息了。在JEE规范中规定了JEE应用服务器使用JCA
 adaptor与JMS消息系统集成,
+              MDB通过这个adaptor来接收消息。</para>
+        <para>JCA adaptor不仅
可以用来接收消息,还可以用来从EJB或servlet中向外部的JMS发送消息。在JEE应用服务器中应该用JCA
 adaptor与JMS系统进行交互。
+              实际上JEE规范中不å…
è®¸åœ¨JEE服务器中不通过JCA而直接访问JMS系统。</para>
+        <para>在EJB中使用消息往往需要连接池
或交易,而JCA可以提供这方面的服务,无
需额外的开发任务。当然直接访问JMS系统是可能的,
+              但是你
将不能利用JCA所提供的这些有用的功能,因
此我们不建议使用直接访问的方式。</para>
+        <para>图3.2给出了HornetQ通过JCA 
adaptor与JEE应用服务器集成的示意图。图中可以看出所有的交互都通过JCA
 adaptor。</para>
+        
<para>图中带有禁止符号的箭头表明的是从EJB会话Bean直接访问HornetQ的æƒ
…况。由于不通过JCA,这种方法往往造
成每次EJB访问HornetQ都要新建一个连接和会话,
+              
使效率大降低。这被视为反设计模式(anti-pattern)。</para>
+        <para>
+            <graphic fileref="images/architecture2.jpg"/>
+        </para>
+        <para><xref 
linkend="appserver-integration"/>对如何使用JCA给出了更加
详细的描述。</para>
+    </section>
+    <section>
+        <title>HornetQ作为独立的服务(standalone)</title>
+        
<para>HornetQ可以部署成为独立的服务器。它可运行于任何JEE应用服务器之外,作为一个独立的服务运行。
+              作为独立服务器运行时,HornetQ消息服务器包
括一个核心服务器,一个JMS服务以及一个JNDI服务。</para>
+        
<para>JMS服务用来部署服务器端<literal>hornetq-jms.xml</literal>é…
ç½®æ–‡ä»¶ä¸­çš„JMS Queue,Topic和ConnectionFactory实例。
+              
此外它还提供一组简单的管理接口,通过这些接口可以创建、消毁(destroy)Queue,Topic和ConnectionFactory实例。
+              
用于可以通过JMX或连接使用这些接口。JMS服务是单独的服务,它不是HornetQæ
 ¸å¿ƒæœåŠ¡ã€‚HornetQ的核心不包含JMS相关的服务。
+              如果你不需要通过服务器端的xmlé…
ç½®æ–‡ä»¶éƒ¨ç½²ä»»ä½•JMS对象,也不需要JMS的管理接口,你
可以选择不启动该服务。</para>
+        <para>启动JNDI服务的目的是因
为JMS需要通过JNDI来获得Queue,Topic以及ConnectionFactory。如果不需要,也可以选择不启动该服务。</para>
+        <para>HornetQå…
è®¸åœ¨å®¢æˆ·ç«¯ç¨‹åºä¸­é€šè¿‡ç¼–程来直接创建各种JMS对象和æ 
¸å¿ƒå¯¹è±¡æ¥ä»£æ›¿JNDI查找,所以JNDI不是必需的。
+              HornetQ采用JBoss 
Microcontainer来引导并实例化服务,并保证模块之间的依赖å…
³ç³»ã€‚JBoss 
Microcontainer是一个轻量级的POJO引导器(bootstrapper)。</para>
+        <para>图3.3给出了HornetQ独立服务器的架构。</para>
+        <para>
+            <graphic fileref="images/architecture3.jpg"/>
+        </para>
+        <para>相关配置的相关信息可以在第<xref
+                linkend="server.configuration"/>找到。$ </para>
+    </section>
+</chapter>

Reply via email to