[jboss-cvs] JBoss Messaging SVN: r2747 - in trunk: docs/examples and 18 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jun 1 05:16:19 EDT 2007


Author: timfox
Date: 2007-06-01 05:16:18 -0400 (Fri, 01 Jun 2007)
New Revision: 2747

Added:
   trunk/docs/examples/bridge/
   trunk/docs/examples/bridge/README.html
   trunk/docs/examples/bridge/build.xml
   trunk/docs/examples/bridge/etc/
   trunk/docs/examples/bridge/etc/jndi.properties
   trunk/docs/examples/bridge/etc/log4j.xml
   trunk/docs/examples/bridge/etc/test-bridge-service.xml
   trunk/docs/examples/bridge/src/
   trunk/docs/examples/bridge/src/org/
   trunk/docs/examples/bridge/src/org/jboss/
   trunk/docs/examples/bridge/src/org/jboss/example/
   trunk/docs/examples/bridge/src/org/jboss/example/jms/
   trunk/docs/examples/bridge/src/org/jboss/example/jms/bridge/
   trunk/docs/examples/bridge/src/org/jboss/example/jms/bridge/BridgeExample.java
Removed:
   trunk/docs/userguide/en/modules/performance.xml
Modified:
   trunk/.classpath
   trunk/build-messaging.xml
   trunk/docs/userguide/en/master.xml
   trunk/docs/userguide/en/modules/about.xml
   trunk/docs/userguide/en/modules/c_configuration.xml
   trunk/docs/userguide/en/modules/c_overview.xml
   trunk/docs/userguide/en/modules/configuration.xml
   trunk/docs/userguide/en/modules/gettingstarted.xml
   trunk/docs/userguide/en/modules/installation.xml
   trunk/docs/userguide/en/modules/introduction.xml
   trunk/docs/userguide/en/modules/runningexamples.xml
   trunk/src/etc/server/default/deploy/messaging-service.xml
   trunk/src/etc/xmdesc/Bridge-xmbean.xml
   trunk/src/main/org/jboss/jms/server/ServerPeer.java
   trunk/src/main/org/jboss/jms/server/bridge/BridgeMBean.java
   trunk/src/main/org/jboss/jms/server/bridge/BridgeService.java
   trunk/tests/src/org/jboss/test/messaging/jms/bridge/BridgeMBeanTest.java
   trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java
Log:
Tweaks to bridge, bridge example and some changes to docs


Modified: trunk/.classpath
===================================================================
--- trunk/.classpath	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/.classpath	2007-06-01 09:16:18 UTC (rev 2747)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="docs/examples/queue-failover/src"/>
+	<classpathentry kind="src" path="docs/examples/bridge/src"/>
 	<classpathentry kind="src" path="docs/examples/stateless-clustered/src"/>
 	<classpathentry kind="src" path="docs/examples/web-service/src-client"/>
 	<classpathentry kind="src" path="docs/examples/web-service/src"/>
@@ -60,5 +61,6 @@
 	<classpathentry kind="var" path="ANT_HOME/lib/ant-junit.jar"/>
 	<classpathentry kind="lib" path="thirdparty/jboss/common/lib/jboss-common.jar"/>
 	<classpathentry kind="src" path=".apt_generated"/>
+	<classpathentry kind="lib" path="lib/jboss-j2se.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Modified: trunk/build-messaging.xml
===================================================================
--- trunk/build-messaging.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/build-messaging.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -46,12 +46,12 @@
    -->
 
    <property name="messaging.version.major" value="1"/>
-   <property name="messaging.version.minor" value="2"/>
+   <property name="messaging.version.minor" value="3"/>
    <property name="messaging.version.revision" value="0"/>
-   <property name="messaging.version.incrementing" value="14"/>
-   <property name="messaging.version.tag" value="SP2"/>
-   <property name="messaging.version.name" value="Cheesecake"/>
-   <property name="messaging.version.cvstag" value="JBossMessaging_1_2_0_SP2"/>
+   <property name="messaging.version.incrementing" value="15"/>
+   <property name="messaging.version.tag" value="GA"/>
+   <property name="messaging.version.name" value="Cheese sandwich"/>
+   <property name="messaging.version.cvstag" value="JBossMessaging_1_3_0_GA"/>
    <property name="module.name" value="messaging"/>
    <property name="module.Name" value="JBoss Messaging"/>
    <property name="module.version" value="${messaging.version.major}.${messaging.version.minor}.${messaging.version.revision}.${messaging.version.tag}"/>

Added: trunk/docs/examples/bridge/README.html
===================================================================
--- trunk/docs/examples/bridge/README.html	                        (rev 0)
+++ trunk/docs/examples/bridge/README.html	2007-06-01 09:16:18 UTC (rev 2747)
@@ -0,0 +1,141 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+  <title>JBoss Messaging Example - JMS Bridge</title>
+</head>
+<body>
+<br>
+<h1>JBoss Messaging Bridge Example</h1>
+$Revision: 2310 $
+<h2>Overview</h2>
+<br>
+This example deploys a message bridge in JBAS, which is configured to 
+move messages from one destination to another.
+<br>
+The example then sends some message to the source destination, then consumes the
+same messages from the target destionation, demonstrating that the bridge has
+successfully moved the messages from the source to the target
+<br>
+The example is somewhat artificial in that normally a bridge would be used to move messages
+from source and target destinations on different servers, but it serves to illustrate how to 
+use a bridge
+<br>
+This example relies on having access to a running JBoss Messaging
+instance.
+The JBoss Messaging instance must be installed and started according to
+the
+"Installation" paragraph from the release documentation. However, the
+example will automatically deploy its own queues, unless queues with
+the same name is already deployed. <br>
+<span style="font-style: italic;"></span>
+<h2>Running the example</h2>
+1. Set up the JBOSS_HOME environment variable to point to the JBoss
+instance you deployed JBoss Messaging into. For example, if you
+deployed JBoss Messaging in <span style="font-family: monospace;">C:\jboss-4.0.3SP1\server\messaging\deploy,</span>
+then your JBOSS_HOME value should be <span
+ style="font-family: monospace;">C:\</span><span
+ style="font-family: monospace;">jboss-4.0.3SP1</span><br>
+<span style="font-family: monospace;"></span><span
+ style="font-family: monospace;"></span><br>
+2. Go to the example's home directory<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">cd
+...\examples\queue</span><br>
+</div>
+<br>
+3. Run the example:<br>
+<br>
+<div style="margin-left: 40px;"><span style="font-family: monospace;">ant</span>
+<br>
+<br>
+<br>
+</div>
+The output of a successful run should be similar to:<br>
+<div style="margin-left: 40px;"><br>
+</div>
+<table
+ style="width: 90%; text-align: left; font-family: monospace; background-color: rgb(204, 204, 204); margin-left: 40px;"
+ border="1" cellpadding="2" cellspacing="2">
+  <tbody>
+    <tr>
+      <td style="vertical-align: top;">
+      <div style="margin-left: 40px;"><br>
+      </div>
+$ ant<br>
+Buildfile: build.xml<br>
+      <br>
+identify:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+X&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Running the QUEUE
+example&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+X<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo]
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [echo] The queue: testQueue<br>
+      <br>
+sanity-check:<br>
+      <br>
+init:<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\queue\output<br>
+&nbsp;&nbsp;&nbsp; [mkdir] Created dir:
+C:\work\src\cvs\jboss-head\jms\docs\examples\common\output<br>
+      <br>
+compile:<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 2 source files to
+C:\work\src\cvs\jboss-head\jms\docs\examples\common\output<br>
+&nbsp;&nbsp;&nbsp; [javac] Compiling 1 source file to
+C:\work\src\cvs\jboss-head\jms\docs\examples\queue\output<br>
+      <br>
+run:<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Queue /queue/testQueue exists<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The message was successfully sent to
+the testQueue queue<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] Received message: Hello!<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] The example connected to JBoss
+Messaging version 1.0.1.GA (1.0)<br>
+      <br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] ###&nbsp;&nbsp;&nbsp;
+SUCCESS!&nbsp;&nbsp; ###<br>
+&nbsp;&nbsp;&nbsp;&nbsp; [java] #####################<br>
+      <br>
+BUILD SUCCESSFUL<br>
+Total time: 5 seconds<br>
+      <br>
+      <br>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<div style="margin-left: 40px;"><br>
+</div>
+<br>
+<br>
+<h2>Troublesooting</h2>
+<h3>1. I get <span style="font-family: monospace;">"javax.jms.JMSSecurityException:
+User null is NOT authenticated" <br>
+</span></h3>
+You probably didn't install JBoss Messaging correctly. A fresh JBoss
+Messaging installation requires changes in the security configuration
+of a <span style="font-family: monospace;">default </span>JBoss
+instance, specifically a properly configured "<small><span
+ style="font-family: courier new,courier,monospace;">messaging</span></small>"
+security domain.&nbsp; Follow the instructions from the "Installation"
+paragraph of the release documentation. <br>
+<br>
+<br>
+<hr style="width: 100%; height: 2px;"><br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>

Added: trunk/docs/examples/bridge/build.xml
===================================================================
--- trunk/docs/examples/bridge/build.xml	                        (rev 0)
+++ trunk/docs/examples/bridge/build.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+   To run the example, set JBOSS_HOME and run ant (with no parameters)
+
+   $Id: build.xml 2705 2007-05-17 21:34:07Z clebert.suconic at jboss.com $
+
+ -->
+
+<project name="BridgeExample" default="run">
+
+   <property environment="ENV"/>
+
+   <!-- These properties may be overriden by calling ants when this example is used in a smoke test -->
+   <property file="../examples.properties"/>
+   <property name="messaging.client.jar.path" value="../../"/>
+   <property name="messaging.client.jar.name" value="jboss-messaging-client.jar"/>
+   <property name="jboss.home" value="${ENV.JBOSS_HOME}"/>
+   <property name="jboss.configuration" value="messaging"/>
+   <property name="example.source.queue" value="A"/>
+   <property name="example.target.queue" value="B"/>
+
+   <path id="common.compilation.classpath">
+      <fileset file="${jboss.home}/client/jboss-j2ee.jar"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </path>
+
+   <path id="example.compilation.classpath">
+      <path refid="common.compilation.classpath"/>
+      <pathelement path="../common/output/classes"/>
+   </path>
+
+   <path id="execution.classpath">
+      <pathelement path="./etc"/>
+      <pathelement path="../common/output/classes"/>
+      <pathelement path="./output/classes"/>
+      <fileset file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fileset file="${jboss.home}/client/jbossall-client.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/log4j.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/lib/javassist.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar"/>
+      <fileset file="${jboss.home}/server/${jboss.configuration}/deploy/jboss-aop-jdk50.deployer/trove.jar"/>
+   </path>
+
+   <target name="identify">
+      <echo message="###########################################################################"/>
+      <echo message="#                       Running the BRIDGE example                         #"/>
+      <echo message="###########################################################################"/>
+      <echo message="The queue:      ${example.queue.name}"/>
+      <echo message="The client jar: ${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+   </target>
+
+   <target name="sanity-check" depends="identify">
+      <available property="client.jar.present" file="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
+      <fail message="Could not find client jar ${messaging.client.jar.path}/${messaging.client.jar.name}"
+            unless="client.jar.present"/>
+   </target>
+
+   <target name="init" depends="sanity-check">
+      <mkdir dir="./output/classes"/>
+      <mkdir dir="../common/output/classes"/>
+   </target>
+
+   <target name="compile" depends="init">
+      <javac destdir="../common/output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="../common/src"/>
+         <classpath refid="common.compilation.classpath"/>
+      </javac>
+      <javac destdir="./output/classes" debug="on" debuglevel="lines,vars,source">
+         <src path="./src"/>
+         <classpath refid="example.compilation.classpath"/>
+      </javac>
+   </target>
+   
+   <target name="deploy" depends="compile">
+      <copy file="./etc/test-bridge-service.xml"
+            todir="${jboss.home}/server/${jboss.configuration}/deploy"/>
+      <antcall target="sleep"><param name="sleep.interval" value="5"/></antcall>
+   </target>
+	
+   <target name="undeploy">
+      <delete file="${jboss.home}/server/${jboss.configuration}/deploy/test-bridge-service.xml" quiet="true"/>
+   </target>
+   
+   <target name="run" depends="deploy">
+      <java classname="org.jboss.example.jms.bridge.BridgeExample"
+            classpathref="execution.classpath" fork="yes" failonerror="true">
+         <sysproperty key="example.source.queue" value="${example.source.queue}"/>
+         <sysproperty key="example.target.queue" value="${example.target.queue}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=example"/>
+         -->
+      </java>
+   	  <antcall target="undeploy"/>
+   </target>
+
+   <target name="clean" depends="undeploy">
+      <delete dir="./output" quiet="true"/>
+      <delete dir="../common/output" quiet="true"/>
+   </target>
+	
+   <target name="sleep">
+	  <echo message="Sleeping for ${sleep.interval} seconds ..."/>
+	  <sleep seconds="${sleep.interval}"/>
+   </target>
+
+</project>
+

Added: trunk/docs/examples/bridge/etc/jndi.properties
===================================================================
--- trunk/docs/examples/bridge/etc/jndi.properties	                        (rev 0)
+++ trunk/docs/examples/bridge/etc/jndi.properties	2007-06-01 09:16:18 UTC (rev 2747)
@@ -0,0 +1,4 @@
+### JBossNS properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: trunk/docs/examples/bridge/etc/log4j.xml
===================================================================
--- trunk/docs/examples/bridge/etc/log4j.xml	                        (rev 0)
+++ trunk/docs/examples/bridge/etc/log4j.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- $Id: log4j.xml 2318 2007-02-15 02:11:43Z ovidiu.feodorov at jboss.com $ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p @%t [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+  <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: trunk/docs/examples/bridge/etc/test-bridge-service.xml
===================================================================
--- trunk/docs/examples/bridge/etc/test-bridge-service.xml	                        (rev 0)
+++ trunk/docs/examples/bridge/etc/test-bridge-service.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+     Example deployment descriptor for a message bridge
+
+     $Id: messaging-secure-socket-service.xml 2737 2007-05-29 17:56:49Z timfox $
+ -->
+
+<server>
+
+
+   <mbean code="org.jboss.jms.server.bridge.BridgeService"
+          name="jboss.messaging:service=Bridge,name=TestBridge"
+          xmbean-dd="xmdesc/Bridge-xmbean.xml">
+          
+      <!-- The JMS provider loader that is used to lookup the source destination -->   
+      <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>     
+      
+      <!-- The JMS provider loader that is used to lookup the target destination -->
+      <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>    
+      
+      <!-- The JNDI lookup for the source destination -->
+      <attribute name="SourceDestinationLookup">/queue/A</attribute> 
+      
+      <!-- The JNDI lookup for the target destination -->
+      <attribute name="TargetDestinationLookup">/queue/B</attribute>
+      
+      <!-- The username to use for the source connection 
+      <attribute name="SourceUsername">bob</attribute>
+      -->
+      
+      <!-- The password to use for the source connection
+      <attribute name="SourcePassword">cheesecake</attribute>
+      -->
+      
+      <!-- The username to use for the target connection
+      <attribute name="TargetUsername">mary</attribute>
+      -->
+      
+      <!-- The password to use for the target connection
+      <attribute name="TargetPassword">hotdog</attribute>
+      -->
+      
+      <!-- Optional: The Quality Of Service mode to use, one of:
+           QOS_AT_MOST_ONCE = 0;
+           QOS_DUPLICATES_OK = 1;
+           QOS_ONCE_AND_ONLY_ONCE = 2; -->
+      <attribute name="QualityOfServiceMode">0</attribute>
+      
+      <!-- JMS selector to use for consuming messages from the source
+      <attribute name="Selector">specify jms selector here</attribute>
+      -->
+      
+      <!-- The maximum number of messages to consume from the source before sending to the target -->
+      <attribute name="MaxBatchSize">5</attribute>     
+      
+      <!-- The maximum time to wait (in ms) before sending a batch to the target even if MaxBatchSize is not exceeded.
+           -1 means wait forever -->   
+      <attribute name="MaxBatchTime">-1</attribute>
+      
+      <!-- If consuming from a durable subscription this is the subscription name
+      <attribute name="SubName">mysub</attribute>
+      -->
+      
+      <!-- If consuming from a durable subscription this is the client ID to use
+      <attribute name="ClientID">myClientID</attribute>
+      -->
+      
+      <!-- The number of ms to wait between connection retrues in the event connections to source or target fail -->
+      <attribute name="FailureRetryInterval">5000</attribute>      
+      
+      <!-- The maximum number of connection retries to make in case of failure, before giving up
+           -1 means try forever-->
+      <attribute name="MaxRetries">-1</attribute>
+ </mbean>
+ 
+ </server>
\ No newline at end of file

Added: trunk/docs/examples/bridge/src/org/jboss/example/jms/bridge/BridgeExample.java
===================================================================
--- trunk/docs/examples/bridge/src/org/jboss/example/jms/bridge/BridgeExample.java	                        (rev 0)
+++ trunk/docs/examples/bridge/src/org/jboss/example/jms/bridge/BridgeExample.java	2007-06-01 09:16:18 UTC (rev 2747)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.example.jms.bridge;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+import org.jboss.example.jms.common.ExampleSupport;
+
+/**
+ * This example creates a JMS Connection to a JBoss Messaging instance and then sends a message to a source queue.
+ * It then waits to receive the same messages from the target queue.
+ * 
+ * The example ant script will deploy a message bridge that moves messages from the source to the target queue.
+ * 
+ * 
+ * Since this example is also used by the smoke test, it is essential that the VM exits with exit
+ * code 0 in case of successful execution and a non-zero value on failure.
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 2674 $</tt>
+ *
+ * $Id: QueueExample.java 2674 2007-05-14 19:57:23Z timfox $
+ */
+public class BridgeExample extends ExampleSupport
+{
+   
+   public void example() throws Exception
+   {
+      String source = System.getProperty("example.source.queue");
+      
+      String target = System.getProperty("example.target.queue");
+      
+      InitialContext ic = null;
+      ConnectionFactory cf = null;
+      Connection connection =  null;
+
+      try
+      {         
+         ic = new InitialContext();
+         
+         cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+         Queue sourceQueue = (Queue)ic.lookup("/queue/" + source);
+         log("Queue " + sourceQueue + " exists");
+         
+         Queue targetQueue = (Queue)ic.lookup("/queue/" + target);
+         log("Queue " + targetQueue + " exists");
+         
+         connection = cf.createConnection();
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer sender = session.createProducer(sourceQueue);
+         
+         final int NUM_MESSAGES = 10;
+         
+         for (int i = 0; i < NUM_MESSAGES; i++)
+         {
+         	TextMessage message = session.createTextMessage("Hello!" + i);	
+         	
+         	sender.send(message);
+         	
+            log("The message was successfully sent to the " + sourceQueue.getQueueName() + " queue");
+         }
+         
+         MessageConsumer consumer =  session.createConsumer(targetQueue);
+         
+         connection.start();
+         
+         for (int i = 0; i < NUM_MESSAGES; i++)
+         {
+         	TextMessage message = (TextMessage)consumer.receive(10000);
+         	
+         	assertEquals("Hello!" + i, message.getText());
+         	
+         	log("The message was received successfully from the " + targetQueue.getQueueName() + " queue");
+         }
+                  
+         displayProviderInfo(connection.getMetaData());                 
+      }
+      finally
+      {         
+         if(ic != null)
+         {
+            try
+            {
+               ic.close();
+            }
+            catch(Exception e)
+            {
+               throw e;
+            }
+         }
+         
+         // ALWAYS close your connection in a finally block to avoid leaks.
+         // Closing connection also takes care of closing its related objects e.g. sessions.
+         closeConnection(connection);
+      }
+   }
+   
+   private void closeConnection(Connection con)
+   {      
+      try
+      {
+         if (con != null)
+         {
+            con.close();
+         }         
+      }
+      catch(JMSException jmse)
+      {
+         log("Could not close connection " + con +" exception was " + jmse);
+      }
+   }
+      
+   protected boolean isQueueExample()
+   {
+      return true;
+   }
+   
+   public static void main(String[] args)
+   {
+      new BridgeExample().run();
+   }
+   
+}

Modified: trunk/docs/userguide/en/master.xml
===================================================================
--- trunk/docs/userguide/en/master.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/docs/userguide/en/master.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -10,12 +10,14 @@
 <!ENTITY configuration SYSTEM "modules/configuration.xml">
 <!ENTITY c_configuration SYSTEM "modules/c_configuration.xml">
 <!ENTITY performance SYSTEM "modules/performance.xml">
+<!ENTITY recovery_config SYSTEM "modules/recovery_config.xml">
+<!ENTITY bridge SYSTEM "modules/bridge.xml">
 ]>
 <book lang="en">
   <bookinfo>
-    <title>JBoss Messaging 1.2 User's Guide</title>
+    <title>JBoss Messaging 1.3 User's Guide</title>
 
-    <subtitle>The next generation enterprise messaging solution from JBoss</subtitle>
+    <subtitle>Enterprise Messaging from JBoss</subtitle>
 
   </bookinfo>
 
@@ -36,7 +38,10 @@
   &configuration;
 
   &c_configuration;
+  
+  &recovery_config;
+  
+  &bridge;
 
-  &performance;
 
 </book>

Modified: trunk/docs/userguide/en/modules/about.xml
===================================================================
--- trunk/docs/userguide/en/modules/about.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/docs/userguide/en/modules/about.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -1,47 +1,47 @@
 <chapter id="about">
 
-   <title>Introducing JBoss Messaging Release 1.2.0.GA</title>
+   <title>Introducing JBoss Messaging Release 1.3.0.GA</title>
 
    <para>
        JBoss Messaging is a high performance JMS provider in the JBoss Enterprise Middleware Stack
-       (JEMS). It is a complete rewrite of JBossMQ, which is the current default JMS provider in
-       JBoss AS 4.0.x series and JBoss AS 4.2.0.GA JBoss Messaging will be the default JMS provider in
-       JBoss AS 4.2.x series, probably starting with 4.2.1, and it is already the default provider
-       in JBoss 5.0.0.Beta.
+       (JEMS). It is a complete rewrite of JBossMQ, the legacy JBoss JMS provider.
    </para>
-   
    <para>
-      JBoss Messaging will also be part of the JBoss Enterprise Application Platform and the SOA platform, probably from 4.2.1 onwards
-   <para>
+       JBoss Messaging will be the default JMS provider in later versions of JBoss Enterprise Application Platform,
+       and JBoss Service Integration Platform.
+       It will also be the default JMS provider in JBoss Application Server 5, and is the default JMS provider for
+       JBoss ESB.
+   </para>
    
    <para>
       JBoss Messaging is an integral part of Red Hat's strategy for messaging.
    </para>
 
-   <para>JBoss Messaging will also be the default JMS provider for JBoss ESB.</para>
-
    <para>
        Compared with JBossMQ, JBoss Messaging offers vastly improved performance in both single node
        and clustered environments.
        Please see
        <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessagingPerformanceResultsPre1_0">this wiki page</ulink>
        for performance benchmarks and <xref linkend="performance"/> on how to generate your own
-       performance benchmarks. JBoss Messaging also features a much better modular architecture that
+       performance benchmarks.
+   </para>
+   <para>     
+       JBoss Messaging also features a much better modular architecture that
        will allow us to add more features in the future.
    </para>
 
    <para>
-       While JBoss Messaging only becomes the default JMS provider from JBoss AS 4.2.1 and JBoss 5.0,
-       production users on JBoss AS 4.0.x can still take advantage of the performance improvements
-       by easily replacing the JBossMQ module with JBoss Messaging.
+       JBoss Messaging can be easily installed in JBoss Application Server 4.2 using a few simple steps to 
+       remove JBoss MQ and replace with JBoss Messaging. Once JBoss Messaging becomes the default JMS provider
+       in JBoss Application Server 4.2, there will be no need to do any manual installation.
    </para>
    
-   <para><warn>From release 1.3.0.GA onwards JBoss Messaging is designed for JBoss 4.2.x only.</warn></para>
+   <para>From release 1.3.0.GA onwards JBoss Messaging is designed for JBoss 4.2.x only.</para>
    
    <para>
        The procedure of swapping JMS providers is presented in detail in this manual.
-       In <xref linkend="installation"/> we discuss how to install and use JBoss Messaging in
-       JBoss 4.0.x production servers. We cover JBoss Messaging-specific configuration options,
+       In <xref linkend="installation"/> we discuss how to install and use JBoss Messaging in a
+       JBoss AS 4.2 servers. We cover JBoss Messaging-specific configuration options,
        as well as how to run the build-in sanity / performance tests.
    </para>
 
@@ -60,16 +60,11 @@
    </para>
 
    <para>
-      Tim Fox, Technical Lead
-
+      Clebert Suconic, Core Developer
    </para>
-
-   <para>
-       Clebert Suconic, Core Developer
-   </para>
    
    <para>
-       Sergey Koshcheyev, Core Developer
+      Sergey Koshcheyev, Core Developer
    </para>
 
    <para>
@@ -77,10 +72,5 @@
       Rajdeep Dua, Madhusudhan Konda, Juha Lindfors and Ron Sigal.
    </para>
 
-   <para>
-       This manual was written with help from Luc Texier, Lead Support EMEA and
-       Sam Griffith Jr., JBoss Documentation Team.
-   </para>
 
-
 </chapter>

Modified: trunk/docs/userguide/en/modules/c_configuration.xml
===================================================================
--- trunk/docs/userguide/en/modules/c_configuration.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/docs/userguide/en/modules/c_configuration.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -11,12 +11,26 @@
    </para>
 
    <itemizedlist>
+   
+      <listitem>Choosing the connetion factory</listitem>
 
       <listitem>Choosing the cluster router policy</listitem>
 
       <listitem>Choosing the message redistributon policy</listitem>
 
    </itemizedlist>
+   
+   <section id="clientcluster">
+      <title>Choosing the connection factory</title>
+      
+      <para>JBoss Messaging connections factories can optionally support load balancing and automatic failover. This is determined
+      by the attributes on supportsLoadBalancing and supportsFailover on the connection factory.
+      </para>
+      
+      <para>See the section <xref linkend="conf.connectionfactory">Connection Factory configuration</xref> for more information.
+      </para>
+   </section>
+      
 
    <section id="clusterrouter">
 

Modified: trunk/docs/userguide/en/modules/c_overview.xml
===================================================================
--- trunk/docs/userguide/en/modules/c_overview.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/docs/userguide/en/modules/c_overview.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -5,7 +5,7 @@
 
     <para>
       This section of the userguide gives a brief overview of the features available in
-        JBoss Messaging Clustering 1.2.0.GA. It gives a high level explanation of how
+        JBoss Messaging. It gives a high level explanation of how
         clustering works.
      </para>
 
@@ -13,16 +13,16 @@
       <title>JBoss Messaging Clustering Overview</title>
 
       <para>
-      Here's a brief overview of how clustering works in JBoss Messaging 1.2.
+      Here's a brief overview of how clustering works in JBoss Messaging
       </para>
 
 
       <para>
       Clustered destinations (queues and topics) can be deployed at all or none of the nodes of
       the cluster.
-      A JMS client uses HA JNDI to lookup the connection factory. A client side load balancing
-      policy will automatically chose a node to connect to (This is similar to
-      how EJB clustering chooses a node).
+      A JMS client uses HA JNDI to lookup the connection factory. When creating connections
+      using that connection factory a client side load balancing
+      policy will automatically chose a node to connect to.
       </para>
 
       <para>
@@ -72,21 +72,6 @@
       on another node.
       </para>
 
-      <para>
-      Normally, persistent messages are persisted in a shared database which is shared by all nodes
-      in the cluster.
-
-      JBoss Messaging 1.2.1 will contain
-      an option where you can choose to not persist persistent messages in a database, but instead to replicate them between nodes of the cluster.
-
-      The idea here is the network IO on a fast network should be much faster than persisting to disk.
-      This solution should also be more scalable since different nodes replicate their messages onto
-      different other nodes - there is no "master node".
-
-      If the messages are replicated onto sufficient nodes and the hardware is set-up with UPS, then we believe a comparable reliability guarantee to persisting messages to disk
-      can be achieved. Of course, this won't be suitable for all situations, but you use the best tool for the job.
-      </para>
-
    </section>
 
 
@@ -115,7 +100,7 @@
         </para>
 
         <para>
-           Clustering across multiple address spaces is achieved by clustering Post Office instances. Each
+           Clustering across multiple nodes is achieved by clustering Post Office instances. Each
            JBoss Messaging cluster node runs a Clustered Post Office instance, which is aware of the presence
            of all other clustered Post Offices in the cluster. There is an one-to-one relationship between cluster
            nodes and clustered Post Office instances. So, naturally, the most important piece of clustering

Modified: trunk/docs/userguide/en/modules/configuration.xml
===================================================================
--- trunk/docs/userguide/en/modules/configuration.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/docs/userguide/en/modules/configuration.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -1,32 +1,31 @@
 <chapter id="configuration">
-  <title>Configuration</title>
+   <title>Configuration</title>
 
-  <para>
+   <para>
       The JMS API specifies how a messaging client interacts with a messaging server. The exact
       definition and implementation of messaging services, such as message destinations and
       connection factories, are specific to JMS providers. JBoss Messaging has its own
       configuration files to configure services. If you are migrating services from JBossMQ
       (or other JMS provider) to JBoss Messaging, you will need to understand those
       configuration files.
-  </para>
+   </para>
 
-  <para>
+   <para>
       In this chapter, we discuss how to configure various services inside JBoss Messaging,
       which work together to provide JMS API level services to client applications.
-  </para>
+   </para>
 
    <para>
-      Starting with the JBoss Messaging 1.0.1 release, the service configuration is spread among
-      several configuration files (the 1.0.0 release used to have all configuration information
-      lumped together in the SAR's deployment descriptor
-      <filename>jboss-messaging.sar/META-INF/jboss-service.xml</filename>).
+      The JBoss Messaging service configuration is spread among
+      several configuration files.
       Depending on the functionality provided by the services it configures, the configuration
       data is distributed between
       <filename>messaging-service.xml</filename>,
       <filename>remoting-service.xml</filename>,
       <filename>xxx-persistence-service.xml</filename>
        (or <filename>clustered-xxx-persistence-service.xml</filename> for a clustered configuration,
-       more about clusterered configuration in <xref linkend="c_configuration"/>),
+       more about clusterered configuration in <xref linkend="c_configuration"/>) (where xxx is the name
+       of the database you are using)
       <filename>connection-factories-service.xml</filename> and
       <filename>destinations-service.xml</filename>.
    </para>
@@ -39,95 +38,91 @@
       security interceptor.
    </para>
 
-  <section id="conf.serverpeer">
-    <title>Configuring the ServerPeer</title>
+   <section id="conf.serverpeer">
+      <title>Configuring the ServerPeer</title>
 
-    <para>
+      <para>
        The Server Peer is the "heart" of the JBoss Messaging JMS facade. The server's configuration,
        resides in <filename>messaging-service.xml</filename> configuration file.
-    </para>
+      </para>
 
-    <para>All JBoss Messaging services are rooted at the server peer</para>
+      <para>All JBoss Messaging services are rooted at the server peer</para>
 
-     <para>An example of a Server Peer configuration is presented below. Note that not all values for the server peer's attributes are
+      <para>An example of a Server Peer configuration is presented below. Note that not all values for the server peer's attributes are
      specified in the example</para>
 
-     <programlisting>
- &lt;mbean code="org.jboss.jms.server.ServerPeer"
-        name="jboss.messaging:service=ServerPeer"
-        xmbean-dd="xmdesc/ServerPeer-xmbean.xml"&gt;
+      <programlisting>
+   &lt;mbean code="org.jboss.jms.server.ServerPeer"
+      name="jboss.messaging:service=ServerPeer"
+      xmbean-dd="xmdesc/ServerPeer-xmbean.xml"&gt;
 
-   &lt;constructor&gt;
-     &lt;!-- ServerPeerID --&gt;
-     &lt;arg type="int" value="0"/&gt;
-     &lt;!-- DefaultQueueJNDIContext --&gt;
-     &lt;arg type="java.lang.String" value="/queue"/&gt;
-     &lt;!-- DefaultTopicJNDIContext --&gt;
-     &lt;arg type="java.lang.String" value="/topic"/&gt;
-   &lt;/constructor&gt;
+      &lt;constructor&gt;
+         &lt;!-- ServerPeerID --&gt;
+         &lt;arg type="int" value="0"/&gt;
+         &lt;!-- DefaultQueueJNDIContext --&gt;
+         &lt;arg type="java.lang.String" value="/queue"/&gt;
+         &lt;!-- DefaultTopicJNDIContext --&gt;
+         &lt;arg type="java.lang.String" value="/topic"/&gt;
+      &lt;/constructor&gt;
 
-   &lt;attribute name="PostOffice"&gt;jboss.messaging:service=PostOffice&lt;/attribute&gt;
-   &lt;attribute name="SecurityDomain"&gt;java:/jaas/messaging&lt;/attribute&gt;
-   &lt;attribute name="DefaultSecurityConfig"&gt;
-      &lt;security&gt;
-        &lt;role name="guest" read="true" write="true" create="true"/&gt;
-      &lt;/security&gt;
-   &lt;/attribute&gt;
-   &lt;attribute name="DefaultDLQ"&gt;
-       jboss.messaging.destination:service=Queue,name=DLQ&lt;/attribute&gt;
-   &lt;attribute name="DefaultMaxDeliveryAttempts"&gt;10&lt;/attribute&gt;
-   &lt;attribute name="DefaultExpiryQueue"&gt;
-       jboss.messaging.destination:service=Queue,name=ExpiryQueue&lt;/attribute&gt;
-   &lt;attribute name="DefaultRedeliveryDelay"&gt;0&lt;/attribute&gt;
-   &lt;attribute name="QueueStatsSamplePeriod"&gt;5000&lt;/attribute&gt;
-   &lt;attribute name="FailoverStartTimeout"&gt;60000&lt;/attribute&gt;
-   &lt;attribute name="FailoverCompleteTimeout"&gt;300000&lt;/attribute&gt;
-   &lt;attribute name="DefaultMessageCounterHistoryDayLimit"&gt;-1&lt;/attribute&gt;
+	  &lt;attribute name="PostOffice"&gt;jboss.messaging:service=PostOffice&lt;/attribute&gt;
+      &lt;attribute name="SecurityDomain"&gt;java:/jaas/messaging&lt;/attribute&gt;
+      &lt;attribute name="DefaultSecurityConfig"&gt;
+        &lt;security&gt;
+            &lt;role name="guest" read="true" write="true" create="true"/&gt;
+        &lt;/security&gt;
+      &lt;/attribute&gt;
+      &lt;attribute name="DefaultDLQ"&gt;jboss.messaging.destination:service=Queue,name=DLQ&lt;/attribute&gt;
+      &lt;attribute name="DefaultMaxDeliveryAttempts"&gt;10&lt;/attribute&gt;
+      &lt;attribute name="DefaultExpiryQueue"&gt;jboss.messaging.destination:service=Queue,name=ExpiryQueue&lt;/attribute&gt;
+      &lt;attribute name="DefaultRedeliveryDelay"&gt;0&lt;/attribute&gt;
+      &lt;attribute name="QueueStatsSamplePeriod"&gt;5000&lt;/attribute&gt;
+      &lt;attribute name="FailoverStartTimeout"&gt;60000&lt;/attribute&gt;
+      &lt;attribute name="FailoverCompleteTimeout"&gt;300000&lt;/attribute&gt;
+      &lt;attribute name="DefaultMessageCounterHistoryDayLimit"&gt;-1&lt;/attribute&gt;
 
-   &lt;depends optional-attribute-name="PersistenceManager"&gt;
-       jboss.messaging:service=PersistenceManager&lt;/depends&gt;
-   &lt;depends optional-attribute-name="JMSUserManager"&gt;
-       jboss.messaging:service=JMSUserManager&lt;/depends&gt;
-   &lt;depends&gt;jboss.messaging:service=Connector,transport=bisocket&lt;/depends&gt;
+      &lt;depends optional-attribute-name="PersistenceManager"&gt;jboss.messaging:service=PersistenceManager&lt;/depends&gt;
+      &lt;depends optional-attribute-name="JMSUserManager"&gt;jboss.messaging:service=JMSUserManager&lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=Connector,transport=bisocket&lt;/depends&gt;
 
- &lt;/mbean&gt;
-     </programlisting>
+   &lt;/mbean&gt;     
+      </programlisting>
 
-     <section id="conf.serverpeer.attributes">
+      <section id="conf.serverpeer.attributes">
+      
+         <title>
+             We now discuss the MBean attributes and constructor arguments of the ServerPeer MBean
+         </title>
+       
+         <section id="conf.serverpeer.attributes.persistencemanager">
+            <title>PersistenceManager</title>
 
-       <title>
-             We now discuss the MBean attributes of the ServerPeer MBean
-        </title>
-
-       <section id="conf.serverpeer.attributes.persistencemanager">
-           <title>PersistenceManager</title>
-
-           <para>
+            <para>
               This is the persistence manager that the ServerPeer uses. You will not normally need to change this attribute.
-           </para>
-        </section>
+            </para>
+         </section>
 
-       <section id="conf.serverpeer.attributes.postoffice">
-           <title>PostOffice</title>
+         <section id="conf.serverpeer.attributes.postoffice">
+            <title>PostOffice</title>
 
-           <para>
+            <para>
               This is the post office that the ServerPeer uses. You will not normally need to change this attribute.
               The post office is responsible for routing messages to queues and maintaining the mapping between addresses and queues.
-           </para>
-        </section>
+            </para>
+         </section>
 
-       <section id="conf.serverpeer.attributes.jmsusermanager">
-           <title>JMSUserManager</title>
+         <section id="conf.serverpeer.attributes.jmsusermanager">
+            <title>JMSUserManager</title>
 
-           <para>
+            <para>
               This is the JMS user manager that the ServerPeer uses. You will not normally need to change this attribute.
-           </para>
-        </section>
+            </para>
+         </section>
 
-       <section id="conf.serverpeer.attributes.defaultdlq">
-           <title>DefaultDLQ</title>
+         <section id="conf.serverpeer.attributes.defaultdlq">
+            <title>DefaultDLQ</title>
 
-           <para>
+            <para>
               This is the name of the default DLQ (Dead Letter Queue) the server peer will use for destinations. The DLQ can be overridden on a per
               destination basis - see the destination MBean configuration for more details.
 
@@ -139,13 +134,13 @@
               The maximum number of delivery attempts can be specified using the attribute DefaultMaxDeliveryAttempts for a global default or individually
               on a per destination basis.
 
-           </para>
-        </section>
+            </para>
+         </section>
 
-       <section id="conf.serverpeer.attributes.defaultexpiryqueue">
-           <title>DefaultExpiryQueue</title>
+         <section id="conf.serverpeer.attributes.defaultexpiryqueue">
+            <title>DefaultExpiryQueue</title>
 
-           <para>
+            <para>
               This is the name of the default expiry queue the server peer will use for destinations. The expiry can be overridden on a per
               destination basis - see the destination MBean configuration for more details.
 
@@ -154,254 +149,259 @@
 
               If the expiry queue is not specified at all then the message will be removed after it is expired.
 
-           </para>
-        </section>
+            </para>
+         </section>
 
 
-        <section id="conf.serverpeer.attributes.serverpeerid">
-           <title>ServerPeerID</title>
+         <section id="conf.serverpeer.attributes.serverpeerid">
+            <title>ServerPeerID</title>
 
-           <para>
+            <para>
               The unique id of the server. In a cluster each server MUST have a unique id.
-           </para>
-        </section>
+            </para>
+         </section>
 
-        <section id="conf.serverpeer.attributes.defaultqueuejndicontext">
-           <title>DefaultQueueJNDIContext</title>
+         <section id="conf.serverpeer.attributes.defaultqueuejndicontext">
+            <title>DefaultQueueJNDIContext</title>
 
-           <para>
+            <para>
               The default JNDI context to use when binding queues. Defaults to /queue.
-           </para>
-        </section>
+            </para>
+         </section>
 
-        <section id="conf.serverpeer.attributes.defaultopicjndicontext">
-           <title>DefaultTopicJNDIContext</title>
+         <section id="conf.serverpeer.attributes.defaultopicjndicontext">
+            <title>DefaultTopicJNDIContext</title>
 
-           <para>
+            <para>
               The default JNDI context to use when binding topics. Defaults to /topic.
-           </para>
-        </section>
+            </para>
+         </section>
 
-        <section id="conf.serverpeer.attributes.destinations">
-           <title>Destinations</title>
+         <section id="conf.serverpeer.attributes.destinations">
+            <title>Destinations</title>
 
-           <para>
+            <para>
               Returns a list of the destinations (queues and topics) currently deployed.
-           </para>
-        </section>
+            </para>
+         </section>
 
-        <section id="conf.serverpeer.attributes.defaultmaxdeliveryattempts">
-           <title>DefaultMaxDeliveryAttempts</title>
+         <section id="conf.serverpeer.attributes.defaultmaxdeliveryattempts">
+            <title>DefaultMaxDeliveryAttempts</title>
 
-           <para>
+            <para>
               The default for the maximum number of times delivery of a message will be attempted before sending the message to the DLQ, if configured.
-           </para>
-           <para>
+            </para>
+            <para>
               The default value is <literal>10</literal >
-           </para>
-           <para>This value can also be overridden on a per destination basis</para>
-        </section>
+            </para>
+            <para>This value can also be overridden on a per destination basis</para>
+         </section>
 
-        <section id="conf.serverpeer.attributes.failoverstarttimeout">
-           <title>FailoverStartTimeout</title>
+         <section id="conf.serverpeer.attributes.failoverstarttimeout">
+            <title>FailoverStartTimeout</title>
 
-           <para>
+            <para>
               The maximum number of milliseconds the client will wait for failover to start on the server side when a problem is detected.
-           </para>
-           <para>
+            </para>
+            <para>
               The default value is <literal>60000</literal> (one minute)
-           </para>
+            </para>
 
-        </section>
+         </section>
 
-        <section id="conf.serverpeer.attributes.failovercompletetimeout">
-           <title>FailoverCompleteTimeout</title>
+         <section id="conf.serverpeer.attributes.failovercompletetimeout">
+            <title>FailoverCompleteTimeout</title>
 
-           <para>
+            <para>
               The maximum number of milliseconds the client will wait for failover to complete on the server side after it has started.
-           </para>
-           <para>
+            </para>
+            <para>
               The default value is <literal>300000</literal> (five minutes)
-           </para>
-        </section>
+            </para>
+         </section>
 
-        <section id="conf.serverpeer.attributes.defaultredliverydelay">
-           <title>DefaultRedeliveryDelay</title>
+         <section id="conf.serverpeer.attributes.defaultredliverydelay">
+            <title>DefaultRedeliveryDelay</title>
 
-           <para>
+            <para>
               When redelivering a message after failure of previous delivery it is often beneficial to introduce a delay perform redelivery in order
               to prevent thrashing of delivery-failure, delivery-failure etc
-           </para>
-           <para>
+            </para>
+            <para>
               The default value is <literal>0</literal> which means there will be no delay.
-           </para>
-           <para>Change this if your application could benefit with a delay before redelivery. This value can also be overridden on a per destination basis</para>
-        </section>
+            </para>
+            <para>Change this if your application could benefit with a delay before redelivery.
+           This value can also be overridden on a per destination basis
+            </para>
+         </section>
 
-        <section id="conf.serverpeer.attributes.queuestatssampleperiod">
-           <title>QueueStatsSamplePeriod</title>
+         <section id="conf.serverpeer.attributes.queuestatssampleperiod">
+            <title>QueueStatsSamplePeriod</title>
 
-           <para>
+            <para>
               Periodically the server will query each queue to gets its message statistics. This is the period.
-           </para>
-           <para>
+            </para>
+            <para>
               The default value is <literal>10000</literal> milliseconds
-           </para>
-        </section>
+            </para>
+         </section>
 
 
-        <section id="conf.serverpeer.attributes.defaultmessagecounterhistorydaylimit">
-              <title>DefaultMessageCounterHistoryDayLimit</title>
+         <section id="conf.serverpeer.attributes.defaultmessagecounterhistorydaylimit">
+            <title>DefaultMessageCounterHistoryDayLimit</title>
 
-              <para>
+            <para>
                  JBoss Messaging provides a message counter history which shows the number of messages arriving on each queue of a certain number of
                  days. This attribute represents the maxiumum number of days for which to store message counter history. It can be overridden on a per
                  destination basis
-           </para>
-        </section>
+            </para>
+         </section>
 
-        <section id="conf.serverpeer.attributes.messagecounters">
-              <title>MessageCounters</title>
+         <section id="conf.serverpeer.attributes.messagecounters">
+            <title>MessageCounters</title>
 
-              <para>
+            <para>
                  JBoss Messaging provides a message counter for each queue.
-           </para>
-        </section>
+            </para>
+         </section>
 
-        <section id="conf.serverpeer.attributes.messagecounterstatistics">
-              <title>MessageCountersStatistics</title>
+         <section id="conf.serverpeer.attributes.messagecounterstatistics">
+            <title>MessageCountersStatistics</title>
 
-              <para>
+            <para>
                  JBoss Messaging provides statistics for each message counter for each queue.
-           </para>
-        </section>
+            </para>
+         </section>
 
-        <section id="conf.serverpeer.attributes.defaultsecurity">
-           <title>DefaultSecurityConfig</title>
+         <section id="conf.serverpeer.attributes.defaultsecurity">
+            <title>DefaultSecurityConfig</title>
 
-           <para>
+            <para>
               Default security configuration is used when the security configuration for a specific
               queue or topic has not been overridden in the destination's deployment descriptor.
               It has exactly the same syntax and semantics as in JBossMQ.
-           </para>
+            </para>
 
-           <para>
+            <para>
               The <literal>DefaultSecurityConfig</literal> attribute element should contain
               one <literal>&lt;security&gt;</literal> element.
               The <literal>&lt;security&gt;</literal> element can contain multiple
               <literal>&lt;role&gt;</literal> elements. Each <literal>&lt;role&gt;</literal>
               element defines the default access for that particular role.
-           </para>
+            </para>
 
-           <para>
+            <para>
               If the <literal>read</literal> attribute is <literal>true</literal> then that role
               will be able to read (create consumers, receive messaages or browse) destinations
               by default.
-           </para>
+            </para>
 
-           <para>
+            <para>
               If the <literal>write</literal> attribute is <literal>true</literal> then that role
               will be able to write (create producers or send messages) to destinations by default.
-           </para>
+            </para>
 
-           <para>
+            <para>
               If the <literal>create</literal> attribute is <literal>true</literal> then that role
               will be able to create durable subscriptions on topics by default.
-           </para>
-        </section>
-     </section>
+            </para>
+         </section>
+      </section>
 
 
-     <section id="conf.serverpeer.operations">
+      <section id="conf.serverpeer.operations">
 
-        <title>
+         <title>
              We now discuss the MBean operations of the ServerPeer MBean
-        </title>
+         </title>
 
-        <section id="conf.serverpeer.operations.deployQueue">
-           <title>DeployQueue</title>
+         <section id="conf.serverpeer.operations.deployQueue">
+            <title>DeployQueue</title>
 
-           <para>
+            <para>
               This operation lets you programmatically deploy a queue.
-           </para>
+            </para>
 
-           <para>There are two overloaded versions of this operation</para>
+            <para>There are two overloaded versions of this operation</para>
 
-           <para>If the queue already exists but is undeployed it is deployed. Otherwise it is created and deployed</para>
+            <para>If the queue already exists but is undeployed it is deployed. Otherwise it is created and deployed</para>
 
-           <para>The <literal>name</literal> parameter represents the name of the destination to deploy.</para>
-           <para>The <literal>jndiName</literal> parameter (optional) represents the full jndi name where to bind the destination. If this is not specified
-           then the destination will be bound in &lt;DefaultQueueJNDIContext&gt;/&lt;name&gt;</para>
+            <para>The <literal>name</literal> parameter represents the name of the destination to deploy.</para>
+            <para>The <literal>jndiName</literal> parameter (optional) represents the full jndi name where to bind the destination.
+             If this is not specified then the destination will be bound in &lt;DefaultQueueJNDIContext&gt;/&lt;name&gt;
+            </para>
 
-           <para>The first version of this operation deploys the destination with the default paging parameters. The second overloaded version deploys
+            <para>The first version of this operation deploys the destination with the default paging parameters. The second overloaded version deploys
            the destination with the specified paging parameters. See the section on configuring destinations for a discussion of what the
            paging parameters mean</para>
 
-        </section>
+         </section>
 
-       <section id="conf.serverpeer.operations.undeployQueue">
-           <title>UndeployQueue</title>
+         <section id="conf.serverpeer.operations.undeployQueue">
+            <title>UndeployQueue</title>
 
-           <para>
+            <para>
               This operation lets you programmatically undeploy a queue.
-           </para>
+            </para>
 
-           <para>The queue is undeployed but is NOT removed from persistent storage.</para>
+            <para>The queue is undeployed but is NOT removed from persistent storage.</para>
 
-           <para>This operation returns <literal>true</literal> if the queue was successfull undeployed. otherwise it returns <literal>false</literal></para>
+            <para>This operation returns <literal>true</literal> if the queue was successfull undeployed. otherwise it returns <literal>false</literal></para>
 
-        </section>
+         </section>
 
-       <section id="conf.serverpeer.operations.destroyQueue">
-           <title>DestroyQueue</title>
+         <section id="conf.serverpeer.operations.destroyQueue">
+            <title>DestroyQueue</title>
 
-           <para>
+            <para>
               This operation lets you programmatically destroy a queue.
-           </para>
+            </para>
 
-           <para>The queue is undeployed and then all its data is destroyed from the database</para>
+            <para>The queue is undeployed and then all its data is destroyed from the database</para>
 
-           <warning>Be careful when using this method since it will delete all data for the queue</warning>
+            <warning>Be careful when using this method since it will delete all data for the queue</warning>
 
-           <para>This operation returns <literal>true</literal> if the queue was successfully destroyed. otherwise it returns <literal>false</literal></para>
+            <para>This operation returns <literal>true</literal> if the
+            queue was successfully destroyed. otherwise it returns <literal>false</literal></para>
 
-        </section>
+         </section>
 
-        <section id="conf.serverpeer.operations.deployTopic">
-           <title>DeployTopic</title>
+         <section id="conf.serverpeer.operations.deployTopic">
+          
+            <title>DeployTopic</title>
 
-           <para>
+            <para>
               This operation lets you programmatically deploy a topic.
-           </para>
+            </para>
 
-           <para>There are two overloaded versions of this operation</para>
+            <para>There are two overloaded versions of this operation</para>
 
-           <para>If the topic already exists but is undeployed it is deployed. Otherwise it is created and deployed</para>
+            <para>If the topic already exists but is undeployed it is deployed. Otherwise it is created and deployed</para>
 
-           <para>The <literal>name</literal> parameter represents the name of the destination to deploy.</para>
-           <para>The <literal>jndiName</literal> parameter (optional) represents the full jndi name where to bind the destination. If this is not specified
+            <para>The <literal>name</literal> parameter represents the name of the destination to deploy.</para>
+            <para>The <literal>jndiName</literal> parameter (optional) represents the full jndi name where to bind the destination. If this is not specified
            then the destination will be bound in &lt;DefaultTopicJNDIContext&gt;/&lt;name&gt;</para>
 
-           <para>The first version of this operation deploys the destination with the default paging parameters. The second overloaded version deploys
+            <para>The first version of this operation deploys the destination with the default paging parameters. The second overloaded version deploys
            the destination with the specified paging parameters. See the section on configuring destinations for a discussion of what the
            paging parameters mean</para>
 
-        </section>
+         </section>
 
-       <section id="conf.serverpeer.operations.undeployTopic">
-           <title>UndeployTopic</title>
+         <section id="conf.serverpeer.operations.undeployTopic">
+            <title>UndeployTopic</title>
 
-           <para>
+            <para>
               This operation lets you programmatically undeploy a topic.
-           </para>
+            </para>
 
-           <para>The queue is undeployed but is NOT removed from persistent storage.</para>
+            <para>The queue is undeployed but is NOT removed from persistent storage.</para>
 
-           <para>This operation returns <literal>true</literal> if the topic was successfully undeployed. otherwise it returns <literal>false</literal></para>
+            <para>This operation returns <literal>true</literal> if the topic was successfully undeployed. otherwise it returns <literal>false</literal></para>
 
-        </section>
+         </section>
 
-       <section id="conf.serverpeer.operations.destroyTopic">
+         <section id="conf.serverpeer.operations.destroyTopic">
            <title>DestroyTopic</title>
 
            <para>
@@ -414,140 +414,138 @@
 
            <para>This operation returns <literal>true</literal> if the topic was successfully destroyed. otherwise it returns <literal>false</literal></para>
 
-        </section>
+         </section>
 
-       <section id="conf.serverpeer.operations.listmessagecountersashtml">
+         <section id="conf.serverpeer.operations.listmessagecountersashtml">
            <title>ListMessageCountersHTML</title>
 
            <para>
               This operation returns message counters in an easy to display HTML format.
            </para>
-        </section>
+         </section>
 
-       <section id="conf.serverpeer.operations.resetallmessagecounters">
+         <section id="conf.serverpeer.operations.resetallmessagecounters">
            <title>ResetAllMesageCounters</title>
 
            <para>
               This operation resets all message counters to zero.
            </para>
-        </section>
+         </section>
 
 
-       <section id="conf.serverpeer.operations.resetallmessagecounterhistories">
+         <section id="conf.serverpeer.operations.resetallmessagecounterhistories">
            <title>ResetAllMesageCounters</title>
 
            <para>
               This operation resets all message counter histories to zero.
            </para>
-        </section>
+         </section>
 
-       <section id="conf.serverpeer.operations.enablemessagecounters">
+         <section id="conf.serverpeer.operations.enablemessagecounters">
            <title>EnableMessageCounters</title>
 
            <para>
               This operation enables all message counters for all destinations. Message counters are disabled by default.
            </para>
-        </section>
+         </section>
 
-       <section id="conf.serverpeer.operations.disablemessagecounters">
+         <section id="conf.serverpeer.operations.disablemessagecounters">
            <title>DisableMessageCounters</title>
 
            <para>
               This operation disables all message counters for all destinations. Message counters are disabled by default.
            </para>
-        </section>
+         </section>
 
-       <section id="conf.serverpeer.operations.retrievepreparedtransactions">
+         <section id="conf.serverpeer.operations.retrievepreparedtransactions">
            <title>RetrievePreparedTransactions</title>
 
            <para>
               Retrieves a list of the Xids for all transactions currently in a prepared state on the node.
            </para>
-      </section>
+         </section>
 
-       <section id="conf.serverpeer.operations.showpreparedtransactions">
+         <section id="conf.serverpeer.operations.showpreparedtransactions">
            <title>ShowPreparedTransactions</title>
 
            <para>
               Retrieves a list of the Xids for all transactions currently in a prepared state on the node in an easy to display HTML format.
            </para>
+         </section>
+
       </section>
 
+   </section>
 
-     </section>
+   <section id="conf.changingds">
+      <title>Changing the Database</title>
 
-  </section>
-
-     <section id="conf.changingds">
-        <title>Changing the Database</title>
-
-        <para>
+      <para>
                Several JBoss Messaging services interact with persistent storage. They include: The Persistence Manager,
                The PostOffice and the JMS User Manager.
                The Persistence Manager is used to handle the message-related persistence.
                The Post Office handles binding related persistence.
                The JMS User manager handles user related persistence
                The configuration for all these MBeans is handled in the <filename>xxx-persistence-service.xml</filename> file
-        </para>
+      </para>
 
-        <para>
+      <para>
            If the database you want to switch to is one of MySQL, Oracle, PostgreSQL, MS SQL Sever or Sybase,
            persistence configuration files are already available in
            the <filename>examples/config</filename> directory of the release bundle.
-        </para>
+      </para>
 
-        <para>
+      <para>
            In order to enable support for one of these databases, just replace the default
            <filename>hsqldb-persistence-service.xml</filename> configuration file with the
            database-specific configuration file and restart the server.
-        </para>
+      </para>
 
-        <para>
+      <para>
            Also, be aware that by default, the Messaging services relying on a datastore
            are referencing <literal>"java:/DefaultDS"</literal> for the datasource.
            If you are deploying a datasource with a different JNDI name, you need to update
            all the <literal>DataSource</literal> attribute in the persistence configuration file.
 
            Example data source configurations for each of the popular databases are available in the distribution.
-        </para>
+      </para>
 
-     </section>
+   </section>
 
 
-  <section id="conf.postoffice">
-    <title>Configuring the Post office</title>
+   <section id="conf.postoffice">
+      <title>Configuring the Post office</title>
 
-    <para>It is the job of the post office to route messages to their destination(s).
-    </para>
+      <para>It is the job of the post office to route messages to their destination(s).
+      </para>
 
-    <para>The post office maintains the mappings between addresses to which messages can be sent and their final queues.</para>
+      <para>The post office maintains the mappings between addresses to which messages can be sent and their final queues.</para>
 
-    <para>For example when sending a message with an address that represents a JMS queue name, the post office will route this to a single
+      <para>For example when sending a message with an address that represents a JMS queue name, the post office will route this to a single
     queue - the JMS queue. When sending a message with an address that repesents a JMS topic name, the post office will route this to a set of
     queues - one for each JMS subscription.</para>
 
-    <para>The post office also handles the persistence for the mapping of addresses</para>
+      <para>The post office also handles the persistence for the mapping of addresses</para>
 
-    <para>JBoss Messaging comes with two different post office implementations - depending on whether you want clustering or not. The clustered post office
+      <para>JBoss Messaging comes with two different post office implementations - depending on whether you want clustering or not. The clustered post office
     has the ability to route messages to other nodes in the cluster</para>
 
-    <para>Whether you use the clustered post office or not depends on whether you deploy the <literal>clustered-xxx-persistence-service.xml</literal> MBean config
+      <para>Whether you use the clustered post office or not depends on whether you deploy the <literal>clustered-xxx-persistence-service.xml</literal> MBean config
     or just the non clustered <literal>xxx-persistence-service.xml</literal> file.</para>
 
-    <para>It is likely that in future releases of JBoss Messaging the clustered and non clustered post offices will be combined into a single post office for
+      <para>It is likely that in future releases of JBoss Messaging the clustered and non clustered post offices will be combined into a single post office for
     ease of configuration</para>
 
-    <section id="conf.postoffice.nonclustered">
-       <title>Non clustered post office</title>
+      <section id="conf.postoffice.nonclustered">
+         <title>Non clustered post office</title>
 
-       <para>The non clustered post office should be used where clustering is not required. It will be used when the
+         <para>The non clustered post office should be used where clustering is not required. It will be used when the
        non clustered <literal>xxx-persistence-service.xml</literal> file is deployed.</para>
 
-       <para>Here is an example of a non clustered post office configuration:</para>
+         <para>Here is an example of a non clustered post office configuration:</para>
 
-       <programlisting>
-
-&lt;mbean code="org.jboss.messaging.core.plugin.DefaultPostOfficeService"
+         <programlisting>
+   &lt;mbean code="org.jboss.messaging.core.plugin.DefaultPostOfficeService"
       name="jboss.messaging:service=PostOffice"
       xmbean-dd="xmdesc/DefaultPostOffice-xmbean.xml"&gt;
       &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;
@@ -564,63 +562,62 @@
       ]]&gt;&lt;/attribute&gt;
    &lt;/mbean&gt;
 
-       </programlisting>
+         </programlisting>
 
-       <section id="conf.postoffice.nonclustered.attributes">
+            <section id="conf.postoffice.nonclustered.attributes">
 
-       <title>The non clustered post office has the following attributes</title>
+               <title>The non clustered post office has the following attributes</title>
 
-          <section id="conf.postoffice.nonclustered.attributes.datasource">
-             <title>DataSource</title>
-             <para>The datasource the postoffice should use for persisting its mapping data</para>
-          </section>
+                  <section id="conf.postoffice.nonclustered.attributes.datasource">
+                     <title>DataSource</title>
+                        <para>The datasource the postoffice should use for persisting its mapping data</para>
+                  </section>
 
-          <section id="conf.postoffice.nonclustered.attributes.sqlproperties">
-              <title>SQLProperties</title>
-              <para>
+                  <section id="conf.postoffice.nonclustered.attributes.sqlproperties">
+                     <title>SQLProperties</title>
+                     <para>
                             This is where the DDL and DML for the particular database is specified.
                             If a particular DDL or DML statement is not overridden, the default Hypersonic
                             configuration will be used for that statement.
-           </para>
-          </section>
+                     </para>
+                  </section>
 
-          <section id="conf.postoffice.nonclustered.attributes.createtables">
-               <title>CreateTablesOnStartup</title>
+                  <section id="conf.postoffice.nonclustered.attributes.createtables">
+                     <title>CreateTablesOnStartup</title>
 
-               <para>
+                     <para>
                   Set this to <literal>true</literal> if you wish the post office to attempt
                   to create the tables (and indexes) when it starts. If the tables (or indexes)
                   already exist a <literal>SQLException</literal> will be thrown by the JDBC driver and
                   ignored by the Persistence Manager, allowing it to continue.
-               </para>
-               <para>
+                     </para>
+                     <para>
                   By default the value of <literal>CreateTablesOnStartup</literal> attribute
                   is set to <literal>true</literal>
-               </para>
-         </section>
+                     </para>
+                  </section>
 
-          <section id="conf.postoffice.nonclustered.attributes.postofficename">
-               <title>PostOfficeName</title>
+                  <section id="conf.postoffice.nonclustered.attributes.postofficename">
+                     <title>PostOfficeName</title>
 
-               <para>
+                        <para>
                   The name of the post office
-               </para>
-         </section>
-      </section>
-   </section>
+                        </para>
+                     </section>
+                  </section>
+               </section>
 
 
-   <section id="conf.postoffice.clustered">
-       <title>Clustered post office</title>
+               <section id="conf.postoffice.clustered">
+                  <title>Clustered post office</title>
 
-       <para>The clustered post office should be used where clustering is required. It will be used when the
+                  <para>The clustered post office should be used where clustering is required. It will be used when the
        clustered <literal>clustered-xxx-persistence-service.xml</literal> file is deployed.</para>
 
-       <para>Here is an example of a clustered post office configuration:</para>
+                  <para>Here is an example of a clustered post office configuration:</para>
 
-       <programlisting>
-
-&lt;mbean code="org.jboss.messaging.core.plugin.ClusteredPostOfficeService"
+                  <programlisting>
+   &lt;mbean code="org.jboss.messaging.core.plugin.ClusteredPostOfficeService"
       name="jboss.messaging:service=PostOffice"
       xmbean-dd="xmdesc/ClusteredPostOffice-xmbean.xml"&gt;
       &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;
@@ -638,7 +635,7 @@
       &lt;attribute name="GroupName"&gt;DefaultPostOffice&lt;/attribute&gt;
       &lt;attribute name="StateTimeout"&gt;5000&lt;/attribute&gt;
       &lt;attribute name="CastTimeout"&gt;5000&lt;/attribute&gt;
-      &lt;attribute name="StatsSendPeriod"&gt;10000&lt;/attribute&gt;
+      &lt;attribute name="StatsSendPeriod"&gt;3000&lt;/attribute&gt;
       &lt;attribute name="MessagePullPolicy"&gt;org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy&lt;/attribute&gt;
       &lt;attribute name="ClusterRouterFactory"&gt;org.jboss.messaging.core.plugin.postoffice.cluster.DefaultRouterFactory&lt;/attribute&gt;
 
@@ -652,7 +649,7 @@
          &lt;config&gt;
             &lt;UDP mcast_recv_buf_size="500000" down_thread="false" ip_mcast="true" mcast_send_buf_size="32000"
            mcast_port="45567" ucast_recv_buf_size="500000" use_incoming_packet_handler="false"
-           mcast_addr="228.8.8.8" use_outgoing_packet_handler="true" loopback="true" ucast_send_buf_size="32000" ip_ttl="32" bind_addr="127.0.0.1"/&gt;
+           mcast_addr="228.8.8.8" use_outgoing_packet_handler="true" loopback="true" ucast_send_buf_size="32000" ip_ttl="32"/&gt;
             &lt;AUTOCONF down_thread="false" up_thread="false"/&gt;
             &lt;PING timeout="2000" down_thread="false" num_initial_members="3" up_thread="false"/&gt;
             &lt;MERGE2 max_interval="10000" down_thread="false" min_interval="5000" up_thread="false"/&gt;
@@ -673,7 +670,7 @@
          &lt;config&gt;
             &lt;UDP mcast_recv_buf_size="500000" down_thread="false" ip_mcast="true" mcast_send_buf_size="32000"
            mcast_port="45568" ucast_recv_buf_size="500000" use_incoming_packet_handler="false"
-           mcast_addr="228.8.8.8" use_outgoing_packet_handler="true" loopback="true" ucast_send_buf_size="32000" ip_ttl="32" bind_addr="127.0.0.1"/&gt;
+           mcast_addr="228.8.8.8" use_outgoing_packet_handler="true" loopback="true" ucast_send_buf_size="32000" ip_ttl="32"/&gt;
             &lt;AUTOCONF down_thread="false" up_thread="false"/&gt;
             &lt;PING timeout="2000" down_thread="false" num_initial_members="3" up_thread="false"/&gt;
             &lt;MERGE2 max_interval="10000" down_thread="false" min_interval="5000" up_thread="false"/&gt;
@@ -692,474 +689,410 @@
       &lt;/attribute&gt;
    &lt;/mbean&gt;
 
-       </programlisting>
+                  </programlisting>
 
-       <section id="conf.postoffice.clustered.attributes">
+                  <section id="conf.postoffice.clustered.attributes">
 
-       <title>The nclustered post office has the following attributes</title>
+                     <title>The clustered post office has the following attributes</title>
 
-          <section id="conf.postoffice.clustered.attributes.datasource">
-             <title>DataSource</title>
-             <para>The datasource the postoffice should use for persisting its mapping data</para>
-          </section>
+                     <section id="conf.postoffice.clustered.attributes.datasource">
+                        <title>DataSource</title>
+                        <para>The datasource the postoffice should use for persisting its mapping data</para>
+                     </section>
 
-          <section id="conf.postoffice.clustered.attributes.sqlproperties">
-              <title>SQLProperties</title>
-              <para>
+                     <section id="conf.postoffice.clustered.attributes.sqlproperties">
+                        <title>SQLProperties</title>
+                        <para>
                             This is where the DDL and DML for the particular database is specified.
                             If a particular DDL or DML statement is not overridden, the default Hypersonic
                             configuration will be used for that statement.
-           </para>
-          </section>
+                        </para>
+                     </section>
 
-          <section id="conf.postoffice.clustered.attributes.createtables">
-               <title>CreateTablesOnStartup</title>
+                     <section id="conf.postoffice.clustered.attributes.createtables">
+                        <title>CreateTablesOnStartup</title>
 
-               <para>
+                        <para>
                   Set this to <literal>true</literal> if you wish the post office to attempt
                   to create the tables (and indexes) when it starts. If the tables (or indexes)
                   already exist a <literal>SQLException</literal> will be thrown by the JDBC driver and
                   ignored by the Persistence Manager, allowing it to continue.
-               </para>
-               <para>
+                        </para>
+                        <para>
                   By default the value of <literal>CreateTablesOnStartup</literal> attribute
                   is set to <literal>true</literal>
-               </para>
-         </section>
+                        </para>
+                     </section>
 
-          <section id="conf.postoffice.clustered.attributes.postofficename">
-               <title>PostOfficeName</title>
+                     <section id="conf.postoffice.clustered.attributes.postofficename">
+                        <title>PostOfficeName</title>
 
-               <para>
+                        <para>
                   The name of the post office
-               </para>
-         </section>
+                        </para>
+                     </section>
 
-          <section id="conf.postoffice.clustered.attributes.nodeidview">
-               <title>NodeIDView</title>
+                  <section id="conf.postoffice.clustered.attributes.nodeidview">
+                     <title>NodeIDView</title>
 
-               <para>
+                        <para>
                   This returns set containing the node ids of all the nodes in the cluster
-               </para>
-         </section>
+                        </para>
+                  </section>
 
-          <section id="conf.postoffice.clustered.attributes.groupname">
-               <title>GroupName</title>
+                  <section id="conf.postoffice.clustered.attributes.groupname">
+                     <title>GroupName</title>
 
-               <para>
+                     <para>
                   All post offices in the cluster with the same group name will form a cluster together. Make sure the group name matches with
                   all the nodes in the cluster you want to form a cluster with.
-               </para>
-         </section>
+                     </para>
+                  </section>
 
-          <section id="conf.postoffice.clustered.attributes.messagepullpolicy">
-               <title>MessagePullPolicy</title>
-               <para>
-                  JBoss Messaging has the ability for queues on one node to pull messages from other nodes when they have exhausted their local messages.
-               </para>
-               <para>This prevents messages from getting stranded on nodes with slow or no consumers, and balances out message processing across the cluster.</para>
-               <para>How, if and when messages are pulled from one node to another is determined by the MessagePullPolicy</para>
-               <para>By default this set to <literal>org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy</literal> which is a dummy
-               implementation which never pulls messages from one node to another.</para>
-               <para>Whether you need message redistribution or not depends on your application topology - please see the section on clustering configuration for
-               more details</para>
-               <para>If you require message redistribution then set this value to <literal>org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy</literal>
-               </para>
-               <warning>Enabling message redistribution can result in the strict JMS message ordering guarantee being lost (i.e. the order of receipt of messages from
-               a particular producer is retained). If this is not acceptable then do not enable message redistribution.</warning>
-         </section>
+	          <section id="conf.postoffice.clustered.attributes.messagepullpolicy">
+	               <title>MessagePullPolicy</title>
+	               <para>
+	                  JBoss Messaging has the ability for queues on one node to pull messages from other nodes when they have exhausted their local messages.
+	               </para>
+	               <para>This prevents messages from getting stranded on nodes with slow or no consumers, and balances out message processing across the cluster.</para>
+	               <para>How, if and when messages are pulled from one node to another is determined by the MessagePullPolicy</para>
+	               <para>By default this set to <literal>org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy</literal> which is a dummy
+	               implementation which never pulls messages from one node to another.</para>
+	               <para>Whether you need message redistribution or not depends on your application topology - please see the section on clustering configuration for
+	               more details</para>
+	               <para>If you require message redistribution then set this value to <literal>org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy</literal>
+	               </para>
+	               <warning>Enabling message redistribution can result in the strict JMS message ordering guarantee being lost (i.e. the order of receipt of messages from
+	               a particular producer is retained). If this is not acceptable then do not enable message redistribution.</warning>
+	         </section>
 
-          <section id="conf.postoffice.clustered.attributes.clusterrouterfactory">
-               <title>ClusterRouterFactory</title>
-               <para>
-                  When a message arrives on a node - JBoss Messaging needs to decide whether to route it to a local queue or a remote queue on a different node.
-               </para>
-               <para>This setting allows you to specify the factory that determines this routing</para>
-               <para>By default this set to <literal>org.jboss.messaging.core.plugin.postoffice.cluster.DefaultRouterFactory</literal> which always favours
-               a local queue if one is available otherwise it round robins amongst other queues.</para>
-               <para>The particular router factory you require depends on your application topology - please see the section on clustering configuration for
-               more details</para>
-               <para>Other values this attribute can be set to are <literal>org.jboss.messaging.core.plugin.postoffice.cluster.RoundRobinRouterFactory</literal>
-               if you do not want to favour the local queue.
-               </para>
-         </section>
+	         <section id="conf.postoffice.clustered.attributes.clusterrouterfactory">
+	               <title>ClusterRouterFactory</title>
+	               <para>
+	                  When a message arrives on a node - JBoss Messaging needs to decide whether to route it to a local queue or a remote queue on a different node.
+	               </para>
+	               <para>This setting allows you to specify the factory that determines this routing</para>
+	               <para>By default this set to <literal>org.jboss.messaging.core.plugin.postoffice.cluster.DefaultRouterFactory</literal> which always favours
+	               a local queue if one is available otherwise it round robins amongst other queues.</para>
+	               <para>The particular router factory you require depends on your application topology - please see the section on clustering configuration for
+	               more details</para>
+	               <para>Other values this attribute can be set to are <literal>org.jboss.messaging.core.plugin.postoffice.cluster.RoundRobinRouterFactory</literal>
+	               if you do not want to favour the local queue.
+	               </para>
+	         </section>
 
-          <section id="conf.postoffice.clustered.attributes.statetimeout">
-               <title>StateTimeout</title>
-               <para>
-                  The maximum time to wait when waiting for the group state to arrive when a node joins a pre-existing cluster.
-               </para>
-               <para>The default value is <literal>5000</literal> milliseconds
-               </para>
-         </section>
+	         <section id="conf.postoffice.clustered.attributes.statetimeout">
+	               <title>StateTimeout</title>
+	               <para>
+	                  The maximum time to wait when waiting for the group state to arrive when a node joins a pre-existing cluster.
+	               </para>
+	               <para>The default value is <literal>5000</literal> milliseconds
+	               </para>
+	         </section>
 
-          <section id="conf.postoffice.clustered.attributes.casttimeout">
-               <title>CastTimeout</title>
-               <para>
-                  The maximum time to wait for a reply casting message synchronously
-               </para>
-               <para>The default value is <literal>5000</literal> milliseconds
-               </para>
-         </section>
+	         <section id="conf.postoffice.clustered.attributes.casttimeout">
+	               <title>CastTimeout</title>
+	               <para>
+	                  The maximum time to wait for a reply casting message synchronously
+	               </para>
+	               <para>The default value is <literal>5000</literal> milliseconds
+	               </para>
+	         </section>
 
-         <section id="conf.postoffice.clustered.attributes.statssendperiod">
-               <title>StatsSendPeriod</title>
-               <para>
-                       When clustering, each node in the cluster will broadcast statistics periodically to inform the other nodes of their queues and the number of
-                       messages in them. This data is then used by the message redistribution policy to redistribute messages if necessary.
-                       This value represents the number of milliseconds between statistics broadcasts.
-              </para>
-              <para>
-                       The default value is <literal>10000</literal> milliseconds
-              </para>
-         </section>
+	         <section id="conf.postoffice.clustered.attributes.statssendperiod">
+	               <title>StatsSendPeriod</title>
+	               <para>
+	                       When clustering, each node in the cluster will broadcast statistics periodically to inform the other nodes of their queues and the number of
+	                       messages in them. This data is then used by the message redistribution policy to redistribute messages if necessary.
+	                       This value represents the number of milliseconds between statistics broadcasts.
+	              </para>
+	              <para>
+	                       The default value is <literal>10000</literal> milliseconds
+	              </para>
+	         </section>
 
-         <section id="conf.postoffice.clustered.attributes.syncchannelconfig">
-               <title>SyncChannelConfig</title>
-               <para>
-                    JBoss Messaging uses JGroups for all group management. This contains the JGroups stack configuration for the synchronous channel.
-              </para>
-              <para>The synchronous channel is used for sending request/reeciving responses from other nodes in the cluster</para>
-              <para>
-               The details of the JGroups configuration won't be discussed here since it is standard JGroups configuration.
-                       Detailed information on JGroups can be found in JGroups release documentation or on-line at
-                       <ulink url="http://www.jgroups.org">http://www.jgroups.org</ulink> or
-                 <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups</ulink>
-              </para>
-         </section>
+	         <section id="conf.postoffice.clustered.attributes.syncchannelconfig">
+	               <title>SyncChannelConfig</title>
+	               <para>
+	                    JBoss Messaging uses JGroups for all group management. This contains the JGroups stack configuration for the synchronous channel.
+	              </para>
+	              <para>The synchronous channel is used for sending request/reeciving responses from other nodes in the cluster</para>
+	              <para>
+	               The details of the JGroups configuration won't be discussed here since it is standard JGroups configuration.
+	                       Detailed information on JGroups can be found in JGroups release documentation or on-line at
+	                       <ulink url="http://www.jgroups.org">http://www.jgroups.org</ulink> or
+	                 <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups</ulink>
+	              </para>
+	         </section>
 
-         <section id="conf.postoffice.clustered.attributes.asyncchannelconfig">
-               <title>AsyncChannelConfig</title>
-               <para>
-                    JBoss Messaging uses JGroups for all group management. This contains the JGroups stack configuration for the asynchronous channel.
-              </para>
-              <para>The asynchronous channel is used for sending sending/receiving messages from other nodes in the cluster</para>
-              <para>
-               The details of the JGroups configuration won't be discussed here since it is standard JGroups configuration.
-                       Detailed information on JGroups can be found in JGroups release documentation or on-line at
-                       <ulink url="http://www.jgroups.org">http://www.jgroups.org</ulink> or
-                 <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups</ulink>
-              </para>
-         </section>
+	         <section id="conf.postoffice.clustered.attributes.asyncchannelconfig">
+	               <title>AsyncChannelConfig</title>
+	               <para>
+	                    JBoss Messaging uses JGroups for all group management. This contains the JGroups stack configuration for the asynchronous channel.
+	              </para>
+	              <para>The asynchronous channel is used for sending sending/receiving messages from other nodes in the cluster</para>
+	              <para>
+	               The details of the JGroups configuration won't be discussed here since it is standard JGroups configuration.
+	                       Detailed information on JGroups can be found in JGroups release documentation or on-line at
+	                       <ulink url="http://www.jgroups.org">http://www.jgroups.org</ulink> or
+	                 <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups</ulink>
+	              </para>
+	         </section>
 
-         <section id="conf.postoffice.clustered.attributes.threadpoolsize">
-               <title>ThreadPoolSize</title>
-               <para>
-                    The post office uses a thread pool for dispatching requests/handling responses from the cluster. This attribute represents the maximum size of
-                    that pool
-              </para>
-              <para>The default value of this is <literal>50</literal> threads</para>
-         </section>
+	         <section id="conf.postoffice.clustered.attributes.threadpoolsize">
+	               <title>ThreadPoolSize</title>
+	               <para>
+	                    The post office uses a thread pool for dispatching requests/handling responses from the cluster. This attribute represents the maximum size of
+	                    that pool
+	              </para>
+	              <para>The default value of this is <literal>50</literal> threads</para>
+	         </section>
 
-      </section>
-   </section>
-   </section>
+              </section>
+           </section>
+        </section>
 
 
 
-  <section id="conf.persistencemanager">
-    <title>Configuring the Persistence Manager</title>
+	<section id="conf.persistencemanager">
+	   <title>Configuring the Persistence Manager</title>
+	
+	   <para>It is the job of the persistence manager to manage all message related persistence.
+	   </para>
+	
+	   <para>
+	       JBoss Messaging ships with a JDBC Persistence Manager used for handling persistence of
+	       message data in a relational database accessed via JDBC. The Persistence Manager
+	       implementation is pluggable (the Persistence Manager is a Messaging server plug-in),
+	       this making possible to provide other implementations for persisting message data in
+	       non relational stores, file stores etc.
+	   </para>
+	
+	   <para>
+	        The configuration of "persistent" services is grouped in a
+	        <filename>xxx-persistence-service.xml</filename> file, where the actual file prefix is
+	        usually inferred from its corresponding database JDBC connection string. By default,
+	        Messaging ships with a <filename>hsqldb-persistence-service.xml</filename>, which configures
+	        the Messaging server to use the in-VM Hypersonic database instance that comes by default
+	        with any JBossAS instance.
+	   </para>
+	
+	   <warning>
+	        <para>
+	        The default Persistence Manager configuration is works out of the box with Hypersonic,
+	        however it must be stressed that Hypersonic should not be used in a production environment
+	        mainly due to its limited support for transaction isolation and its propensity to behave
+	        erratically under high load.
+	        </para>
+	        <para>
+	           The
+	           <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMQDB">Critique of Hypersonic</ulink>
+	           wiki page outlines some of the well-known issues occuring when using this database.
+	        </para>
+	   </warning>
+	
+	   <para>
+	        JBoss Messaging also ships with pre-made Persistence Manager configurations for MySQL,
+	        Oracle, PostgreSQL, Sybase and MS SQL Server. The example <filename>mysql-persistence-service.xml</filename>,
+	        <filename>oracle-persistence-service.xml</filename>,
+	        <filename>postgres-persistence-service.xml</filename> and
+	        <filename>sybase-persistence-service.xml</filename> and
+	        <filename>mssql-persistence-service.xml</filename> configuration files are available
+	        in the <filename>examples/config</filename> directory of the release bundle.
+	   </para>
+	
+	   <para>
+	        Users are encouraged to contribute their own configuration files where we will thoroughly test them before certifying them for suppported use
+	        with JBoss Messaging. The JDBC Persistence Manager has been designed
+	        to use standard SQL for the DML so writing a JDBC Persistence Manager configuration for another
+	        database is usually only a fairly simple matter of changing DDL in the configuration
+	        which is likely to be different for different databases.
+	   </para>
+	
+	   <para>
+	        The default Hypersonic persistence configuration file is listed below:
+	   </para>
+	
+	   <programlisting>
+	   
+	   &lt;mbean code="org.jboss.messaging.core.plugin.JDBCPersistenceManagerService"
+	      name="jboss.messaging:service=PersistenceManager"
+	      xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml"&gt;
+	      &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
+	      &lt;depends optional-attribute-name="TransactionManager"&gt;jboss:service=TransactionManager&lt;/depends&gt;
+	      &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;
+	      &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
+	      &lt;attribute name="UsingBatchUpdates"&gt;false&lt;/attribute&gt;
+	      &lt;attribute name="MaxParams"&gt;500&lt;/attribute&gt;
+	   &lt;/mbean&gt;
+	
+	   </programlisting>
+	
+	   <para>
+	        An example of a Persistence Manager configuration for a MySQL database follows:
+	   </para>
+	     
+	   <programlisting>
+	     
+	&lt;mbean code="org.jboss.messaging.core.plugin.JDBCPersistenceManagerService"
+	         name="jboss.messaging:service=PersistenceManager"
+	         xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml"&gt;
+	         &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
+	         &lt;depends optional-attribute-name="TransactionManager"&gt;jboss:service=TransactionManager&lt;/depends&gt;
+	         &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;
+	         &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
+	         &lt;attribute name="UsingBatchUpdates"&gt;true&lt;/attribute&gt;
+	         &lt;attribute name="SqlProperties"&gt;&lt;![CDATA[
+	   CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT, MESSAGE_ID BIGINT, TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INTEGER, SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID))
+	   CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
+	   CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
+	   CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
+	   CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
+	   CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
+	   CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY TINYINT, HEADERS MEDIUMBLOB, PAYLOAD LONGBLOB, CHANNEL_COUNT INTEGER, TYPE TINYINT, PRIMARY KEY (MESSAGE_ID))
+	   CREATE_TRANSACTION=CREATE TABLE JBM_TX (TRANSACTION_ID BIGINT, BRANCH_QUAL VARBINARY(254), FORMAT_ID INTEGER, GLOBAL_TXID VARBINARY(254), PRIMARY KEY (TRANSACTION_ID))
+	   CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME))
+	   INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
+	   DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
+	   UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
+	   UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
+	   COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
+	   COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
+	   ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
+	   ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
+	   LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
+	   LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
+	   LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
+	   UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
+	   SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
+	   SELECT_EXISTS_REF=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
+	   SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
+	   UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
+	   UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
+	   LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
+	   INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, CHANNEL_COUNT, TYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
+	   INC_CHANNEL_COUNT=UPDATE JBM_MSG SET CHANNEL_COUNT = CHANNEL_COUNT + 1 WHERE MESSAGE_ID=?
+	   DEC_CHANNEL_COUNT=UPDATE JBM_MSG SET CHANNEL_COUNT = CHANNEL_COUNT - 1 WHERE MESSAGE_ID=?
+	   DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID=? AND CHANNEL_COUNT=0
+	   MESSAGE_ID_COLUMN=MESSAGE_ID
+	   MESSAGE_EXISTS=SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ? FOR UPDATE
+	   INSERT_TRANSACTION=INSERT INTO JBM_TX (TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?)
+	   DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE TRANSACTION_ID = ?
+	   SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX
+	   SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
+	   SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
+	   UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
+	   SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
+	   INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
+	   SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
+	         ]]&gt;&lt;/attribute&gt;
+	         &lt;attribute name="MaxParams"&gt;500&lt;/attribute&gt;
+	   &lt;/mbean&gt;     
+	     
+	
+	   </programlisting>
 
-    <para>It is the job of the persistence manager to manage all message related persistence.
-    </para>
+           <section id="conf.persistencemanager.attributes">
 
 
-    <para>
-       JBoss Messaging ships with a JDBC Persistence Manager used for handling persistence of
-       message data in a relational database accessed via JDBC. The Persistence Manager
-       implementation is pluggable (the Persistence Manager is a Messaging server plug-in),
-       this making possible to provide other implementations for persisting message data in
-       non relational stores, file stores etc.
-    </para>
-
-     <para>
-        The configuration of "persistent" services is grouped in a
-        <filename>xxx-persistence-service.xml</filename> file, where the actual file prefix is
-        usually inferred from its corresponding database JDBC connection string. By default,
-        Messaging ships with a <filename>hsqldb-persistence-service.xml</filename>, which configures
-        the Messaging server to use the in-VM Hypersonic database instance that comes by default
-        with any JBossAS instance.
-     </para>
-
-     <warning>
-        <para>
-        The default Persistence Manager configuration is works out of the box with Hypersonic,
-        however it must be stressed that Hypersonic should not be used in a production environment
-        mainly due to its limited support for transaction isolation and its propensity to behave
-        erratically under high load.
-        </para>
-        <para>
-           The
-           <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMQDB">Critique of Hypersonic</ulink>
-           wiki page outlines some of the well-known issues occuring when using this database.
-        </para>
-     </warning>
-
-     <para>
-        JBoss Messaging also ships with pre-made Persistence Manager configurations for MySQL,
-        Oracle, PostgreSQL, Sybase and MS SQL Server. The example <filename>mysql-persistence-service.xml</filename>,
-        <filename>oracle-persistence-service.xml</filename>,
-        <filename>postgres-persistence-service.xml</filename> and
-        <filename>sybase-persistence-service.xml</filename> and
-        <filename>mssql-persistence-service.xml</filename> configuration files are available
-        in the <filename>examples/config</filename> directory of the release bundle.
-     </para>
-
-     <para>
-        Users are encouraged to contribute their own configuration files where we will thoroughly test them before certifying them for suppported use
-        with JBoss Messaging. The JDBC Persistence Manager has been designed
-        to use standard SQL for the DML so writing a JDBC Persistence Manager configuration for another
-        database is usually only a fairly simple matter of changing DDL in the configuration
-        which is likely to be different for different databases.
-     </para>
-
-     <para>
-        The default Hypersonic persistence configuration file is listed below:
-     </para>
-
-   <programlisting>
-
-      &lt;server&gt;
-
-         &lt;mbean code="org.jboss.messaging.core.plugin.JDBCPersistenceManagerService"
-            name="jboss.messaging:service=PersistenceManager"
-            xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml"&gt;
-            &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
-            &lt;depends optional-attribute-name="TransactionManager"&gt;jboss:service=TransactionManager&lt;/depends&gt;
-            &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;
-            &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
-            &lt;attribute name="UsingBatchUpdates"&gt;false&lt;/attribute&gt;
-            &lt;attribute name="MaxParams"&gt;500&lt;/attribute&gt;
-         &lt;/mbean&gt;
-
-         &lt;mbean code="org.jboss.messaging.core.plugin.DefaultPostOfficeService"
-            name="jboss.messaging:service=PostOffice"
-            xmbean-dd="xmdesc/DefaultPostOffice-xmbean.xml"&gt;
-            &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;
-            &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
-            &lt;depends optional-attribute-name="TransactionManager"&gt;jboss:service=TransactionManager&lt;/depends&gt;
-            &lt;attribute name="PostOfficeName"&gt;JMS&lt;/attribute&gt;
-            &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;
-            &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
-         &lt;/mbean&gt;
-
-         &lt;mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
-            name="jboss.messaging:service=JMSUserManager"
-            xmbean-dd="xmdesc/JMSUserManager-xmbean.xml"&gt;
-            &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
-            &lt;depends optional-attribute-name="TransactionManager"&gt;jboss:service=TransactionManager&lt;/depends&gt;
-            &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;
-            &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
-            &lt;attribute name="SqlProperties"&gt;&lt;![CDATA[
-      POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
-            ]]&gt;&lt;/attribute&gt;
-         &lt;/mbean&gt;
-
-      &lt;/server&gt;
-
-   </programlisting>
-
-     <para>
-        An example of a Persistence Manager configuration for a MySQL database follows:
-     </para>
-
-  <programlisting>
-
-   &lt;server&gt;
-
-      &lt;mbean code="org.jboss.messaging.core.plugin.JDBCPersistenceManagerService"
-            name="jboss.messaging:service=PersistenceManager"
-            xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml"&gt;
-            &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
-            &lt;depends optional-attribute-name="TransactionManager"&gt;jboss:service=TransactionManager&lt;/depends&gt;
-            &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;
-            &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
-            &lt;attribute name="UsingBatchUpdates"&gt;true&lt;/attribute&gt;
-            &lt;attribute name="SqlProperties"&gt;&lt;![CDATA[
-      CREATE_MESSAGE_REFERENCE=CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT, MESSAGE_ID BIGINT, TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INTEGER, SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID))
-      CREATE_IDX_MESSAGE_REF_TX=CREATE INDEX JBM_MSG_REF_TX ON JBM_MSG_REF (TRANSACTION_ID)
-      CREATE_IDX_MESSAGE_REF_ORD=CREATE INDEX JBM_MSG_REF_ORD ON JBM_MSG_REF (ORD)
-      CREATE_IDX_MESSAGE_REF_PAGE_ORD=CREATE INDEX JBM_MSG_REF_PAGE_ORD ON JBM_MSG_REF (PAGE_ORD)
-      CREATE_IDX_MESSAGE_REF_MESSAGE_ID=CREATE INDEX JBM_MSG_REF_MESSAGE_ID ON JBM_MSG_REF (MESSAGE_ID)
-      CREATE_IDX_MESSAGE_REF_SCHED_DELIVERY=CREATE INDEX JBM_MSG_REF_SCHED_DELIVERY ON JBM_MSG_REF (SCHED_DELIVERY)
-      CREATE_MESSAGE=CREATE TABLE JBM_MSG (MESSAGE_ID BIGINT, RELIABLE CHAR(1), EXPIRATION BIGINT, TIMESTAMP BIGINT, PRIORITY TINYINT, HEADERS MEDIUMBLOB, PAYLOAD LONGBLOB, CHANNEL_COUNT INTEGER, TYPE TINYINT, PRIMARY KEY (MESSAGE_ID))
-      CREATE_TRANSACTION=CREATE TABLE JBM_TX (TRANSACTION_ID BIGINT, BRANCH_QUAL VARBINARY(254), FORMAT_ID INTEGER, GLOBAL_TXID VARBINARY(254), PRIMARY KEY (TRANSACTION_ID))
-      CREATE_COUNTER=CREATE TABLE JBM_COUNTER (NAME VARCHAR(255), NEXT_ID BIGINT, PRIMARY KEY(NAME))
-      INSERT_MESSAGE_REF=INSERT INTO JBM_MSG_REF (CHANNEL_ID, MESSAGE_ID, TRANSACTION_ID, STATE, ORD, PAGE_ORD, DELIVERY_COUNT, SCHED_DELIVERY) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-      DELETE_MESSAGE_REF=DELETE FROM JBM_MSG_REF WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
-      UPDATE_MESSAGE_REF=UPDATE JBM_MSG_REF SET TRANSACTION_ID=?, STATE='-' WHERE MESSAGE_ID=? AND CHANNEL_ID=? AND STATE='C'
-      UPDATE_PAGE_ORDER=UPDATE JBM_MSG_REF SET PAGE_ORD = ? WHERE MESSAGE_ID=? AND CHANNEL_ID=?
-      COMMIT_MESSAGE_REF1=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='+'
-      COMMIT_MESSAGE_REF2=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='-'
-      ROLLBACK_MESSAGE_REF1=DELETE FROM JBM_MSG_REF WHERE TRANSACTION_ID=? AND STATE='+'
-      ROLLBACK_MESSAGE_REF2=UPDATE JBM_MSG_REF SET STATE='C', TRANSACTION_ID = NULL WHERE TRANSACTION_ID=? AND STATE='-'
-      LOAD_PAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, PAGE_ORD, SCHED_DELIVERY FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND PAGE_ORD BETWEEN ? AND ? ORDER BY PAGE_ORD
-      LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD
-      LOAD_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? ORDER BY ORD
-      UPDATE_REFS_NOT_PAGED=UPDATE JBM_MSG_REF SET PAGE_ORD = NULL WHERE PAGE_ORD BETWEEN ? AND ? AND CHANNEL_ID=?
-      SELECT_MIN_MAX_PAGE_ORD=SELECT MIN(PAGE_ORD), MAX(PAGE_ORD) FROM JBM_MSG_REF WHERE CHANNEL_ID = ?
-      SELECT_EXISTS_REF=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
-      SELECT_EXISTS_REF_MESSAGE_ID=SELECT MESSAGE_ID FROM JBM_MSG_REF WHERE MESSAGE_ID = ?
-      UPDATE_DELIVERY_COUNT=UPDATE JBM_MSG_REF SET DELIVERY_COUNT = ? WHERE CHANNEL_ID = ? AND MESSAGE_ID = ?
-      UPDATE_CHANNEL_ID=UPDATE JBM_MSG_REF SET CHANNEL_ID = ? WHERE CHANNEL_ID = ?
-      LOAD_MESSAGES=SELECT MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, TYPE FROM JBM_MSG
-      INSERT_MESSAGE=INSERT INTO JBM_MSG (MESSAGE_ID, RELIABLE, EXPIRATION, TIMESTAMP, PRIORITY, HEADERS, PAYLOAD, CHANNEL_COUNT, TYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
-      INC_CHANNEL_COUNT=UPDATE JBM_MSG SET CHANNEL_COUNT = CHANNEL_COUNT + 1 WHERE MESSAGE_ID=?
-      DEC_CHANNEL_COUNT=UPDATE JBM_MSG SET CHANNEL_COUNT = CHANNEL_COUNT - 1 WHERE MESSAGE_ID=?
-      DELETE_MESSAGE=DELETE FROM JBM_MSG WHERE MESSAGE_ID=? AND CHANNEL_COUNT=0
-      MESSAGE_ID_COLUMN=MESSAGE_ID
-      MESSAGE_EXISTS=SELECT MESSAGE_ID FROM JBM_MSG WHERE MESSAGE_ID = ? FOR UPDATE
-      INSERT_TRANSACTION=INSERT INTO JBM_TX (TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID) VALUES(?, ?, ?, ?)
-      DELETE_TRANSACTION=DELETE FROM JBM_TX WHERE TRANSACTION_ID = ?
-      SELECT_PREPARED_TRANSACTIONS=SELECT TRANSACTION_ID, BRANCH_QUAL, FORMAT_ID, GLOBAL_TXID FROM JBM_TX
-      SELECT_MESSAGE_ID_FOR_REF=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '+' ORDER BY ORD
-      SELECT_MESSAGE_ID_FOR_ACK=SELECT MESSAGE_ID, CHANNEL_ID FROM JBM_MSG_REF WHERE TRANSACTION_ID = ? AND STATE = '-' ORDER BY ORD
-      UPDATE_COUNTER=UPDATE JBM_COUNTER SET NEXT_ID = ? WHERE NAME=?
-      SELECT_COUNTER=SELECT NEXT_ID FROM JBM_COUNTER WHERE NAME=? FOR UPDATE
-      INSERT_COUNTER=INSERT INTO JBM_COUNTER (NAME, NEXT_ID) VALUES (?, ?)
-      SELECT_ALL_CHANNELS=SELECT DISTINCT(CHANNEL_ID) FROM JBM_MSG_REF
-            ]]&gt;&lt;/attribute&gt;
-            &lt;attribute name="MaxParams"&gt;500&lt;/attribute&gt;
-      &lt;/mbean&gt;
-
-      &lt;mbean code="org.jboss.messaging.core.plugin.DefaultPostOfficeService"
-         name="jboss.messaging:service=PostOffice"
-         xmbean-dd="xmdesc/DefaultPostOffice-xmbean.xml"&gt;
-         &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;
-         &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
-         &lt;depends optional-attribute-name="TransactionManager"&gt;jboss:service=TransactionManager&lt;/depends&gt;
-         &lt;attribute name="PostOfficeName"&gt;JMS&lt;/attribute&gt;
-         &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;
-         &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
-         &lt;attribute name="SqlProperties"&gt;&lt;![CDATA[
-   CREATE_POSTOFFICE_TABLE=CREATE TABLE JBM_POSTOFFICE (POSTOFFICE_NAME VARCHAR(255), NODE_ID INTEGER, QUEUE_NAME VARCHAR(1023), COND VARCHAR(1023), SELECTOR VARCHAR(1023), CHANNEL_ID BIGINT, CLUSTERED CHAR(1))
-   INSERT_BINDING=INSERT INTO JBM_POSTOFFICE (POSTOFFICE_NAME, NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED) VALUES (?, ?, ?, ?, ?, ?, ?)
-   DELETE_BINDING=DELETE FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME=? AND NODE_ID=? AND QUEUE_NAME=?
-   LOAD_BINDINGS=SELECT NODE_ID, QUEUE_NAME, COND, SELECTOR, CHANNEL_ID, CLUSTERED FROM JBM_POSTOFFICE WHERE POSTOFFICE_NAME  = ?
-         ]]&gt;&lt;/attribute&gt;
-      &lt;/mbean&gt;
-
-      &lt;mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
-         name="jboss.messaging:service=JMSUserManager"
-         xmbean-dd="xmdesc/JMSUserManager-xmbean.xml"&gt;
-         &lt;depends&gt;jboss.jca:service=DataSourceBinding,name=DefaultDS&lt;/depends&gt;
-         &lt;depends optional-attribute-name="TransactionManager"&gt;jboss:service=TransactionManager&lt;/depends&gt;
-         &lt;attribute name="DataSource"&gt;java:/DefaultDS&lt;/attribute&gt;
-         &lt;attribute name="CreateTablesOnStartup"&gt;true&lt;/attribute&gt;
-         &lt;attribute name="SqlProperties"&gt;&lt;![CDATA[
-   CREATE_USER_TABLE=CREATE TABLE JBM_USER (USER_ID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USER_ID))
-   CREATE_ROLE_TABLE=CREATE TABLE JBM_ROLE (ROLE_ID VARCHAR(32) NOT NULL, USER_ID VARCHAR(32) NOT NULL, PRIMARY KEY(USER_ID, ROLE_ID))
-   SELECT_PRECONF_CLIENTID=SELECT CLIENTID FROM JBM_USER WHERE USER_ID=?
-   POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
-         ]]&gt;&lt;/attribute&gt;
-      &lt;/mbean&gt;
-
-   &lt;/server&gt;
-
-  </programlisting>
-
-     <section id="conf.persistencemanager.attributes">
-
-
-        <title>
+              <title>
         We now discuss the MBean attributes of the PersistenceManager MBean
-        </title>
+              </title>
 
-        <section id="conf.persistencemanager.attributes.createtables">
-           <title>CreateTablesOnStartup</title>
+	      <section id="conf.persistencemanager.attributes.createtables">
+	         <title>CreateTablesOnStartup</title>
+	
+	           <para>
+	              Set this to <literal>true</literal> if you wish the Persistence Manager to attempt
+	              to create the tables (and indexes) when it starts. If the tables (or indexes)
+	              already exist a <literal>SQLException</literal> will be thrown by the JDBC driver and
+	              ignored by the Persistence Manager, allowing it to continue.
+	           </para>
+	           <para>
+	              By default the value of <literal>CreateTablesOnStartup</literal> attribute
+	              is set to <literal>true</literal>
+	           </para>
+	      </section>
 
-           <para>
-              Set this to <literal>true</literal> if you wish the Persistence Manager to attempt
-              to create the tables (and indexes) when it starts. If the tables (or indexes)
-              already exist a <literal>SQLException</literal> will be thrown by the JDBC driver and
-              ignored by the Persistence Manager, allowing it to continue.
-           </para>
-           <para>
-              By default the value of <literal>CreateTablesOnStartup</literal> attribute
-              is set to <literal>true</literal>
-           </para>
-     </section>
+	      <section id="conf.persistencemanager.attributes.batchupdates">
+	           <title>UsingBatchUpdates</title>
+	
+	           <para>
+	              Set this to <literal>true</literal> if the database supports JDBC batch updates.
+	              The JDBC Persistence Manager will then group multiple database updates in batches
+	              to aid performance.
+	           </para>
+	         <para>
+	            By default the value of <literal>UsingBatchUpdates</literal> attribute
+	            is set to <literal>false</literal>
+	         </para>
+	      </section>
 
-      <section id="conf.persistencemanager.attributes.batchupdates">
-           <title>UsingBatchUpdates</title>
+	      <section id="conf.persistencemanager.attributes.binarystream">
+	           <title>UsingBinaryStream</title>
+	
+	           <para>
+	              Set this to <literal>true</literal> if you want messages to be store and read using a JDBC binary stream rather than using
+	              getBytes(), setBytes(). Some database has limits on the maximum number of bytes that can be get/set using getBytes()/setBytes().
+	           </para>
+	         <para>
+	            By default the value of <literal>UsingBinaryStream</literal> attribute
+	            is set to <literal>true</literal>
+	         </para>
+	      </section>
 
-           <para>
-              Set this to <literal>true</literal> if the database supports JDBC batch updates.
-              The JDBC Persistence Manager will then group multiple database updates in batches
-              to aid performance.
-           </para>
-         <para>
-            By default the value of <literal>UsingBatchUpdates</literal> attribute
-            is set to <literal>false</literal>
-         </para>
-       </section>
+	      <section id="conf.persistencemanager.attributes.trailingbyte">
+	           <title>UsingTrailingByte</title>
+	
+	           <para>
+	              Certain version of Sybase are known to truncate blobs if they have trailing zeros. To prevent this if this attribute is set to
+	              <literal>true</literal> then a trailing non zero byte will be added and removed to each blob before and after persistence to prevent
+	              the database from truncating it. Currently this is only known to be necessary for Sybase.
+	           </para>
+	         <para>
+	            By default the value of <literal>UsingTrailingByte</literal> attribute
+	            is set to <literal>false</literal>
+	         </para>
+	      </section>
 
-      <section id="conf.persistencemanager.attributes.binarystream">
-           <title>UsingBinaryStream</title>
+	      <section id="conf.persistencemanager.attributes.sqlproperties">
+	           <title>SQLProperties</title>
+	
+	           <para>
+	              This is where the DDL and DML for the particular database is specified.
+	              If a particular DDL or DML statement is not overridden, the default Hypersonic
+	              configuration will be used for that statement.
+	           </para>
+	      </section>
 
-           <para>
-              Set this to <literal>true</literal> if you want messages to be store and read using a JDBC binary stream rather than using
-              getBytes(), setBytes(). Some database has limits on the maximum number of bytes that can be get/set using getBytes()/setBytes().
-           </para>
-         <para>
-            By default the value of <literal>UsingBinaryStream</literal> attribute
-            is set to <literal>true</literal>
-         </para>
-       </section>
+	      <section id="conf.persistencemanager.attributes.maxparams">
+	          <title>MaxParams</title>
+	
+	          <para>
+	             When loading messages the persistence manager will generate prepared statements with many parameters. This value tells the persistence
+	             manager what the absolute maximum number of parameters are allowable per prepared statement.
+	
+	          </para>
+	          <para>
+	           By default the value of <literal>MaxParams</literal> attribute
+	           is set to <literal>100</literal>
+	        </para>
+	      </section>
 
-      <section id="conf.persistencemanager.attributes.trailingbyte">
-           <title>UsingTrailingByte</title>
+           </section> <!-- end conf.persistencemanager.attributes -->
+           
+        </section> <!-- end conf.persistencemanager -->    
 
-           <para>
-              Certain version of Sybase are known to truncate blobs if they have trailing zeros. To prevent this if this attribute is set to
-              <literal>true</literal> then a trailing non zero byte will be added and removed to each blob before and after persistence to prevent
-              the database from truncating it. Currently this is only known to be necessary for Sybase.
-           </para>
-         <para>
-            By default the value of <literal>UsingTrailingByte</literal> attribute
-            is set to <literal>false</literal>
-         </para>
-       </section>
+        <section id="conf.jmsusermanager">
+           <title>Configuring the JMS user manager</title>
 
-       <section id="conf.persistencemanager.attributes.sqlproperties">
-           <title>SQLProperties</title>
+	   <para>The JMS user manager handles the mapping of pre-configured client IDs to users and also managers the user and role tables which may or
+	      may not be used depending on which login module you have configured</para>
+	
+	   <para>Here is an example JMSUserManager configuration</para>
 
-           <para>
-              This is where the DDL and DML for the particular database is specified.
-              If a particular DDL or DML statement is not overridden, the default Hypersonic
-              configuration will be used for that statement.
-           </para>
-        </section>
+           <programlisting>
 
-        <section id="conf.persistencemanager.attributes.maxparams">
-          <title>MaxParams</title>
-
-          <para>
-             When loading messages the persistence manager will generate prepared statements with many parameters. This value tells the persistence
-             manager what the absolute maximum number of parameters are allowable per prepared statement.
-
-          </para>
-          <para>
-           By default the value of <literal>MaxParams</literal> attribute
-           is set to <literal>100</literal>
-        </para>
-       </section>
-
-    </section>
-
-   </section>
-
-
- <section id="conf.jmsusermanager">
-   <title>Configuring the JMS user manager</title>
-
-      <para>The JMS user manager handles the mapping of pre-configured client IDs to users and also managers the user and role tables which may or
-      may not be used depending on which login module you have configured</para>
-
-      <para>Here is an example JMSUserManager configuration</para>
-
-      <programlisting>
-
    &lt;mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
       name="jboss.messaging:service=JMSUserManager"
       xmbean-dd="xmdesc/JMSUserManager-xmbean.xml"&gt;
@@ -1175,80 +1108,80 @@
       ]]&gt;&lt;/attribute&gt;
    &lt;/mbean&gt;
 
-      </programlisting>
+           </programlisting>
 
-        <section id="conf.jmsusermanager.attributes">
+           <section id="conf.jmsusermanager.attributes">
 
 
-        <title>
-        We now discuss the MBean attributes of the PersistenceManager MBean
-        </title>
+	      <title>
+	        We now discuss the MBean attributes of the JMSUserManager MBean
+	      </title>
 
-        <section id="conf.jmsusermanager.attributes.createtables">
-           <title>CreateTablesOnStartup</title>
+	      <section id="conf.jmsusermanager.attributes.createtables">
+	           <title>CreateTablesOnStartup</title>
+	
+	           <para>
+	              Set this to <literal>true</literal> if you wish the JMS user manager to attempt
+	              to create the tables (and indexes) when it starts. If the tables (or indexes)
+	              already exist a <literal>SQLException</literal> will be thrown by the JDBC driver and
+	              ignored by the Persistence Manager, allowing it to continue.
+	           </para>
+	           <para>
+	              By default the value of <literal>CreateTablesOnStartup</literal> attribute
+	              is set to <literal>true</literal>
+	           </para>
+	      </section>
 
-           <para>
-              Set this to <literal>true</literal> if you wish the JMS user manager to attempt
-              to create the tables (and indexes) when it starts. If the tables (or indexes)
-              already exist a <literal>SQLException</literal> will be thrown by the JDBC driver and
-              ignored by the Persistence Manager, allowing it to continue.
-           </para>
-           <para>
-              By default the value of <literal>CreateTablesOnStartup</literal> attribute
-              is set to <literal>true</literal>
-           </para>
-     </section>
+	      <section id="conf.jmsusermanager.attributes.batchupdates">
+	           <title>UsingBatchUpdates</title>
+	
+	           <para>
+	              Set this to <literal>true</literal> if the database supports JDBC batch updates.
+	              The JDBC Persistence Manager will then group multiple database updates in batches
+	              to aid performance.
+	           </para>
+	         <para>
+	            By default the value of <literal>UsingBatchUpdates</literal> attribute
+	            is set to <literal>false</literal>
+	         </para>
+	      </section>
 
-      <section id="conf.jmsusermanager.attributes.batchupdates">
-           <title>UsingBatchUpdates</title>
 
-           <para>
-              Set this to <literal>true</literal> if the database supports JDBC batch updates.
-              The JDBC Persistence Manager will then group multiple database updates in batches
-              to aid performance.
-           </para>
-         <para>
-            By default the value of <literal>UsingBatchUpdates</literal> attribute
-            is set to <literal>false</literal>
-         </para>
-       </section>
+	      <section id="conf.jmsusermanager.attributes.sqlproperties">
+	           <title>SQLProperties</title>
+	
+	           <para>
+	              This is where the DDL and DML for the particular database is specified.
+	              If a particular DDL or DML statement is not overridden, the default Hypersonic
+	              configuration will be used for that statement.
+	           </para>
+	
+	           <para>
+	           Default user and role data can also be specified here. Any data to be inserted must be specified with property names starting with
+	           <literal>POPULATE.TABLES</literal> as in the above example.
+	           </para>
+	      </section>
 
 
-       <section id="conf.jmsusermanager.attributes.sqlproperties">
-           <title>SQLProperties</title>
+           </section>  <!-- end conf.jmsusermanager.attributes -->
 
-           <para>
-              This is where the DDL and DML for the particular database is specified.
-              If a particular DDL or DML statement is not overridden, the default Hypersonic
-              configuration will be used for that statement.
-           </para>
+        </section> <!-- end.conf.jmsusermanager -->
 
-           <para>
-           Default user and role data can also be specified here. Any data to be inserted must be specified with property names starting with
-           <literal>POPULATE.TABLES</literal> as in the above example.
-           </para>
-        </section>
 
+        <section id="conf.destination">
+           <title>Configuring Destinations</title>
 
-     </section>
+           <section id="conf.preconf.destinations">
+              <title>Pre-configured destinations</title>
 
-  </section>
+	      <para>
+	           JBoss Messaging  ships with a default set of pre-configured destinations that will be
+	           deployed during the server start up. The file that contains configuration for these
+	           destinations is <filename>destinations-service.xml</filename>. A section of
+	           this file is listed below:
+	      </para>
 
-
-  <section id="conf.destination">
-    <title>Configuring Destinations</title>
-
-<section id="conf.preconf.destinations">
-        <title>Pre-configured destinations</title>
-
-        <para>
-           JBoss Messaging  ships with a default set of pre-configured destinations that will be
-           deployed during the server start up. The file that contains configuration for these
-           destinations is <filename>destinations-service.xml</filename>. A section of
-           this file is listed below:
-        </para>
-
-        <programlisting>
+              <programlisting>
    &lt;!--
       The Default Dead Letter Queue. This destination is a dependency of an EJB MDB container.
    --&gt;
@@ -1363,923 +1296,971 @@
       &lt;attribute name="Clustered"&gt;true&lt;/attribute&gt;
    &lt;/mbean&gt;
 ....
-        </programlisting>
+              </programlisting>
 
-    </section>
+           </section> <!-- end conf.preconf.destinations -->
 
 
-    <section id="conf.destination.queue">
+           <section id="conf.destination.queue">
 
-       <title>Configuring queues</title>
+              <title>Configuring queues</title>
 
-        <section id="conf.destination.queue.attributes">
+                 <section id="conf.destination.queue.attributes">
 
-            <title>
-            We now discuss the MBean attributes of the Queue MBean
-            </title>
+	         <title>
+	            We now discuss the attributes of the Queue MBean
+	         </title>
 
-               <section id="conf.destination.queue.attributes.name">
+                 <section id="conf.destination.queue.attributes.name">
                   <title>Name</title>
                   <para>The name of the queue</para>
-               </section>
+                 </section>
 
-               <section id="conf.destination.queue.attributes.jndiName">
+                 <section id="conf.destination.queue.attributes.jndiName">
                    <title>JNDIName</title>
                    <para>The JNDI name where the queue is bound</para>
-               </section>
+                 </section>
 
-               <section id="conf.destination.queue.attributes.dlq">
+                 <section id="conf.destination.queue.attributes.dlq">
                     <title>DLQ</title>
                     <para>The DLQ used for this queue. Overrides any value set on the ServerPeer config</para>
-               </section>
+                 </section>
 
-               <section id="conf.destination.queue.attributes.expiryqueue">
+                 <section id="conf.destination.queue.attributes.expiryqueue">
                     <title>ExpiryQueue</title>
                     <para>The Expiry queue used for this queue. Overrides any value set on the ServerPeer config</para>
-               </section>
+                 </section>
 
-               <section id="conf.destination.queue.attributes.redeliverydelay">
+                 <section id="conf.destination.queue.attributes.redeliverydelay">
                     <title>RedeliveryDelay</title>
                     <para>The redlivery delay to be used for this queue. Overrides any value set on the ServerPeer config</para>
-               </section>
+                 </section>
 
-              <section id="conf.destination.queue.attributes.security">
-               <title>Destination Security Configuration</title>
+                 <section id="conf.destination.queue.attributes.security">
+                    <title>Destination Security Configuration</title>
 
-                 <para>
+                    <para>
                     <literal>SecurityConfig</literal> - allows you to determine which roles are allowed
                     to read, write and create on the destination. It has exactly the same syntax and
                     semantics as the security configuration in JBossMQ destinations.
-                 </para>
+                    </para>
 
-                 <para>
-                    The <literal>SecurityConfig</literal> element should contain one
-                    <literal>&lt;security&gt;</literal> element. The <literal>&lt;security&gt;</literal>
-                    element can contain multiple <literal>&lt;role&gt;</literal> elements.
-                    Each <literal>&lt;role&gt;</literal> element defines the access for that
-                    particular role.
-                 </para>
+	            <para>
+	                    The <literal>SecurityConfig</literal> element should contain one
+	                    <literal>&lt;security&gt;</literal> element. The <literal>&lt;security&gt;</literal>
+	                    element can contain multiple <literal>&lt;role&gt;</literal> elements.
+	                    Each <literal>&lt;role&gt;</literal> element defines the access for that
+	                    particular role.
+	            </para>
 
-                 <para>
+                    <para>
                     If the <literal>read</literal> attribute is <literal>true</literal> then that role
                     will be able to read (create consumers, receive messaages or browse) this destination.
-                 </para>
+                    </para>
 
-                 <para>
+                    <para>
                     If the <literal>write</literal> attribute is <literal>true</literal> then that role
                     will be able to write (create producers or send messages) to this destination.
-                 </para>
+                    </para>
 
-                 <para>
+                    <para>
                     If the <literal>create</literal> attribute is <literal>true</literal> then that role
                     will be able to create durable subscriptions on this destination.
-                 </para>
+                    </para>
 
-                 <para>
+                    <para>
                     Note that the security configuration for a destination is optional. If a
                     <literal>SecurityConfig</literal> element is not specifed then the default
                     security configuration from the Server Peer will be used.
-                 </para>
-              </section>
+                    </para>
+                 </section>
 
-           <section id="conf.destination.queue.attributes.paging">
-              <title>Destination paging parameters</title>
+                 <section id="conf.destination.queue.attributes.paging">
+                    <title>Destination paging parameters</title>
 
-              <para>
-                 'Pageable Channels' are a sophisticated new feature available in JBoss Messaging.
-              </para>
+	            <para>
+	                 'Pageable Channels' are a sophisticated new feature available in JBoss Messaging.
+	            </para>
+	
+	            <para>
+	                 If your application needs to support very large queues or subscriptions containing
+	                 potentially millions of messages, then it's not possible to store them all in
+	                 memory at once.
+	            </para>
 
-              <para>
-                 If your application needs to support very large queues or subscriptions containing
-                 potentially millions of messages, then it's not possible to store them all in
-                 memory at once.
-              </para>
-
-              <para>
+                    <para>
                  JBoss Messaging solves this problem but letting you specify the
                  maximum number of messages that can be stored in memory at any one time,
                  on a queue-by-queue, or topic-by-topic basis. JBoss Messaging then pages messages
                  to and from storage transparently in blocks, allowing queues and subscriptions to
                  grow to very large sizes without any performance degradation as channel size increases.
-              </para>
+                    </para>
 
-              <para>
+                    <para>
                  This has been tested with in excess of 10 million 2K messages on very basic hardware
                  and has the potential to scale to much larger number of messages.
-              </para>
+                    </para>
 
-              <para>
-                 The individual parameters are:
-              </para>
+	            <para>
+	                 The individual parameters are:
+	            </para>
+	
+	            <para>
+	                 <literal>FullSize</literal> - this is the maximum number of messages held by the
+	                 queue or topic subscriptions in memory at any one time. The actual queue or
+	                 subscription can hold many more messages than this but these are paged to and
+	                 from storage as necessary as messages are added or consumed.
+	            </para>
+	
+	            <para>
+	                 <literal>PageSize</literal> - When loading messages from the queue or subscrition
+	                 this is the maximum number of messages to pre-load in one operation.
+	            </para>
+	
+	            <para>
+	                 <literal>DownCacheSize</literal> - When paging messages to storage from the queue
+	                 they first go into a "Down Cache" before being written to storage. This enables the
+	                 write to occur as a single operation thus aiding performance. This setting determines
+	                 the max number of messages that the Down Cache will hold before they are flushed
+	                 to storage.
+	            </para>
 
-              <para>
-                 <literal>FullSize</literal> - this is the maximum number of messages held by the
-                 queue or topic subscriptions in memory at any one time. The actual queue or
-                 subscription can hold many more messages than this but these are paged to and
-                 from storage as necessary as messages are added or consumed.
-              </para>
-
-              <para>
-                 <literal>PageSize</literal> - When loading messages from the queue or subscrition
-                 this is the maximum number of messages to pre-load in one operation.
-              </para>
-
-              <para>
-                 <literal>DownCacheSize</literal> - When paging messages to storage from the queue
-                 they first go into a "Down Cache" before being written to storage. This enables the
-                 write to occur as a single operation thus aiding performance. This setting determines
-                 the max number of messages that the Down Cache will hold before they are flushed
-                 to storage.
-              </para>
-
-              <para>
+                 <para>
                  If no values for <literal>FullSize</literal>, <literal>PageSize</literal>,
                  or <literal>DownCacheSize</literal> are specified they will default to values
                  75000, 2000, 2000 respectively.
-              </para>
+                 </para>
 
-              <para>
+                 <para>
                  If you want to specify the paging parameters used for temporary queues then you need to specify them
                  on the appropriate connection factory.
                  See connection factory configuration for details.
-              </para>
-           </section>
+                 </para>
+              </section>
 
-           <section id="conf.destination.queue.attributes.createdprogrammatically">
-               <title>CreatedProgrammatically</title>
+              <section id="conf.destination.queue.attributes.createdprogrammatically">
+                 <title>CreatedProgrammatically</title>
 
-               <para>
+                 <para>
                  Returns <literal>true</literal> if the queue was created programmatically
-              </para>
-          </section>
+                 </para>
+              </section>
 
-           <section id="conf.destination.queue.attributes.messagecount">
-               <title>MessageCount</title>
+              <section id="conf.destination.queue.attributes.messagecount">
+                 <title>MessageCount</title>
 
-               <para>
+                 <para>
                  Returns the total number of messages in the queue = number not being delivered + number being delivered + number being scheduled
-              </para>
-          </section>
+                 </para>
+              </section>
 
-           <section id="conf.destination.queue.attributes.scheduledmessagecount">
-               <title>ScheduledMessageCount</title>
+              <section id="conf.destination.queue.attributes.scheduledmessagecount">
+                 <title>ScheduledMessageCount</title>
 
-               <para>
-                 Returns the  number of scheduled messages in the queue. This is the number of messages scheduled to be delivered at a later date.
-              </para>
-          </section>
+                 <para>
+                 Returns the  number of scheduled messages in the queue.
+                 This is the number of messages scheduled to be delivered at a later date.
+                 </para>
+              
+                 <para>Scheduled delivery is a feature of JBoss Messaging where you can send a message and
+              specify the earliest time at which it will be delivered.
+              E.g. you can send a message now, but the message won't actually be delivered until 2 hours time.
+                 </para>
+              
+                 <para>To do this, you just need to set the following header in the message before sending:</para>
+              
+                 <programlisting>
+              
+              long now = System.currentTimeMillis();
+         
+              Message msg = sess.createMessage();  
+                  
+              msg.setLongProperty(JBossMessage.JMS_JBOSS_SCHEDULED_DELIVERY_PROP_NAME, now + 1000 * 60 * 60 * 2);
+              
+              prod.send(msg);
+                            
+                 </programlisting>
+              </section>
 
-           <section id="conf.destination.queue.attributes.maxsize">
-               <title>MaxSize</title>
+              <section id="conf.destination.queue.attributes.maxsize">
+                 <title>MaxSize</title>
 
-               <para>
+                 <para>
                  A maximum size (in number of messages) can be specified for a queue. Any messages that arrive beyond this point will be dropped. The default is
                  <literal>-1</literal> which is unbounded.
-              </para>
-          </section>
+                 </para>
+              </section>
 
-           <section id="conf.destination.queue.attributes.clustered">
-               <title>Clustered</title>
+              <section id="conf.destination.queue.attributes.clustered">
+                 <title>Clustered</title>
 
-               <para>
+                 <para>
                  Clustered destinations must have this set to <literal>true</literal>
-              </para>
-          </section>
+                 </para>
+              </section>
 
-           <section id="conf.destination.queue.attributes.messagecounter">
-               <title>MessageCounter</title>
+              <section id="conf.destination.queue.attributes.messagecounter">
+                 <title>MessageCounter</title>
 
-               <para>
+                 <para>
                  Each queue maintains a message counter.
-              </para>
-          </section>
+                 </para>
+              </section>
 
-           <section id="conf.destination.queue.attributes.messagecounterstats">
-               <title>MessageCounterStatistics</title>
+              <section id="conf.destination.queue.attributes.messagecounterstats">
+                 <title>MessageCounterStatistics</title>
 
-               <para>
+                 <para>
                  The statistics for the message counter
-              </para>
-          </section>
+                 </para>
+              </section>
 
-           <section id="conf.destination.queue.attributes.messagecounterhistorydaylimit">
-               <title>MessageCounterHistoryDayLimit</title>
+              <section id="conf.destination.queue.attributes.messagecounterhistorydaylimit">
+                 <title>MessageCounterHistoryDayLimit</title>
 
-               <para>
+                 <para>
                  The maximum number of days to hold message counter history for. Overrides any value set on the ServerPeer.
-              </para>
-          </section>
+                 </para>
+              </section>
 
-           <section id="conf.destination.queue.attributes.consumercount">
-               <title>ConsumerCount</title>
+              <section id="conf.destination.queue.attributes.consumercount">
+                 <title>ConsumerCount</title>
 
-               <para>
+                 <para>
                  The number of consumers currently consuming from the queue.
-              </para>
-          </section>
+                 </para>
+              </section>
 
-     </section>
+           </section>
 
 
-     <section id="conf.destination.queue.operations">
+           <section id="conf.destination.queue.operations">
 
-         <title>
+              <title>
              We now discuss the MBean operations of the Queue MBean
-         </title>
+              </title>
 
-         <section id="conf.destination.queue.operations.removeallmessages">
-             <title>RemoveAllMessages</title>
+	      <section id="conf.destination.queue.operations.removeallmessages">
+	          <title>RemoveAllMessages</title>
+	
+	              <para>
+	                Remove (and delete) all messages from the queue.
+	                <warning>Use this with caution. It will permanently delete all messages from the queue</warning>.	                
+	             </para>
+	      </section>
 
-              <para>
-                Remove (and delete) all messages from the queue.
-                <warning>Use this with caution. It will permanently delete all messages from the queue</warning>
-             </para>
-         </section>
+	      <section id="conf.destination.queue.operations.listallmessages">
+	             <title>ListAllMessages</title>
+	
+	              <para>
+	                List all messages currently in the queue
+	             </para>
+	             <para>There are two overloaded versions of this operation: One takes a JMS selector as an argument, the other does not. By using the selector
+	             you can retrieve a subset of the messages in the queue that match the criteria</para>
+	      </section>
 
-         <section id="conf.destination.queue.operations.listallmessages">
-             <title>ListAllMessages</title>
+              <section id="conf.destination.queue.operations.listdurablemessages">
+                  <title>ListDurableMessages</title>
 
-              <para>
-                List all messages currently in the queue
-             </para>
-             <para>There are two overloaded versions of this operation: One takes a JMS selector as an argument, the other does not. By using the selector
-             you can retrieve a subset of the messages in the queue that match the criteria</para>
-         </section>
-
-         <section id="conf.destination.queue.operations.listdurablemessages">
-             <title>ListDurableMessages</title>
-
-              <para>
+                 <para>
                 As listAllMessages but only lists the durable messages
-             </para>
-             <para>There are two overloaded versions of this operation: One takes a JMS selector as an argument, the other does not. By using the selector
+                 </para>
+                 <para>There are two overloaded versions of this operation: One takes a JMS selector as an argument, the other does not. By using the selector
              you can retrieve a subset of the messages in the queue that match the criteria</para>
-         </section>
+              </section>
 
 
-         <section id="conf.destination.queue.operations.listnondurablemessages">
-             <title>ListNonDurableMessages</title>
+              <section id="conf.destination.queue.operations.listnondurablemessages">
+                 <title>ListNonDurableMessages</title>
 
-              <para>
+                 <para>
                 As listAllMessages but only lists the non durable messages
-             </para>
-             <para>There are two overloaded versions of this operation: One takes a JMS selector as an argument, the other does not. By using the selector
+                 </para>
+                 <para>There are two overloaded versions of this operation: One takes a JMS selector as an argument, the other does not. By using the selector
              you can retrieve a subset of the messages in the queue that match the criteria</para>
-         </section>
+              </section>
 
-         <section id="conf.destination.queue.operations.resetmessagecounter">
-             <title>ResetMessageCounter</title>
+              <section id="conf.destination.queue.operations.resetmessagecounter">
+                 <title>ResetMessageCounter</title>
 
-              <para>
+                    <para>
                 Resets the message counter to zero.
-             </para>
-         </section>
+                    </para>
+              </section>
 
-         <section id="conf.destination.queue.operations.resetmessagecounterhistory">
-             <title>ResetMessageCounterHistory</title>
+	      <section id="conf.destination.queue.operations.resetmessagecounterhistory">
+	             <title>ResetMessageCounterHistory</title>
+	
+	              <para>
+	                Resets the message counter history.
+	             </para>
+	      </section>
+	
+	      <section id="conf.destination.queue.operations.listmessagecounterashtml">
+	             <title>ListMessageCounterAsHTML</title>
+	
+	              <para>
+	                Lists the message counter in an easy to display HTML format
+	             </para>
+	      </section>
 
-              <para>
-                Resets the message counter history.
-             </para>
-         </section>
+              <section id="conf.destination.queue.operations.listmessagecounterhistoryashtml">
+                 <title>ListMessageCounterHistoryAsHTML</title>
 
-         <section id="conf.destination.queue.operations.listmessagecounterashtml">
-             <title>ListMessageCounterAsHTML</title>
-
-              <para>
-                Lists the message counter in an easy to display HTML format
-             </para>
-         </section>
-
-         <section id="conf.destination.queue.operations.listmessagecounterhistoryashtml">
-             <title>ListMessageCounterHistoryAsHTML</title>
-
-              <para>
+                 <para>
                 Lists the message counter history in an easy to display HTML format
-             </para>
-         </section>
+                 </para>
+              </section>
 
+           </section>
 
-     </section>
+        </section>
 
-  </section>
+        <section id="conf.destination.topics">
 
+          <title>Configuring topics</title>
 
+             <section id="conf.destination.topic.attributes">
 
-
-  <section id="conf.destination.topics">
-
-       <title>Configuring topics</title>
-
-        <section id="conf.destination.topic.attributes">
-
-            <title>
+                <title>
             We now discuss the MBean attributes of the Topic MBean
-            </title>
+                </title>
 
-               <section id="conf.destination.topic.attributes.name">
+                <section id="conf.destination.topic.attributes.name">
                   <title>Name</title>
                   <para>The name of the topic</para>
-               </section>
+                </section>
 
-               <section id="conf.destination.topic.attributes.jndiName">
+                <section id="conf.destination.topic.attributes.jndiName">
                    <title>JNDIName</title>
                    <para>The JNDI name where the topic is bound</para>
-               </section>
+                </section>
 
-               <section id="conf.destination.topic.attributes.dlq">
+                <section id="conf.destination.topic.attributes.dlq">
                     <title>DLQ</title>
                     <para>The DLQ used for this topic. Overrides any value set on the ServerPeer config</para>
-               </section>
+                </section>
 
-               <section id="conf.destination.topic.attributes.expiryqueue">
+                <section id="conf.destination.topic.attributes.expiryqueue">
                     <title>ExpiryQueue</title>
                     <para>The Expiry queue used for this topic. Overrides any value set on the ServerPeer config</para>
-               </section>
+                </section>
 
-               <section id="conf.destination.topic.attributes.redeliverydelay">
+                <section id="conf.destination.topic.attributes.redeliverydelay">
                     <title>RedeliveryDelay</title>
                     <para>The redelivery delay to be used for this topic. Overrides any value set on the ServerPeer config</para>
-               </section>
+                </section>
 
-              <section id="conf.destination.topic.attributes.security">
-               <title>Destination Security Configuration</title>
+                <section id="conf.destination.topic.attributes.security">
+                   <title>Destination Security Configuration</title>
 
-                 <para>
+                   <para>
                     <literal>SecurityConfig</literal> - allows you to determine which roles are allowed
                     to read, write and create on the destination. It has exactly the same syntax and
                     semantics as the security configuration in JBossMQ destinations.
-                 </para>
+                   </para>
 
-                 <para>
+                   <para>
                     The <literal>SecurityConfig</literal> element should contain one
                     <literal>&lt;security&gt;</literal> element. The <literal>&lt;security&gt;</literal>
                     element can contain multiple <literal>&lt;role&gt;</literal> elements.
                     Each <literal>&lt;role&gt;</literal> element defines the access for that
                     particular role.
-                 </para>
+                   </para>
 
-                 <para>
+                   <para>
                     If the <literal>read</literal> attribute is <literal>true</literal> then that role
                     will be able to read (create consumers, receive messaages or browse) this destination.
-                 </para>
+                   </para>
 
-                 <para>
+                   <para>
                     If the <literal>write</literal> attribute is <literal>true</literal> then that role
                     will be able to write (create producers or send messages) to this destination.
-                 </para>
+                   </para>
 
-                 <para>
+                   <para>
                     If the <literal>create</literal> attribute is <literal>true</literal> then that role
                     will be able to create durable subscriptions on this destination.
-                 </para>
+                   </para>
 
-                 <para>
+                   <para>
                     Note that the security configuration for a destination is optional. If a
                     <literal>SecurityConfig</literal> element is not specifed then the default
                     security configuration from the Server Peer will be used.
-                 </para>
-              </section>
+                   </para>
+                </section>
 
-           <section id="conf.destination.topic.attributes.paging">
-              <title>Destination paging parameters</title>
+                <section id="conf.destination.topic.attributes.paging">
+                   <title>Destination paging parameters</title>
 
-              <para>
+                   <para>
                  'Pageable Channels' are a sophisticated new feature available in JBoss Messaging.
-              </para>
+                   </para>
 
-              <para>
+                   <para>
                  If your application needs to support very large queues or subscriptions containing
                  potentially millions of messages, then it's not possible to store them all in
                  memory at once.
-              </para>
+                   </para>
 
-              <para>
+                   <para>
                  JBoss Messaging solves this problem but letting you specify the
                  maximum number of messages that can be stored in memory at any one time,
                  on a queue-by-queue, or topic-by-topic basis. JBoss Messaging then pages messages
                  to and from storage transparently in blocks, allowing queues and subscriptions to
                  grow to very large sizes without any performance degradation as channel size increases.
-              </para>
+                   </para>
 
-              <para>
+                   <para>
                  This has been tested with in excess of 10 million 2K messages on very basic hardware
                  and has the potential to scale to much larger number of messages.
-              </para>
+                   </para>
 
-              <para>
+                   <para>
                  The individual parameters are:
-              </para>
+                   </para>
 
-              <para>
-                 <literal>FullSize</literal> - this is the maximum number of messages held by the
-                 queue or topic subscriptions in memory at any one time. The actual queue or
-                 subscription can hold many more messages than this but these are paged to and
-                 from storage as necessary as messages are added or consumed.
-              </para>
+	           <para>
+	                 <literal>FullSize</literal> - this is the maximum number of messages held by the
+	                 queue or topic subscriptions in memory at any one time. The actual queue or
+	                 subscription can hold many more messages than this but these are paged to and
+	                 from storage as necessary as messages are added or consumed.
+	           </para>
+	
+	           <para>
+	                 <literal>PageSize</literal> - When loading messages from the queue or subscrition
+	                 this is the maximum number of messages to pre-load in one operation.
+	           </para>
 
-              <para>
-                 <literal>PageSize</literal> - When loading messages from the queue or subscrition
-                 this is the maximum number of messages to pre-load in one operation.
-              </para>
-
-              <para>
-                 <literal>DownCacheSize</literal> - When paging messages to storage from the queue
+                   <para>
+                      <literal>DownCacheSize</literal> - When paging messages to storage from the queue
                  they first go into a "Down Cache" before being written to storage. This enables the
                  write to occur as a single operation thus aiding performance. This setting determines
                  the max number of messages that the Down Cache will hold before they are flushed
                  to storage.
-              </para>
+                   </para>
 
-              <para>
+                   <para>
                  If no values for <literal>FullSize</literal>, <literal>PageSize</literal>,
                  or <literal>DownCacheSize</literal> are specified they will default to values
                  75000, 2000, 2000 respectively.
-              </para>
+                   </para>
 
-              <para>
+                   <para>
                  If you want to specify the paging parameters used for temporary queues then you need to specify them
                  on the appropriate connection factory.
                  See connection factory configuration for details.
-              </para>
-           </section>
+                   </para>
+                </section>
 
-           <section id="conf.destination.topic.attributes.createdprogrammatically">
-               <title>CreatedProgrammatically</title>
+                <section id="conf.destination.topic.attributes.createdprogrammatically">
+                   <title>CreatedProgrammatically</title>
 
-               <para>
+                      <para>
                  Returns <literal>true</literal> if the topic was created programmatically
-              </para>
-          </section>
+                      </para>
+                </section>
 
-           <section id="conf.destination.topic.attributes.maxsize">
-               <title>MaxSize</title>
+                <section id="conf.destination.topic.attributes.maxsize">
+                   <title>MaxSize</title>
 
-               <para>
+                   <para>
                  A maximum size (in number of messages) can be specified for a topic subscription. Any messages that arrive beyond this point will be dropped. The default is
                  <literal>-1</literal> which is unbounded.
-              </para>
-          </section>
+                   </para>
+                </section>
 
-           <section id="conf.destination.topic.attributes.clustered">
-               <title>Clustered</title>
+           	<section id="conf.destination.topic.attributes.clustered">
+	           <title>Clustered</title>
+	
+	               <para>
+	                 Clustered destinations must have this set to <literal>true</literal>
+	              </para>
+	        </section>
 
-               <para>
-                 Clustered destinations must have this set to <literal>true</literal>
-              </para>
-          </section>
+                <section id="conf.destination.topic.attributes.messagecounterhistorydaylimit">
+                   <title>MessageCounterHistoryDayLimit</title>
 
-           <section id="conf.destination.topic.attributes.messagecounterhistorydaylimit">
-               <title>MessageCounterHistoryDayLimit</title>
-
-               <para>
+                   <para>
                  The maximum number of days to hold message counter history for. Overrides any value set on the ServerPeer.
-              </para>
-          </section>
+                   </para>
+                </section>
 
-           <section id="conf.destination.topic.attributes.messagecounters">
-               <title>MessageCounters</title>
+                <section id="conf.destination.topic.attributes.messagecounters">
+                   <title>MessageCounters</title>
 
-               <para>
+                   <para>
                  Return a list of the message counters for the subscriptions of this topic.
-              </para>
-          </section>
+                   </para>
+                </section>
 
-           <section id="conf.destination.topic.attributes.allmessagecount">
-               <title>AllMessageCount</title>
+                <section id="conf.destination.topic.attributes.allmessagecount">
+                   <title>AllMessageCount</title>
 
-               <para>
+                   <para>
                  Return the total number of messages in all subscriptions of this topic.
-              </para>
-          </section>
+                   </para>
+                </section>
 
-           <section id="conf.destination.topic.attributes.durablemessagecount">
-               <title>DurableMessageCount</title>
+	        <section id="conf.destination.topic.attributes.durablemessagecount">
+	               <title>DurableMessageCount</title>
+	
+	               <para>
+	                 Return the total number of durable messages in all subscriptions of this topic.
+	              </para>
+	
+	        </section>
+	
+	        <section id="conf.destination.topic.attributes.nondurablemessagecount">
+	             <title>NonDurableMessageCount</title>
+	
+	             <para>
+	               Return the total number of non durable messages in all subscriptions of this topic.
+	            </para>
+	        </section>
 
-               <para>
-                 Return the total number of durable messages in all subscriptions of this topic.
-              </para>
+	        <section id="conf.destination.topic.attributes.allsubscriptionscount">
+	             <title>AllSubscriptionsCount</title>
+	
+	             <para>
+	               The count of all subscriptions on this topic
+	            </para>
+	        </section>
+	
+	        <section id="conf.destination.topic.attributes.durablesubscriptionscount">
+	             <title>DurableSubscriptionsCount</title>
+	
+	             <para>
+	               The count of all durable subscriptions on this topic
+	            </para>
+	        </section>
 
-          </section>
+	        <section id="conf.destination.topic.attributesnon.durablesubscriptionscount">
+	             <title>NonDurableSubscriptionsCount</title>
+	
+	             <para>
+	               The count of all non durable subscriptions on this topic
+	            </para>
+	        </section>
 
-         <section id="conf.destination.topic.attributes.nondurablemessagecount">
-             <title>NonDurableMessageCount</title>
+             </section>
 
-             <para>
-               Return the total number of non durable messages in all subscriptions of this topic.
-            </para>
-          </section>
 
-         <section id="conf.destination.topic.attributes.allsubscriptionscount">
-             <title>AllSubscriptionsCount</title>
+             <section id="conf.destination.topic.operations">
 
-             <para>
-               The count of all subscriptions on this topic
-            </para>
-          </section>
+	        <title>
+	             We now discuss the MBean operations of the Topic MBean
+	        </title>
+	
+	        <section id="conf.destination.topic.operations.removeallmessages">
+	             <title>RemoveAllMessages</title>
+	
+	              <para>
+	                Remove (and delete) all messages from the subscriptions of this topic.
+	                <warning>Use this with caution. It will permanently delete all messages from the topic</warning>
+	             </para>
+	        </section>
+	
+	        <section id="conf.destination.topic.operations.listallsubscriptions">
+	             <title>ListAllSubscriptions</title>
+	
+	              <para>
+	                List all subscriptions of this topic
+	             </para>
+	        </section>
+	
+	        <section id="conf.destination.topic.operations.listdurablesubscriptions">
+	             <title>ListDurableSubscriptions</title>
+	
+	              <para>
+	                List all durable subscriptions of this topic
+	             </para>
+	        </section>
 
-         <section id="conf.destination.topic.attributes.durablesubscriptionscount">
-             <title>DurableSubscriptionsCount</title>
+	        <section id="conf.destination.topic.operations.listnondurablesubscriptions">
+	             <title>ListNonDurableSubscriptions</title>
+	
+	              <para>
+	                List all non durable subscriptions of this topic
+	             </para>
+	        </section>
+	
+	        <section id="conf.destination.topic.operations.listallsubscriptionsashtml">
+	             <title>ListAllSubscriptionsAsHTML</title>
+	
+	              <para>
+	                List all subscriptions of this topic in an easy to display HTML format
+	             </para>
+	        </section>
 
-             <para>
-               The count of all durable subscriptions on this topic
-            </para>
-          </section>
+	        <section id="conf.destination.topic.operations.listdurablesubscriptionsashtml">
+	             <title>ListDurableSubscriptionsAsHTML</title>
+	
+	              <para>
+	                List all durable subscriptions of this topic in an easy to display HTML format
+	             </para>
+	        </section>
+	
+	        <section id="conf.destination.topic.operations.listnondurablesubscriptionsashtml">
+	             <title>ListNonDurableSubscriptionsAsHTML</title>
+	
+	              <para>
+	                List all non durable subscriptions of this topic in an easy to display HTML format
+	             </para>
+	        </section>
+	
+	        <section id="conf.destination.topic.operations.listallmessages">
+	             <title>ListAllMessages</title>
+	
+	              <para>
+	                Lists all messages for the specified subscription.
+	             </para>
+	
+	             <para> There are two overloaded versions of this operation. One that takes a selector and one that does not.
+	             By specifyingthe selector you can limit the messages returned.
+	             </para>
+	        </section>
 
-         <section id="conf.destination.topic.attributesnon.durablesubscriptionscount">
-             <title>NonDurableSubscriptionsCount</title>
+	        <section id="conf.destination.topic.operations.listnondurablemessages">
+	             <title>ListNonDurableMessages</title>
+	
+	              <para>
+	                Lists all non durable messages for the specified subscription.
+	             </para>
+	
+	             <para> There are two overloaded versions of this operation. One that takes a selector and one that does not.
+	             By specifyingthe selector you can limit the messages returned.
+	             </para>
+	        </section>
+	
+	        <section id="conf.destination.topic.operations.listdurablemessages">
+	             <title>ListDurableMessages</title>
+	
+	              <para>
+	                Lists all durable messages for the specified subscription.
+	             </para>
+	
+	             <para> There are two overloaded versions of this operation. One that takes a selector and one that does not.
+	             By specifyingthe selector you can limit the messages returned.
+	             </para>
+	        </section>
 
-             <para>
-               The count of all non durable subscriptions on this topic
-            </para>
-        </section>
+             </section>
 
+          </section>
+  
+	  <section id="conf.connectionfactory">
+	     <title>Configuring Connection Factories</title>
+	
+	     <para>
+	       With the default configuration JBoss Messaging binds two connection factories in
+	       JNDI at start-up.
+	     </para>
+	     <para>
+	       The first connection factory is the default non-clustered connection factory and is bound into the
+	       following JNDI contexts:
+	       <literal>/ConnectionFactory, /XAConnectionFactory, java:/ConnectionFactory, java:/XAConnectionFactory</literal>.
+	       This connection factory is provided to maintain compatibility with applications originally written
+	       against JBoss MQ which has no automatic failover or load balancing.
+	       This connection factory should be used if you do not require client side automatic failover or
+	       load balancing.
+	     </para>
+	     <para>
+	       The second connection factory is the default clustered connection factory and is bound into the following
+	       JNDI contexts
+	       <literal>/ClusteredConnectionFactory, /ClusteredXAConnectionFactory, java:/ClusteredConnectionFactory, java:/ClusteredXAConnectionFactory</literal>.
+	       
+	     </para>
 
-     </section>
+	     <para>
+	       You may want to configure additional connection factories, for instance if you want to provide
+	       a default client id for a connection factory, or if you want to bind it in different places
+	       in JNDI, if you want different connection factories to use different transports, or if you want
+	       to selective enable or disable load-balancing and/or automatic failover for a particular
+	       connection factory. Deploying
+	       a new connection factory is equivalent with adding a new ConnectionFactory MBean
+	       configuration to <filename>connection-factories-service.xml</filename>.
+	     </para>
+	     <para>
+	        It is also possible to create an entirely
+	        new service deployment descriptor <filename>xxx-service.xml</filename> altogether and
+	        deploy it in <filename>$JBOSS_HOME/server/messaging/deploy</filename>.
+	     </para>
 
+	     <para>
+	    Connection factories can support automatic failover and/or load-balancing by setting the corresponding
+	    attributes
+	     </para>
+	
+	     <para>
+	       An example connection factory configuration is presented below:
+	     </para>
 
-     <section id="conf.destination.topic.operations">
+             <programlisting>
+&lt;mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
+      name="jboss.messaging.connectionfactory:service=MyConnectionFactory"
+      xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml"&gt;
+      &lt;depends optional-attribute-name="ServerPeer"&gt;jboss.messaging:service=ServerPeer&lt;/depends&gt;
+      &lt;depends optional-attribute-name="Connector"&gt;jboss.messaging:service=Connector,transport=bisocket&lt;/depends&gt;
+      &lt;depends&gt;jboss.messaging:service=PostOffice&lt;/depends&gt;
 
-         <title>
-             We now discuss the MBean operations of the Topic MBean
-         </title>
-
-         <section id="conf.destination.topic.operations.removeallmessages">
-             <title>RemoveAllMessages</title>
-
-              <para>
-                Remove (and delete) all messages from the subscriptions of this topic.
-                <warning>Use this with caution. It will permanently delete all messages from the topic</warning>
-             </para>
-         </section>
-
-         <section id="conf.destination.topic.operations.listallsubscriptions">
-             <title>ListAllSubscriptions</title>
-
-              <para>
-                List all subscriptions of this topic
-             </para>
-         </section>
-
-         <section id="conf.destination.topic.operations.listdurablesubscriptions">
-             <title>ListDurableSubscriptions</title>
-
-              <para>
-                List all durable subscriptions of this topic
-             </para>
-         </section>
-
-         <section id="conf.destination.topic.operations.listnondurablesubscriptions">
-             <title>ListNonDurableSubscriptions</title>
-
-              <para>
-                List all non durable subscriptions of this topic
-             </para>
-         </section>
-
-         <section id="conf.destination.topic.operations.listallsubscriptionsashtml">
-             <title>ListAllSubscriptionsAsHTML</title>
-
-              <para>
-                List all subscriptions of this topic in an easy to display HTML format
-             </para>
-         </section>
-
-         <section id="conf.destination.topic.operations.listdurablesubscriptionsashtml">
-             <title>ListDurableSubscriptionsAsHTML</title>
-
-              <para>
-                List all durable subscriptions of this topic in an easy to display HTML format
-             </para>
-         </section>
-
-         <section id="conf.destination.topic.operations.listnondurablesubscriptionsashtml">
-             <title>ListNonDurableSubscriptionsAsHTML</title>
-
-              <para>
-                List all non durable subscriptions of this topic in an easy to display HTML format
-             </para>
-         </section>
-
-         <section id="conf.destination.topic.operations.listallmessages">
-             <title>ListAllMessages</title>
-
-              <para>
-                Lists all messages for the specified subscription.
-             </para>
-
-             <para> There are two overloaded versions of this operation. One that takes a selector and one that does not.
-             By specifyingthe selector you can limit the messages returned.
-             </para>
-         </section>
-
-         <section id="conf.destination.topic.operations.listnondurablemessages">
-             <title>ListNonDurableMessages</title>
-
-              <para>
-                Lists all non durable messages for the specified subscription.
-             </para>
-
-             <para> There are two overloaded versions of this operation. One that takes a selector and one that does not.
-             By specifyingthe selector you can limit the messages returned.
-             </para>
-         </section>
-
-         <section id="conf.destination.topic.operations.listdurablemessages">
-             <title>ListDurableMessages</title>
-
-              <para>
-                Lists all durable messages for the specified subscription.
-             </para>
-
-             <para> There are two overloaded versions of this operation. One that takes a selector and one that does not.
-             By specifyingthe selector you can limit the messages returned.
-             </para>
-         </section>
-
-     </section>
-
-  </section>
-
-
-
-     <section id="conf.destination.new">
-        <title>Deploying a new destination</title>
-
-        <para>
-           For a JBoss 4.0.x installation, JBoss Messaging is deployed in its own class
-           loading domain. Because of that you need to deploy a new destinations to use
-           with JBoss Messaging within the same class loading domain.
-       </para>
-
-        <para>
-           To deploy a new destination, create a new deployment descriptor named
-           <filename>myqueue-service.xml</filename> (or anything else that ends in
-           <literal>-service.xml</literal>) and copy it to the JBoss instance deployment
-           directory <filename>$JBOSS_HOME/server/messaging/deploy</filename>.
-        </para>
-
-        <para>
-           An example of a scoped destination deployment descriptor is listed below:
-        </para>
-
-        <programlisting>
-&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-&lt;server&gt;
-   &lt;loader-repository&gt;jboss.messaging:loader=ScopedLoaderRepository
-   &lt;loader-repository-config&gt;java2ParentDelegation=false&lt;/loader-repository-config&gt;
-   &lt;/loader-repository&gt;
-   &lt;mbean
-      code=&quot;org.jboss.jms.server.destination.Queue&quot;
-     name=&quot;jboss.messaging.destination:service=Queue,name=testQueue&quot;
-     xmbean-dd=&quot;xmdesc/Queue-xmbean.xml&quot;&gt;
-      &lt;depends optional-attribute-name=&quot;ServerPeer&quot;&gt;
-         jboss.messaging:service=ServerPeer
-      &lt;/depends&gt;
-      &lt;attribute name=&quot;SecurityConfig&quot;&gt;
-         &lt;security&gt;
-            &lt;role name=&quot;guest&quot; read=&quot;true&quot;write=&quot;true&quot;/&gt;
-            &lt;role name=&quot;publisher&quot; read=&quot;true&quot; write=&quot;true&quot; create=&quot;false&quot;/&gt;
-            &lt;role name=&quot;noacc&quot; read=&quot;false&quot; write=&quot;false&quot; create=&quot;false&quot;/&gt;
-          &lt;/security&gt;
-      &lt;/attribute&gt;
-      &lt;attribute name=&quot;fullSize&quot;&gt;75000&lt;/attribute&gt;
-      &lt;attribute name=&quot;pageSize&quot;&gt;2000&lt;/attribute&gt;
-      &lt;attribute name=&quot;downCacheSize&quot;&gt;2000&lt;/attribute&gt;
-   &lt;/mbean&gt;
-&lt;/server&gt;
-        </programlisting>
-
-     </section>
-  </section>
-
-  <section id="conf.connections">
-    <title>Configuring Connection Factories</title>
-
-    <para>
-       With the default configuration JBoss Messaging binds just one connection factory in
-       JNDI at start-up. This connection factory has no client ID and is bound into the
-       following JNDI contexts:
-       <literal>/ConnectionFactory, /XAConnectionFactory, java:/ConnectionFactory, java:/XAConnectionFactory</literal>
-    </para>
-
-    <para>
-       You may want to configure additional connection factories, for instance if you want to provide
-       a default client id for a connection factory, or if you want to bind it in different places
-       in JNDI, or if you want different connection factories to use different transports. Deploying
-       a new connection factory is equivalent with adding a new ConnectionFactory MBean
-       configuration to <filename>connection-factories-service.xml</filename>.
-    </para>
-     <para>
-        It is also possible to create an entirely
-        new service deployment descriptor <filename>xxx-service.xml</filename> altogether and
-        deploy it in <filename>$JBOSS_HOME/server/messaging/deploy</filename>.
-    </para>
-
-    <para>
-    Connection factories can either be clustered or non clustered.
-    Clustered connection factories create subsequent connections on different nodes of the cluster according to the load balancing policy.
-    The default load balancing policy is round robin.
-    </para>
-
-    <para>
-       An example connection factory configuration is presented below:
-     </para>
-
-      <programlisting>
-
-&lt;server&gt;
-   &lt;loader-repository&gt;
-      jboss.messaging:loader=ScopedLoaderRepository
-         &lt;loader-repository-config&gt;
-            java2ParentDelegation=false
-         &lt;/loader-repository-config&gt;
-   &lt;/loader-repository&gt;
-   &lt;mbean
-      code=&quot;org.jboss.jms.server.connectionfactory.ConnectionFactory&quot;
-      name=&quot;jboss.messaging.destination:service=ConnectionFactory&quot;
-      xmbean-dd=&quot;xmdesc/ConnectionFactory-xmbean.xml&quot;&gt;
-      &lt;constructor&gt;
-         &lt;arg type=&quot;java.lang.String&quot; value=&quot;myClientID&quot;/&gt;
-      &lt;/constructor&gt;
-      &lt;depends optional-attribute-name=&quot;ServerPeer&quot;&gt;
-         jboss.messaging:service=ServerPeer
-      &lt;/depends&gt;
-      &lt;depends optional-attribute-name=&quot;Connector&quot;&gt;
-         jboss.messaging:service=Connector,transport=socket
-      &lt;/depends&gt;
-      &lt;attribute name=&quot;PrefetchSize&quot;&gt;10&lt;/attribute&gt;
-      &lt;attribute name=&quot;DefaultTempQueueFullSize&quot;&gt;1000&lt;/attribute&gt;
-      &lt;attribute name=&quot;DefaultTempQueuePageSize&quot;&gt;50&lt;/attribute&gt;
-      &lt;attribute name=&quot;DefaultTempQueueDownCacheSize&quot;&gt;50&lt;/attribute&gt;
-      &lt;attribute name=&quot;JNDIBindings&quot;&gt;
+      &lt;attribute name="JNDIBindings"&gt;
          &lt;bindings&gt;
-            &lt;binding&gt;/MyConnectionFactory1&lt;/binding&gt;
-            &lt;binding&gt;/factories/cf1&lt;/binding>&gt;
+            &lt;binding&gt;/MyConnectionFactory&lt;/binding&gt;
+            &lt;binding&gt;/factories/cf&lt;/binding&gt;
          &lt;/bindings&gt;
       &lt;/attribute&gt;
+      
+      &lt;attribute name="ClientID"&gt;myClientID&lt;/attribute&gt;
+
+      &lt;attribute name="SupportsFailover"&gt;true&lt;/attribute&gt;
+      
+      &lt;attribute name="SupportsLoadBalancing"&gt;false&lt;/attribute&gt;  
+      
+      &lt;attribute name="LoadBalancingFactory"&gt;org.acme.MyLoadBalancingFactory&lt;/attribute&gt;
+          
+      &lt;attribute name="PrefetchSize"&gt;1000&lt;/attribute&gt; 
+      
+      &lt;attribute name="DefaultTempQueueFullSize"&gt;50000&lt;/attribute&gt; 
+      
+      &lt;attribute name="DefaultTempQueuePageSize"&gt;1000&lt;/attribute&gt; 
+            
+      &lt;attribute name="DefaultTempQueueDownCacheSize"&gt;1000&lt;/attribute&gt; 
+      
+      &lt;attribute name="DupsOKBatchSize"&gt;10000&lt;/attribute&gt; 
    &lt;/mbean&gt;
-&lt;/server&gt;
+   
 
-    </programlisting>
+             </programlisting>
 
-     <para>
-        The above example would create a connection factory with pre-configured client ID
-        <literal>myClientID</literal> and bind the connection factory in two places in
-        the JNDI tree: <literal>/MyConnectionFactory</literal>
-        and <literal>/factories/cf</literal>. The connection factory will use the default
-        remoting connector. To use a different remoting connector with the connection factory
-        change the <literal>Connector</literal> attribute to specify the service name of the connector you wish to use.
-    </para>
+             <para>
+	        The above example would create a connection factory with pre-configured client ID
+	        <literal>myClientID</literal> and bind the connection factory in two places in
+	        the JNDI tree: <literal>/MyConnectionFactory</literal>
+	        and <literal>/factories/cf</literal>. 
+	        The connection factory overrides the default values for PreFetchSize,
+	        DefaultTempQueueFullSize, DefaultTempQueuePageSize, DefaultTempQueueDownCacheSize and
+	        DupsOKBatchSize, SupportsFailover, SupportsLoadBalancing and LoadBalancingFactory.
+	        The connection factory will use the default
+	        remoting connector. To use a different remoting connector with the connection factory
+	        change the <literal>Connector</literal> attribute to specify the service name of the connector you wish to use.
+	     </para>
 
-    <section id="conf.connectionfactory.attributes">
+             <section id="conf.connectionfactory.attributes">
 
-       <title>
-           We now discuss the MBean attributes of the ConnectionFactory MBean
-       </title>
+	        <title>
+	           We now discuss the MBean attributes of the ConnectionFactory MBean
+	        </title>
+	
+	        <section id="conf.connectionfactory.attributes.clientid">
+	           <title>ClientID</title>
+	
+	            <para>
+	              Connection factories can be pre-configured with a client id. Any connections created using this connection factory will obtain this client id
+	           </para>
+	        </section>
+	
+	        <section id="conf.connectionfactory.attributes.jndibindings">
+	           <title>JNDIBindings</title>
+	
+	            <para>
+	              The list of the JNDI bindings for this connection factory
+	           </para>
+	        </section>
 
-       <section id="conf.destination.connectionfactory.attributes.clientid">
-           <title>ClientID</title>
+	        <section id="conf.connectionfactory.attributes.prefetchsize">
+	           <title>PrefetchSize</title>
+	
+	           <para>
+	            Each client side consumer maintains a local buffer of messages from which it consumes. The server typically sends messages as fast as it can
+	            to the consumer, and when the consumer is full it sends the server a "stop" message to say it is full.
+	            When it clears enough space it sends a "start" message to ask the server to continue sending messages.
+	            The prefetchSize determines the size of this buffer. Larger values give better throughput.
+	           </para>
+	        </section>
+	
+	        <section id="conf.connectionfactory.attributes.tempqueuepaging">
+	           <title>Temporary queue paging parameters</title>
+	
+	              <para>DefaultTempQueueFullSize, DefaultTempQueuePageSize, DefaultTempQueueDownCacheSize are optional attributes that determine the default paging parameters to be used for
+	       any temporary destinations scoped to connections created using this connection factory. See the section on paging channels for more information
+	       on what these values mean.
+	       They will default to values of 200000, 2000 and 2000 respectively if ommitted.
+	              </para>
+	        </section>
+	
+	        <section id="conf.connectionfactory.attributes.dupsokbatchsize">
+	           <title>DupsOKBatchSize</title>
+	
+	              <para>When using a session with acknowledge mode of DUPS_OK_ACKNOWLEDGE this setting determines how many acknowledgments it will buffer locally
+	      before sending. The default value is <literal>2000</literal>
+	              </para>
+	        </section>
+   
+		<section id="conf.connectionfactory.attributes.supportsloadbalancing">
+		       <title>SupportsLoadBalancing</title>
+		
+		   <para>When using a connection factory with a clustered JBoss Messaging installation you can choose whether
+		      to enable client side connection load-balancing. This is determined by setting the attribute supportsLoadBalancing on the connection
+		      factory.
+		   </para>
+		      
+		   <para>If load balancing is enabled on a connection factory then any connections created with that connection factory will
+		      be load-balanced across the nodes of the cluster. Once a connection is created on a particular node, it stays on that node.
+		   </para>
+		      
+		   <para>The exact policy that determines how connections are load balanced is determined by the LoadBalancingFactory attribute</para>            
+		      
+		   <para>
+		       The default value is <literal>false</literal>
+		   </para>
+		</section>
+   
+		<section id="conf.connectionfactory.attributes.supportsfailover">
+		       <title>SupportsFailover</title>
+		
+		      <para>When using a connection factory with a clustered JBoss Messaging installation you can choose whether
+		      to enable client side automatic failover. This is determined by setting the attribute supportsFailover on the connection
+		      factory.
+		      </para>
+		      
+		      <para>If automatic failover is enabled on a connection factory, then if a connection problem is detected with the connection then
+		      JBoss Messaging will automatically and transparently failover to another node in the cluster.
+		      </para>
+		      
+		      <para>The failover is transparent meaning the user can carry on using the sessions, consumers, producers and connection objects
+		      as before.
+		      </para>
+		      
+		      <para>If automatic failover is not required, then this attribute can be set to false. With automatic failover disabled it is up
+		      to the user code to catch connection exceptions in synchronous JMS operations and install a JMS ExceptionListener to catch
+		      exceptions asynchronously. When a connection is caught, the client side code should lookup a new connection factory using HAJNDI
+		      and recreate the connection using that.
+		      </para>
+		      
+		      <para>
+		       The default value is <literal>false</literal>
+		      </para>
+		</section>  
+  
+		<section id="conf.connectionfactory.attributes.loadbalancingfactory">
+		       <title>LoadBalancingFactory</title>
+		
+		      <para>If you are using a connection factory with client side load balancing then you can specify how the load balancing
+		      is implemented by overriding this attribute. The value must correspond to the name of a class which implements the interface
+		      org.jboss.jms.client.plugin.LoadBalancingFactory
+		      </para>
+		      
+		      <para>The default value is org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory, which load balances connetions across
+		      the cluster in a round-robin fashion
+		      </para>
+		      
+		</section>    
 
-            <para>
-              Connection factories can be pre-configured with a client id. Any connections created using this connection factory will obtain this client id
-           </para>
-       </section>
+		<section id="conf.connectionfactory.attributes.connector">
+		          <title>Connector</title>
+		
+		         <para>This specifies which remoting connector this connection factory uses. Different connection factories can use different connectors.
+		         </para>
+		         <para>For instance you could deploy one connection factory that creates connections that use the HTTP transport to communicate to the server and another
+		         that creates connections that use the bisocket transport to communicate.</para>
+		</section>
+	   </section> <!-- End conf.connectionfactory.attributes -->
+	</section> <!-- End conf.connectionfactory -->
 
-       <section id="conf.destination.connectionfactory.attributes.jndibindings">
-           <title>JNDIBindings</title>
 
-            <para>
-              Returns a list of the JNDI bindings for this connection factory
-           </para>
-       </section>
+        <section id="conf.connector">
+	   <title>Configuring the remoting connector</title>
+	
+	      <para>
+	         JBoss Messaging uses JBoss Remoting  for all client to server communication.
+	         For full details of what JBoss Remoting is capable of and how it is configured please
+	         consult the JBoss Remoting documentation.
+	      </para>
+	
+	      <para>
+	         The default configuration includes a single remoting connector which is used by the
+	         single default connection factory. Each connection factory can be configured to use
+	         its own connector.
+	      </para>
+	
+	      <para>
+	         The default connector is configured to use the remoting bisocket transport. The bisocket transport is a TCP socket based transport
+	         which only listens and accepts connections on the server side. I.e. connections are always initiated from the client side. This means
+	         it works well in typical firewall scenarios where only inbound connections are allowed on the server. Or where onlu outbound connections are
+	         allowed from the client.
+	      </para>
 
-     <section id="conf.destination.connectionfactory.attributes.prefetchsize">
-         <title>PrefetchSize</title>
+	      <para>
+	        The bisocket transport can be configured to use SSL where a higher level of security is required.
+	        </para>
+	
+	      <para>
+	        The other supported transport is the HTTP transport. This uses the HTTP protocol to communicate between client and server. Data is received on the client
+	        by the client periodically polling the server for messages. This transport is well suited to situations where there is a firewall between client and server
+	        which only allows incoming HTTP traffic on the server.
+	        Please note this transport will not be as performant as the bisocket transport due to the nature of polling and the HTTP protocl. Also please note it is not
+	        designed for high load situations.
+	      </para>
+	
+	      <para>No other remoting transports are currently supported by JBoss Messaging</para>
+	
+	       <para>
+	         You can look at remoting configuration under:
+	       </para>
+	
+	       <para>
+	          &lt;JBoss&gt;/server/&lt;YourMessagingServer&gt;/deploy/jboss-messaging.sar/remoting-service.xml
+	       </para>
+	
+	       <para>
+	          By default JBoss Messaging binds to ${jboss.bind.address} which can be defined by:
+	          ./run.sh -c &lt;yourconfig&gt; -b yourIP.
+	       </para>
+	
+	       <para>
+	          You can change remoting-service.xml if you want for example use a
+	          different communication port.
+	       </para>
+	
+	       <warning>Please be wary of changing other settings as they can have an adverse effect on the system</warning>
 
-          <para>
-            Each client side consumer maintains a local buffer of messages from which it consumes. The server typically sends messages as fast as it can
-            to the consumer, and when the consumer is full it sends the server a "stop" message to say it is full.
-            When it clears enough space it sends a "start" message to ask the server to continue sending messages.
-            The prefetchSize determines the size of this buffer. Larger values give better throughput.
-         </para>
-       </section>
+        </section> <!-- end conf.connector -->
 
-     <section id="conf.destination.connectionfactory.attributes.tempqueuepaging">
-        <title>Temporary queue paging parameters</title>
+	<section id="conf.servicebindingmanager">
+	     <title>ServiceBindingManager</title>
+	
+	     <para>If you are using the JBoss AS ServiceBindingManager to provide different servers with different port ranges, then you must make sure that the JBoss Messaging
+	     remoting configuration specified in the JBoss Messaging section of the ServiceBindingManager xml file exactly matches that in remoting-service.xml
+	    </para>
+	    
+	    <para>See the chapter on installation for a description of how to set-up the service binding manager for
+	    JBoss Messaging</para>
+	    
+	</section>
 
-       <para>DefaultTempQueueFullSize, DefaultTempQueuePageSize, DefaultTempQueueDownCacheSize are optional attributes that determine the default paging parameters to be used for
-       any temporary destinations scoped to connections created using this connection factory. See the section on paging channels for more information
-       on what these values mean.
-       They will default to values of 200000, 2000 and 2000 respectively if ommitted.
-       </para>
-     </section>
 
-    <section id="conf.destination.connectionfactory.attributes.dupsokbatchsize">
-       <title>DupsOKBatchSize</title>
+        <section id="conf.callback">
+	      <title>Configuring the callback</title>
+	
+	      <para>
+	         JBoss Messaging uses a callback mechanism from Remoting that needs a Socket for callback operations. These socket properties are passed to the server by a remote call when the connection is being estabilished. As we said before we will support bidirectional protocols in future releases.
+	      </para>
+	
+	      <para>
+	         By default JBoss Messaging will execute InetAddress.getLocalHost().getHostAddress() to access your local host IP, but in case you need to setup a different IP, you can define a system property in your java arguments:
+	      </para>
+	
+	      <para>
+	      Use java -Djboss.messaging.callback.bind.address=YourHost - That will determine the callBack host in your client.
+	      </para>
+	
+	      <para>
+	      The client port will be selected randomly for any non used port. But if you defined -Djboss.messaging.callback.bind.port=NumericPort in your System Properties that number is going to be used for the call back client port.
+	      </para>
 
-      <para>When using a session with acknowledge mode of DUPS_OK_ACKNOWLEDGE this setting determines how many acknowledgments it will buffer locally
-      before sending. The default value is <literal>2000</literal>
-      </para>
-   </section>
-
-   <section id="conf.destination.connectionfactory.attributes.connector">
-          <title>Connector</title>
-
-         <para>This specifies which remoting connector this connection factory uses. Different connection factories can use different connectors.
-         </para>
-         <para>For instance you could deploy one connection factory that creates connections that use the HTTP transport to communicate to the server and another
-         that creates connections that use the bisocket transport to communicate.</para>
-   </section>
-
-   </section>
-
-</section>
-
-  <section id="conf.connector">
-      <title>Configuring the remoting connector</title>
-
-      <para>
-         JBoss Messaging uses JBoss Remoting  for all client to server communication.
-         For full details of what JBoss Remoting is capable of and how it is configured please
-         consult the JBoss Remoting documentation.
-      </para>
-
-      <para>
-         The default configuration includes a single remoting connector which is used by the
-         single default connection factory. Each connection factory can be configured to use
-         its own connector.
-      </para>
-
-      <para>
-         The default connector is configured to use the remoting bisocket transport. The bisocket transport is a TCP socket based transport
-         which only listens and accepts connections on the server side. I.e. connections are always initiated from the client side. This means
-         it works well in typical firewall scenarios where only inbound connections are allowed on the server. Or where onlu outbound connections are
-         allowed from the client.
-      </para>
-
-      <para>
-        The bisocket transport can be configured to use SSL where a higher level of security is required.
-        </para>
-
-      <para>
-        The other supported transport is the HTTP transport. This uses the HTTP protocol to communicate between client and server. Data is received on the client
-        by the client periodically polling the server for messages. This transport is well suited to situations where there is a firewall between client and server
-        which only allows incoming HTTP traffic on the server.
-        Please note this transport will not be as performant as the bisocket transport due to the nature of polling and the HTTP protocl. Also please note it is not
-        designed for high load situations.
-      </para>
-
-      <para>No other remoting transports are currently supported by JBoss Messaging</para>
-
-       <para>
-         You can look at remoting configuration under:
-       </para>
-
-       <para>
-          &lt;JBoss&gt;/server/&lt;YourMessagingServer&gt;/deploy/jboss-messaging.sar/remoting-service.xml
-       </para>
-
-       <para>
-          By default JBoss Messaging binds to ${jboss.bind.address} which can be defined by:
-          ./run.sh -c &lt;yourconfig&gt; -b yourIP.
-       </para>
-
-       <para>
-          You can change remoting-service.xml if you want for example use a
-          different communication port.
-       </para>
-
-       <warning>Please be wary of changing other settings as they can have an adverse effect on the system</warning>
-
-  </section>
-
-  <section id="conf.servicebindingmanager">
-     <title>ServiceBindingManager</title>
-
-     <para>If you are using the JBoss AS ServiceBindingManager to provide different servers with different port ranges, then you must make sure that the JBoss Messaging
-     remoting configuration specified in the JBoss Messaging section of the ServiceBindingManager xml file exactly matches that in remoting-service.xml
-    </para>
-  </section>
-
-  <section id="conf.callback">
-      <title>Configuring the callback</title>
-
-      <para>
-         JBoss Messaging uses a callback mechanism from Remoting that needs a Socket for callback operations. These socket properties are passed to the server by a remote call when the connection is being estabilished. As we said before we will support bidirectional protocols in future releases.
-      </para>
-
-      <para>
-         By default JBoss Messaging will execute InetAddress.getLocalHost().getHostAddress() to access your local host IP, but in case you need to setup a different IP, you can define a system property in your java arguments:
-      </para>
-
-      <para>
-      Use java -Djboss.messaging.callback.bind.address=YourHost - That will determine the callBack host in your client.
-      </para>
-
-      <para>
-      The client port will be selected randomly for any non used port. But if you defined -Djboss.messaging.callback.bind.port=NumericPort in your System Properties that number is going to be used for the call back client port.
-      </para>
-
-  </section>
+        </section> <!-- End conf.callback -->
+  
+   </section> <!-- End conf -->
+  
 </chapter>

Modified: trunk/docs/userguide/en/modules/gettingstarted.xml
===================================================================
--- trunk/docs/userguide/en/modules/gettingstarted.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/docs/userguide/en/modules/gettingstarted.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -2,30 +2,27 @@
    <title>Download Software</title>
 
    <para>
-      The official releases of JBoss Messaging are available as a free download from
-      <ulink url="http://www.jboss.com/products/messaging">the JBoss Messaging project landing page</ulink>.
+      The official JBoss Messaging project page is
+      <ulink url="http://labs.jboss.com/jbossmessaging">http://labs.jboss.com/jbossmessaging/</ulink>.
    </para>
 
    <para>
-       The recommended download location is the JBoss Labs Messaging Project download zone:
-       <ulink url="http://labs.jboss.com/portal/jbossmessaging/downloads">http://labs.jboss.com/portal/jbossmessaging/downloads</ulink>
-       We also maintain an alternate download location on sourceforge.net:
-       <ulink url="http://sourceforge.net/project/showfiles.php?group_id=22866&amp;package_id=157261">http://sourceforge.net/project/showfiles.php?group_id=22866&amp;package_id=157261</ulink>
+       The download location is the JBoss Labs Messaging Project download zone:
+       <ulink url="http://labs.jboss.com/jbossmessaging/">http://labs.jboss.com/jbossmessaging/</ulink>
    </para>
 
    <section id="releasebundle">
       <title>The JBoss Messaging Release Bundle</title>
 
       <para>
-         The JBoss Messaging release bundle (<filename>jboss-messaging-1.2.x.zip</filename>)
-         will expand in a <filename>jboss-messaging-1.2.x</filename> directory that contains:
+         The JBoss Messaging release bundle (<filename>jboss-messaging-1.3.x.zip</filename>)
+         will expand in a <filename>jboss-messaging-1.3.x</filename> directory that contains:
       </para>
 
       <itemizedlist>
          <listitem>
-            <filename>jboss-messaging-scoped.sar</filename>
-            - the scoped JBoss service archive that contains JBoss Messaging and its
-            dependencies.
+            <filename>jboss-messaging.sar</filename>
+            - the service archive that contains JBoss Messaging
             <warning>
                Do not simply attempt to copy the archive under a JBoss instance <filename>deploy</filename> directory,
                since additional steps (such as un-installing JBossMQ and various other configurations
@@ -37,47 +34,17 @@
             <filename>jboss-messaging-client.jar</filename>
             - the client-side library that need to be in the classpath of the client that opens
             a remote connection to the Messaging server.
-
-            <note>
-                <para>
-                This is an important note on the Messaging client jar. JBoss Messaging has an
-                extensive tree of dependencies and bundling all right dependencies in one easy
-                to use archive, so no wrong versions inadvertently get in the class path is, as
-                experience shows, extremely convenient. However, this could cause problems if a
-                different version of a dependency is required by the user's client code.
-                </para>
-                <para>
-                If, for example, the log4j.jar bundled with the release causes problems for being
-                too old, one could just simply build the client-side class path so a newer version
-                of log4j.jar precedes jboss-messaging-client.jar in that class path. This approach
-                may work, but is not guaranteed to work, because we did not run the full test suite
-                with any other log4j.jar version except the one we bundle with the release.
-
-                Soon we will providing an ant task that creates a slimmed down client jar without the extra
-                dependencies bundled.
-                </para>
-
-                <para>
-                 A list of required dependencies for a specific release can be found in the
-                 <filename>build-thirdpary.xml</filename> file that is part of the companion source
-                 bundle that ships with each release. It can also be looked up online in
-                  <ulink url="http://fisheye.jboss.org">http://fisheye.jboss.org</ulink>.
-                </para>
-            </note>
          </listitem>
          <listitem>
             <filename>util</filename>
             - a collection of <literal>ant</literal> configuration files used to automate
-            installation and release
-            management procedures. See <xref linkend="installation"/> for
-             more details.
+            installation. See <xref linkend="installation"/> for more details.
          </listitem>
          <listitem>
             <filename>examples</filename>
             - a collection of examples that should run out of the box and help you validate the
             installation. Detailed instructions are provided with each example, which range from
-            very simple JMS queue and topic examples to relatively sophisticated use cases in which
-            EJBs and JCA JMS ConnectionFactories are involved, as well as clustering use cases.
+            very simple JMS queue and topic examples to EJB 2.1, EJB3 and clustering examples.
             The <filename>examples/config</filename> sub-directory contains various configuration
             file examples.
          </listitem>
@@ -86,11 +53,6 @@
             - this user's guide.
          </listitem>
          <listitem>
-           <filename>src/jboss-messaging-1.2.x-src.zip</filename>
-            - the zipped source directory. The file can be directly installed into and used
-            with a debugger.
-         </listitem>
-         <listitem>
             <filename>test-results</filename>
             - the output of the functional testsuite, stress and smoke test runs for this release.
             All these files have been generated during the release procedure and are bundled here

Modified: trunk/docs/userguide/en/modules/installation.xml
===================================================================
--- trunk/docs/userguide/en/modules/installation.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/docs/userguide/en/modules/installation.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -7,87 +7,183 @@
   Messaging configuration that will start a clustered or non-clustered
   messaging server.</para>
 
-  <para>By default, a JBoss AS 4.0.x and 4.2.0 instance ships with JBossMQ as
+  <para>By default, JBoss AS 4.2.0 instance ships with JBossMQ as
   default JMS provider. In order to use the JBoss AS instance with JBoss
   Messaging, you need to perform the installation procedure described
   below.</para>
 
-  <para><warning>
-       A JBossMQ and a JBoss Messaging instance cannot coexist, at least not unless special precautions are taken. Do not simply attempt to copy the Messaging release artifact 
+  <para>
+     <note>
+       A JBossMQ and a JBoss Messaging instance cannot coexist, at least not unless special precautions are taken.
+       Do not simply attempt to copy the Messaging release artifact 
 
-      <filename>jboss-messaging-scoped.sar</filename>
+      <filename>jboss-messaging.sar</filename>
 
        over to the JBoss instance 
 
       <filename>deploy</filename>
 
        directory. Follow one of the alternate installation procedures outlined below instead. 
-    </warning></para>
+    </note>
+ </para>
+    
+ <para>
+    <note>
+    We only recommend and support installing JBoss Messaging in JBoss AS 4.2 or later.
+    You should avoid using JBoss Messaging on any version of JBoss AS prior to JBoss 4.2.0.GA,
+    such as 4.0.5.GA and 4.0.4.GA.
+    </note>
+ </para>
 
-  <section id="install4">
-    <title>Installing JBoss Messaging on JBoss AS 4.2.0.GA</title>
+  <section id="install">
+    <title>Installing JBoss Messaging on JBoss AS 4.2</title>
+    
+    <para>In this section we present five different methods of installing JBoss Messaging in JBoss AS 4.2
+    </para>
+    
+    <itemizedlist>
+    
+       <listitem>If you do not want clustering functionality and have a completely clean JBoss AS 4.2.0 installation
+       then you can do an <xref linkend="install.automated">automatic non-clustered install</xref>.
+       </listitem>
+       
+       <listitem>If you do not want clustering functionality and have a JBoss 4.2.0 that you have changed in some
+       way from a clean JBoss AS 4.2.0 installation then you will need to do a
+       <xref linkend="install.manual">manual non-clustered install</xref>.
+       </listitem>
+       
+       <listitem>If you want clustering functionality and have a completely clean JBoss AS 4.2.0 installation
+       then you can do an <xref linkend="install.automatedclustered">automatic clustered install</xref>.
+       </listitem>
+       
+       <listitem>If you want clustering functionality and have a JBoss 4.2.0 that you have changed in some
+       way from a clean JBoss AS 4.2.0 installation then you will need to do a
+       <xref linkend="install.manualclustered">manual clustered install</xref>.
+       </listitem>  
+       
+       <listitem><warning>Not recommended!</warning>If you to install in JBoss 4.0.x and are willing to cope
+        with any jar incompatibilities that may arise then you will need to perform a
+       <xref linkend="install.jboss40x">install in JBoss 4.0.x</xref>.
+       </listitem>      
+       
+    </itemizedlist>
+     
+       
+ 
+    <section id="install.automated">
+      <title>Automated Non-clustered Installation from clean JBoss AS 4.2 installation</title>
+      
+      <para>
+      <note>
+      This procedure should only be performed from a clean JBoss AS 4.2 installation.
+      If you have modifed the JBoss AS 4.2 installation at all since installation then you will need to 
+      perform a manual JBoss Messaging installation
+      </note>
+      </para>
 
-    <section id="install4.automated">
-      <title>Automated Non Clustered Installation</title>
-
       <para>Set up the <literal>JBOSS_HOME</literal> environment variable to
-      point to the JBoss 4.x installation you want to use JBoss Messaging
+      point to the JBoss 4.2 installation you want to use JBoss Messaging
       with. Run the installation script, available in the
       <filename>util</filename> directory of the release bundle.</para>
 
       <programlisting>
  cd util
  ant -f release-admin.xml
-        </programlisting>
+      </programlisting>
 
       <para>The installation script will create a
       <filename>$JBOSS_HOME/server/messaging</filename> configuration.</para>
 
+      <para>
+          <para><warning>For use in production it is highly recommended to use a
+          different database other than the HSQLDB. HSQLDB does not have any transaction isolation.
+          For simple non clustered development evaluation HSQLDB may suffice.
+          If you decide to use a different database please follow the follow steps:
+          </warning></para>
+
+          <itemizedlist>
+            <listitem>
+              <para>Replace 
+              <literal>JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml</literal>
+              by the persistence-service of from
+              <literal>&lt;downloadPackage&gt;/examples/config.</literal></para>
+            </listitem>
+
+            <listitem>
+              <para>Configure a JCA datasource using an example from
+              <literal>$JBOSS_HOME/docs/examples/jca</literal></para> and copying to 
+              <literal>$JBOSS_CONFIG/deploy</literal>
+              <para>JBoss Messaging uses <literal>DefaultDS</literal> by default so you should configure
+              your datasource to bind to that</para>              
+            </listitem>
+
+            <listitem>
+              <para>Remove hsqldb-ds.xml from <literal>$JBOSS_CONFIG/deploy</literal></para>
+            </listitem>
+            
+            <listitem>
+              <para>Copy your database driver to <literal>$JBOSS_CONFIG/lib</literal></para>
+              <para>Your database driver can probably be downloaded from your database providers
+              web site</para>
+            </listitem>
+            
+          </itemizedlist>
+      </para>
+        
+
       <para>There are few extra steps at <xref
       linkend="install.extra-steps" /></para>
+      
+      <para>That's it!</para>
 
       <note>
         <para>If you want to create a JBoss Messaging configuration with a
-        different name, modify the <literal>messaging.config.name</literal>
-        system property declared at the beginning of the installation script
-        accordingly.</para>
-
-        <para>If you want to use all as the source configuration (for
-        clustered configs), modify the
-        <literal>messaging.config.source</literal> variable at the beginning
-        of the script also.</para>
-
-        <para>Or if you prefer you could use
-        <literal>-Dmessaging.config.name=YourConfig
-        -Dmessaging.config.source=all</literal></para>
+        different name, you can specify the <literal>messaging.config.name</literal>
+        system property when you run the command:</para>
+        
+        <programlisting>
+ cd util
+ ant -f release-admin.xml -Dmessaging.config.name=mymessaging
+        </programlisting>
       </note>
     </section>
 
     <section id="install.manual">
-      <title>Manual Non Clustered Installation</title>
+      <title>Manual Non-clustered Installation</title>
+      
+      <para>
+         <note>This installation procedure should be performed if you are installing into a JBoss AS
+         configuration that you have changed in some way from the default JBoss AS distribution.
+         If you are just using the standard, untouched JBoss AS 4.2 distribution you can use the automated procedure
+         above
+         </note>
+      </para>
 
-      <para>For this procedure we suppose you have a standard configuration
-      such as default or all. Consider
-      JBOSS_CONFIG=$JBOSS_HOME/server/&lt;YourConfiguration&gt;:</para>
-
+      <para>For this procedure we assume you already have your custom configuration located at
+      <literal>JBOSS_CONFIG=$JBOSS_HOME/server/&lt;myconfiguration&gt;</literal>, and that it contains a JBoss MQ
+      installation.
+      </para>
+      
+      <para>You don't actually have to create an environment variable <literal>JBOSS_CONFIG</literal>, this is just
+      used in the installation instructions to describe the steps</para>
+      
       <itemizedlist>
         <listitem>
-          <para>Move JBOSS_CONFIG/deploy/jms/jms-ds.xml and
-          JBOSS_CONFIG/deploy/jms/jms-ra.rar to JBOSS_CONFIG/deploy</para>
+          <para>Move <literal>$JBOSS_CONFIG/deploy/jms/jms-ds.xml</literal> and
+          <literal>$JBOSS_CONFIG/deploy/jms/jms-ra.rar</literal> to <literal>$JBOSS_CONFIG/deploy</literal></para>
         </listitem>
 
         <listitem>
-          <para>Remove the old JBoss MQ by removing
-          JBOSS_CONFIG/deploy/jms.</para>
+          <para>Remove the old JBoss MQ by removing the directory
+          <literal>$JBOSS_CONFIG/deploy/jms.</literal></para>.
+          
+          <para>Remove the old JBoss MQ jar file: <literal>$JBOSS_CONFIG/lib/jbossmq.jar</literal></para>
 
-          <para>Case you are working with a configuration similar to all, make
-          sure you don't have any JBossMQ files under /deploy-hasingleton. For
-          that just remove /deploy-hasingleton/jms</para>
         </listitem>
 
         <listitem>
           <para>Add a security policy called "messaging" on
-          JBOSS_CONFIG/config/login-config.xml. You could use this as an
+          $JBOSS_CONFIG/config/login-config.xml. You could use this as an
           example, or create one according to JBoss Security
           Documentation:</para>
 
@@ -103,9 +199,13 @@
 &lt;/application-policy&gt;
           </programlisting>
 
-          <para>Case you are using this provided policy you should also create
-          messaging-users.properties and messaging-roles.properties to
-          JBOSS_CONFIG/config/props/</para>
+          <para>In case you are using the above policy you should also create files
+          <literal>messaging-users.properties</literal> and <literal>messaging-roles.properties</literal> in the
+          <literal>$JBOSS_CONFIG/config/props/</literal> directory</para>.
+          
+          <para><note>You can find an example <literal>messaging-users.properties</literal> and
+          <literal>messaging-roles.properties</literal> in the JBoss Messaging distribution in the
+          <literal>&lt;downloadPackage&gt;src/etc/server/default/config</literal> directory.</note></para>
 
           <programlisting>
 # messaging-roles.properties
@@ -126,164 +226,456 @@
         </listitem>
 
         <listitem>
-          <para>Unzip jboss-messaging.sar from your download package into
-          JBOSS_CONFIG/deploy/jboss-messaging.sar</para>
+          <para>Unzip jboss-messaging.sar from your download package into the directory
+          <literal>JBOSS_CONFIG/deploy/jboss-messaging.sar</literal></para>
+          <para>JBoss Messaging should be deployed unzipped (exploded) so you have easy access to its config
+          files which are stored there.</para>
         </listitem>
 
         <listitem>
-          <para>For use in production it is highly recommended to use a
-          different database other than HSQLDB.</para>
+          <para><warning>For use in production it is highly recommended to use a
+          different database other than the HSQLDB. HSQLDB does not have any transaction isolation.
+          For simple non clustered development evaluation HSQLDB may suffice.
+          If you decide to use a different database please follow the follow steps:
+          </warning></para>
 
           <itemizedlist>
             <listitem>
-              <para>Replace
-              JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml
+              <para>Replace 
+              <literal>JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml</literal>
               by the persistence-service of from
-              &lt;downloadPackage&gt;/examples/config.</para>
+              <literal>&lt;downloadPackage&gt;/examples/config.</literal></para>
             </listitem>
 
             <listitem>
               <para>Configure a JCA datasource using an example from
-              $JBOSS_HOME/docs/examples/jca</para>
+              <literal>$JBOSS_HOME/docs/examples/jca</literal></para> and copying to 
+              <literal>$JBOSS_CONFIG/deploy</literal>
+              <para>JBoss Messaging uses <literal>DefaultDS</literal> by default so you should configure
+              your datasource to bind to that</para>              
             </listitem>
 
             <listitem>
-              <para>Remove hsqldb-ds.xml from JBOSS_CONFIG/deploy</para>
+              <para>Remove hsqldb-ds.xml from <literal>$JBOSS_CONFIG/deploy</literal></para>
             </listitem>
+            
+            <listitem>
+              <para>Copy your database driver to <literal>$JBOSS_CONFIG/lib</literal></para>
+              <para>Your database driver can probably be downloaded from your database providers
+              web site</para>
+            </listitem>
+            
           </itemizedlist>
         </listitem>
+        
+        <listitem>
+              <para>There are few extra steps at <xref
+      linkend="install.extra-steps" /></para>
+        </listitem>
+        
+        <listitem>
+           That's it!
+        </listitem>
       </itemizedlist>
 
-      <para>There are few extra steps at <xref
-      linkend="install.extra-steps" /></para>
     </section>
 
-    <section id="install.clustered">
-      <title>Clustered Installation</title>
+    <section id="install.automatedclustered">
+      <title>Clustered Automated Installation</title>
+      
+      <para>
+         <note>
+      This procedure should only be performed from a clean JBoss AS 4.2 installation.
+      If you have modifed the JBoss AS 4.2 installation at all since installation then you will need to 
+      perform a manual clustered JBoss Messaging installation
+         </note>
+      </para>
+      
+      
+      <para>For this procedure we assume you already have your custom configuration located at
+      <literal>JBOSS_CONFIG=$JBOSS_HOME/server/&lt;myconfiguration&gt;</literal>, and that it contains a JBoss MQ
+      installation.
+      </para>
+      
+      <para>You don't actually have to create an environment variable <literal>JBOSS_CONFIG</literal>, this is just
+      used in the installation instructions to describe the steps</para>
+      
+      <itemizedlist>
 
-      <itemizedlist>
+      <listitem>
+         <para>Set up the <literal>JBOSS_HOME</literal> environment variable to
+         point to the JBoss 4.2 installation you want to use JBoss Messaging
+         with. Run the installation script, available in the
+         <filename>util</filename> directory of the release bundle as follows:</para>
+
+         <programlisting>
+ cd util
+ ant -f release-admin.xml -Dmessaging.config.source=all -Dmessaging.config.name=messaging-node0
+         </programlisting>
+      
+         <para>In the above you would substitute <literal>messaging-node0</literal> with whatever is the 
+      name you want to give the configuration. If you will have several cluster nodes on the same machine, e.g.
+      for development purposes then a good convention is to name them <literal>messaging-node0, messaging-node1</literal>
+      to match <literal>messaging-node&lt;ServerPeerID&gt;</literal></para>
+
+         <para>The installation script will create a
+         <filename>$JBOSS_HOME/server/messaging-node0</filename> configuration. (If you have chosen <literal>messaging-node0</literal>)</para>
+         
+      </listitem>
+      
+      <listitem>
+          <para><warning>For a clustered installation it is mandatory that a shared database is available to
+          all nodes in the cluster.
+          The default JBoss AS uses HSQLDB for its database which is a local shared database.
+          Therefore in order to use clustering you must replace this with a different shared database.
+          If the database is not replaced then clustering will not work.
+          </warning></para>
+
+          <itemizedlist>
+            <listitem>
+              <para>Replace 
+              <literal>$JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml</literal>
+              by the <literal>clustered-&lt;databasename&gt;-persistence-service</literal> from
+              <literal>&lt;downloadPackage&gt;/examples/config.</literal>. For instance
+              <literal>clustered-mysql-persistence-service.xml</literal>
+              </para>
+            </listitem>
+
+            <listitem>
+              <para>Configure a JCA datasource using an example from
+              <literal>$JBOSS_HOME/docs/examples/jca</literal></para> and copying to 
+              <literal>$JBOSS_CONFIG/deploy</literal>
+              <para>JBoss Messaging uses <literal>DefaultDS</literal> by default so you should configure
+              your datasource to bind to that</para>              
+            </listitem>
+
+            <listitem>
+              <para>Remove hsqldb-ds.xml from <literal>$JBOSS_CONFIG/deploy</literal></para>
+            </listitem>
+            
+            <listitem>
+              <para>Copy your database driver to <literal>$JBOSS_CONFIG/lib</literal></para>
+              <para>Your database driver can probably be downloaded from your database provider's
+              web site</para>
+            </listitem>
+            
+          </itemizedlist>
+      </listitem>      
+                  
+      <listitem>
+          <para>Ensure the <literal>ServerPeerID</literal> MBean constructor parameter in messaging-service.xml is unique for
+          each node on the cluster. The <literal>ServerPeerID</literal> value must be a valid integer.</para>
+          <para><warning>Each node must have a unique <literal>ServerPeerID</literal> for clustering to work!</warning></para>
+      </listitem>
+      
+     <listitem>
+        <para>If you want to run multiple JBoss Messaging nodes on the same box using the same IP address, e.g.
+        for development purposes, then you can use the ServiceBindingManager to do this as follows:
+        </para>
+      
+        <itemizedlist>
+           <listitem>
+              <para>Uncomment binding manager service from
+              $JBOSS_CONFIG/conf/jboss-service.xml</para>
+           </listitem>
+
+           <listitem>
+              <para>Specify the desired port rage (e.g. ports-01, ports-02...
+              etc)</para>
+           </listitem>
+
+           <listitem>
+              <para>Look at
+              $JBOSS_HOME/docs/examples/binding-manager/sample-bindings.xml.
+              On each port range, JBoss Remoting configuration should look
+              like:</para>
+
+              <programlisting>
+      &lt;service-config name="jboss.messaging:service=Connector,transport=bisocket"
+                      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"&gt;
+         &lt;delegate-config&gt;
+            &lt;attribute name="Configuration"&gt;&lt;![CDATA[
+	   &lt;config&gt;
+            &lt;invoker transport="bisocket"&gt;
+               &lt;attribute name="marshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
+               &lt;attribute name="unmarshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
+               &lt;attribute name="dataType" isParam="true"&gt;jms&lt;/attribute&gt;
+               &lt;attribute name="socket.check_connection" isParam="true"&gt;false&lt;/attribute&gt;
+               &lt;attribute name="timeout" isParam="true"&gt;0&lt;/attribute&gt;
+               &lt;attribute name="serverBindAddress"&gt;${jboss.bind.address}&lt;/attribute&gt;
+               &lt;attribute name="serverBindPort"&gt;4657&lt;/attribute&gt;
+               &lt;attribute name="leasePeriod"&gt;10000&lt;/attribute&gt;
+               &lt;attribute name="clientSocketClass" isParam="true"&gt;org.jboss.jms.client.remoting.ClientSocketWrapper&lt;/attribute&gt;
+               &lt;attribute name="serverSocketClass"&gt;org.jboss.jms.server.remoting.ServerSocketWrapper&lt;/attribute&gt;
+               &lt;attribute name="numberOfRetries" isParam="true"&gt;1&lt;/attribute&gt;
+               &lt;attribute name="numberOfCallRetries" isParam="true"&gt;1&lt;/attribute&gt;
+               &lt;attribute name="clientMaxPoolSize" isParam="true"&gt;50&lt;/attribute&gt;
+            &lt;/invoker&gt;
+            &lt;handlers&gt;
+               &lt;handler subsystem="JMS"&gt;org.jboss.jms.server.remoting.JMSServerInvocationHandler&lt;/handler&gt;
+            &lt;/handlers&gt;
+         &lt;/config&gt;
+            ]]&gt;&lt;/attribute&gt;
+         &lt;/delegate-config&gt;
+         &lt;binding port="4657"/&gt;
+      &lt;/service-config&gt;
+              
+              </programlisting>
+              
+              <warning>You must ensure that the config (like above) is identical to that in <literal>remoting-service.xml</literal>
+              With the exception of the actual serverBindPort which clearly must be different for each ports range.
+              Please note that the default JBoss Messaging service binding manager bindings in <literal>sample-bindings.xml</literal>
+              shipped with JBAS 4.2.0 is out of date and you will need to copy the config from <literal>remoting-service.xml</literal>
+              </warning>
+
+              <para>You should ensure that each node is configured to use a different ports range.</para>
+            </listitem>
+          </itemizedlist>
+        </listitem>
+        
         <listitem>
-          <para>Install JBoss Messaging as described in <xref
-          linkend="install.manual" /> or <xref linkend="install4.automated" />
-          using the "all" (clustered) configuration as your source</para>
+        <para>There are few extra steps at <xref
+      linkend="install.extra-steps" /></para>
         </listitem>
+        
+        <listitem>That's it</listitem>
+        
+      </itemizedlist>
+      
+    </section>
+    
+    
+    
+   <section id="install.manualclustered">
+      <title>Clustered Manual Installation</title>
+      
+      <para>
+         <note>This installation procedure should be performed if you are installing into a JBoss AS
+         configuration that you have changed in some way from the default JBoss AS distribution.
+         If you are just using the standard, untouched JBoss AS 4.2 distribution you can use the automated procedure
+         above
+         </note>
+      </para>
+            
+      <para>For this procedure we assume you already have your custom configuration located at
+      <literal>JBOSS_CONFIG=$JBOSS_HOME/server/&lt;myconfiguration&gt;</literal>, and that it contains a JBoss MQ
+      installation.
+      </para>
+      
+      <para>You don't actually have to create an environment variable <literal>JBOSS_CONFIG</literal>, this is just
+      used in the installation instructions to describe the steps</para>
+      
+      <itemizedlist>
 
         <listitem>
-          <para>Ensure the server id in messaging-service.xml is unique for
-          each node on the cluster</para>
+          <para>Move <literal>$JBOSS_CONFIG/deploy/jms/hajndi-jms-ds.xml</literal> and
+          <literal>$JBOSS_CONFIG/deploy/jms/jms-ra.rar</literal> to <literal>$JBOSS_CONFIG/deploy</literal></para>
         </listitem>
 
         <listitem>
-          <para>replace hsqldb-persistence-service.xml with
-          YourDatabase-clustered-persistence-service.xml from
-          downloadPackage/examples/config</para>
+          <para>Remove the old JBoss MQ by removing the directory
+          <literal>$JBOSS_CONFIG/deploy/jms.</literal></para>.
+          
+          <para>Remove the old JBoss MQ jar file: <literal>$JBOSS_CONFIG/lib/jbossmq.jar</literal></para>
+
+          <para>Make sure you don't have any JBossMQ files under <literal>$JBOSS_CONFIG/deploy-hasingleton</literal>. For
+          that just remove <literal>$JBOSS_CONFIG/deploy-hasingleton/jms</literal></para>
         </listitem>
 
         <listitem>
-          <para>Deploy a JCA datasource as in
-          $JBOSS_SERVER/docs/examples/jca</para>
+          <para>Add a security policy called "messaging" on
+          $JBOSS_CONFIG/config/login-config.xml. You could use this as an
+          example, or create one according to JBoss Security
+          Documentation:</para>
 
-          <para>Make sure is bound to /DefaultDS and remove
-          hsqldb-ds.xml.</para>
+          <programlisting>
+&lt;application-policy name = "messaging"&gt;
+&lt;authentication&gt;
+&lt;login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" &gt;
+   &lt;module-option name = "unauthenticatedIdentity"&gt;guest&lt;/module-option&gt;
+   &lt;module-option name = "usersProperties"&gt;props/messaging-users.properties&lt;/module-option&gt;
+   &lt;module-option name = "rolesProperties"&gt;props/messaging-roles.properties&lt;/module-option&gt;
+&lt;/login-module&gt;
+&lt;/authentication&gt;
+&lt;/application-policy&gt;
+          </programlisting>
 
-          <para>It's required to use a shared database in clustered
-          environment. HSQLDB won't work for a clustered config.</para>
+          <para>In case you are using the above policy you should also create files
+          <literal>messaging-users.properties</literal> and <literal>messaging-roles.properties</literal> in the
+          <literal>$JBOSS_CONFIG/config/props/</literal> directory</para>.
+          
+          <para><note>You can find an example <literal>messaging-users.properties</literal> and
+          <literal>messaging-roles.properties</literal> in the JBoss Messaging distribution in the
+          <literal>&lt;downloadPackage&gt;src/etc/server/default/config</literal> directory.</note></para>
+
+          <programlisting>
+# messaging-roles.properties
+# Add roles as you like
+# user=role1,role2,...
+#
+guest=guest
+          </programlisting>
+
+          <programlisting>
+# messaging-users.properties
+
+# Add users as you like
+# user=password
+#
+guest=guest
+          </programlisting>
         </listitem>
 
         <listitem>
-          <para>Install your database driver jar into
-          $JBOSS_SERVER/&lt;YourServer&gt;/lib</para>
+          <para>Unzip jboss-messaging.sar from your download package into the directory
+          <literal>JBOSS_CONFIG/deploy/jboss-messaging.sar</literal></para>
+          <para>JBoss Messaging should be deployed unzipped (exploded) so you have easy access to its config
+          files which are stored there.</para>
         </listitem>
 
-        <listitem>
-          <para>If you want to run multiple instances bound to the same IP you
-          could use the Binding Manager</para>
+      <listitem>
+          <para><warning>For a clustered installation it is mandatory that a shared database is available to
+          all nodes in the cluster.
+          The default JBoss AS uses HSQLDB for its database which is a local shared database.
+          Therefore in order to use clustering you must replace this with a different shared database.
+          If the database is not replaced then clustering will not work.
+          </warning></para>
 
           <itemizedlist>
             <listitem>
-              <para>Uncomment binding manager service from
-              $JBOSS_HOME/yourServer/conf/jboss-service.xml</para>
+              <para>Replace 
+              <literal>$JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml</literal>
+              by the <literal>clustered-&lt;databasename&gt;-persistence-service</literal> from
+              <literal>&lt;downloadPackage&gt;/examples/config.</literal>. For instance
+              <literal>clustered-mysql-persistence-service.xml</literal>
+              </para>
             </listitem>
 
             <listitem>
+              <para>Configure a JCA datasource using an example from
+              <literal>$JBOSS_HOME/docs/examples/jca</literal></para> and copying to 
+              <literal>$JBOSS_CONFIG/deploy</literal>
+              <para>JBoss Messaging uses <literal>DefaultDS</literal> by default so you should configure
+              your datasource to bind to that</para>              
+            </listitem>
+
+            <listitem>
+              <para>Remove hsqldb-ds.xml from <literal>$JBOSS_CONFIG/deploy</literal></para>
+            </listitem>
+            
+            <listitem>
+              <para>Copy your database driver to <literal>$JBOSS_CONFIG/lib</literal></para>
+              <para>Your database driver can probably be downloaded from your database provider's
+              web site</para>
+            </listitem>
+            
+          </itemizedlist>
+      </listitem>      
+                  
+      <listitem>
+          <para>Ensure the <literal>ServerPeerID</literal> MBean constructor parameter in messaging-service.xml is unique for
+          each node on the cluster. The <literal>ServerPeerID</literal> value must be a valid integer.</para>
+          <para><warning>Each node must have a unique <literal>ServerPeerID</literal> for clustering to work!</warning></para>
+      </listitem>
+      
+     <listitem>
+        <para>If you want to run multiple JBoss Messaging nodes on the same box using the same IP address, e.g.
+        for development purposes, then you can use the ServiceBindingManager to do this as follows:
+        </para>
+      
+        <itemizedlist>
+           <listitem>
+              <para>Uncomment binding manager service from
+              $JBOSS_CONFIG/conf/jboss-service.xml</para>
+           </listitem>
+
+           <listitem>
               <para>Specify the desired port rage (e.g. ports-01, ports-02...
               etc)</para>
-            </listitem>
+           </listitem>
 
-            <listitem>
+           <listitem>
               <para>Look at
               $JBOSS_HOME/docs/examples/binding-manager/sample-bindings.xml.
               On each port range, JBoss Remoting configuration should look
               like:</para>
 
-              <programlisting>&lt;!-- ********************* jboss messaging ********************** --&gt;
+              <programlisting>
+      &lt;service-config name="jboss.messaging:service=Connector,transport=bisocket"
+                      delegateClass="org.jboss.services.binding.AttributeMappingDelegate"&gt;
+         &lt;delegate-config&gt;
+            &lt;attribute name="Configuration"&gt;&lt;![CDATA[
+	   &lt;config&gt;
+            &lt;invoker transport="bisocket"&gt;
+               &lt;attribute name="marshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
+               &lt;attribute name="unmarshaller" isParam="true"&gt;org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
+               &lt;attribute name="dataType" isParam="true"&gt;jms&lt;/attribute&gt;
+               &lt;attribute name="socket.check_connection" isParam="true"&gt;false&lt;/attribute&gt;
+               &lt;attribute name="timeout" isParam="true"&gt;0&lt;/attribute&gt;
+               &lt;attribute name="serverBindAddress"&gt;${jboss.bind.address}&lt;/attribute&gt;
+               &lt;attribute name="serverBindPort"&gt;4657&lt;/attribute&gt;
+               &lt;attribute name="leasePeriod"&gt;10000&lt;/attribute&gt;
+               &lt;attribute name="clientSocketClass" isParam="true"&gt;org.jboss.jms.client.remoting.ClientSocketWrapper&lt;/attribute&gt;
+               &lt;attribute name="serverSocketClass"&gt;org.jboss.jms.server.remoting.ServerSocketWrapper&lt;/attribute&gt;
+               &lt;attribute name="numberOfRetries" isParam="true"&gt;1&lt;/attribute&gt;
+               &lt;attribute name="numberOfCallRetries" isParam="true"&gt;1&lt;/attribute&gt;
+               &lt;attribute name="clientMaxPoolSize" isParam="true"&gt;50&lt;/attribute&gt;
+            &lt;/invoker&gt;
+            &lt;handlers&gt;
+               &lt;handler subsystem="JMS"&gt;org.jboss.jms.server.remoting.JMSServerInvocationHandler&lt;/handler&gt;
+            &lt;/handlers&gt;
+         &lt;/config&gt;
+            ]]&gt;&lt;/attribute&gt;
+         &lt;/delegate-config&gt;
+         &lt;binding port="4657"/&gt;
+      &lt;/service-config&gt;
+              
+              </programlisting>
+              
+              <warning>You must ensure that the config (like above) is identical to that in <literal>remoting-service.xml</literal>
+              With the exception of the actual serverBindPort which clearly must be different for each ports range.
+              Please note that the default JBoss Messaging service binding manager bindings in <literal>sample-bindings.xml</literal>
+              shipped with JBAS 4.2.0 is out of date and you will need to copy the config from <literal>remoting-service.xml</literal>
+              </warning>
 
-&lt;service-config name="jboss.messaging:service=Connector,transport=bisocket"
-                delegateClass="org.jboss.services.binding.AttributeMappingDelegate"&gt;
-&lt;delegate-config&gt;
-&lt;attribute name="Configuration"&gt;&lt;![CDATA[
-&lt;config&gt;
-&lt;invoker transport="bisocket"&gt;
-   &lt;attribute name="marshaller" isParam="true"&gt;
-                 org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
-   &lt;attribute name="unmarshaller" isParam="true"&gt;
-                 org.jboss.jms.wireformat.JMSWireFormat&lt;/attribute&gt;
-   &lt;attribute name="serializationtype" isParam="true"&gt;jms&lt;/attribute&gt;
-   &lt;attribute name="dataType" isParam="true"&gt;jms&lt;/attribute&gt;
-   &lt;attribute name="socket.check_connection" isParam="true"&gt;false&lt;/attribute&gt;
-   &lt;attribute name="timeout" isParam="true"&gt;0&lt;/attribute&gt;
-   &lt;attribute name="serverBindAddress"&gt;${jboss.bind.address}&lt;/attribute&gt;
-   &lt;attribute name="serverBindPort"&gt;4457&lt;/attribute&gt;
-   &lt;attribute name="leasePeriod"&gt;10000&lt;/attribute&gt;
-   &lt;attribute name="callbackStore"&gt;org.jboss.remoting.callback.CallbackStore&lt;/attribute&gt;
-   &lt;attribute name="clientSocketClass" isParam="true"&gt;
-                 org.jboss.jms.client.remoting.ClientSocketWrapper&lt;/attribute&gt;
-   &lt;attribute name="serverSocketClass"&gt;
-                 org.jboss.jms.server.remoting.ServerSocketWrapper&lt;/attribute&gt;
-   &lt;attribute name="callbackErrorsAllowed"&gt;1&lt;/attribute&gt;
-   &lt;attribute name="numberOfRetries" isParam="true"&gt;1&lt;/attribute&gt;
-   &lt;attribute name="NumberOfCallRetries" isParam="true"&gt;2&lt;/attribute&gt;
-   &lt;attribute name="clientMaxPoolSize" isParam="true"&gt;50&lt;/attribute&gt;
-&lt;/invoker&gt;
-&lt;handlers&gt;
-   &lt;handler subsystem="JMS"&gt;org.jboss.jms.server.remoting.JMSServerInvocationHandler&lt;/handler&gt;
-&lt;/handlers&gt;
-&lt;/config&gt;
-   ]]&gt;&lt;/attribute&gt;
-   &lt;/delegate-config&gt;
-   &lt;binding port="4457"/&gt;
-&lt;/service-config&gt;</programlisting>
-
-              <para>For ports-default you could use port 4457, ports-01 4557,
-              ports-02 4657 and ports-03 4757.</para>
+              <para>You should ensure that each node is configured to use a different ports range.</para>
             </listitem>
           </itemizedlist>
         </listitem>
+        
+        <listitem>
+        <para>There are few extra steps at <xref
+      linkend="install.extra-steps" /></para>
+        </listitem>
+        
+        <listitem>That's it</listitem>
+        
       </itemizedlist>
+      
+    </section>    
 
-      <para>There are few extra steps at <xref
-      linkend="install.extra-steps" /></para>
-    </section>
-
     <section id="install.extra-steps">
-      <title>Extra steps after your instalation is complete</title>
+      <title>Extra steps to complete your installation</title>
 
       <para>You should also make these changes on any configuration you
-      choose, to prevent references to the old JBossMQ:</para>
+      choose, to remove all references to the old JBossMQ:</para>
 
       <itemizedlist>
         <listitem>
-          <para>Edit $JBOSS_SERVER/server/YourConfig/jms-ds.xml and replace
+          <para>Edit <literal>$JBOSS_CONFIG/jms-ds.xml</literal> and replace
           jboss.mq by jboss.messaging on every occurrence</para>
+          <para>If you are in a clustered installation, then do the above with the file
+          <literal>$JBOSS_CONFIG/hajndi-jms-ds.xml</literal>
+          </para>
         </listitem>
-
+        
         <listitem>
-          <para>Edit $JBOSS_SERVER/server/YourConfig/config/standardjboss.xml
-          and set CreateJBossMQDestination to false on every occurrence</para>
+          <para>Edit <literal>$JBOSS_CONFIG/config/standardjboss.xml</literal>
+          and set <literal>CreateJBossMQDestination</literal> to false on every occurrence</para>
 
           <para>Make sure it looks like this:</para>
 
-          <para>&lt;CreateJBossMQDestination&gt;false&lt;/CreateJBossMQDestination&gt;</para>
+          <para><literal>&lt;CreateJBossMQDestination&gt;false&lt;/CreateJBossMQDestination&gt;</literal></para>
 
           <para>Those Proxies will try to create a Destination on JBossMQ if
           they can't find it on JNDI, what would cause some errors related to
@@ -291,9 +683,9 @@
         </listitem>
 
         <listitem>
-          <para>Edit $JBOSS_SERVER/server/YourConfig/config/jboss-service.xml
+          <para>Edit $JBOSS_CONFIG/config/jboss-service.xml
           and remove the reference to JBoss MQ on JSR-77 Management
-          Bean</para>
+          Bean:</para>
 
           <programlisting>
  &lt;!-- ==================================================================== --&gt;
@@ -307,7 +699,7 @@
         </listitem>
 
         <listitem>
-          <para>Change $JBOSS_SERVICE/server/YourConfig/conf/login-config.xml
+          <para>Change <literal>$JBOSS_CONFIG/conf/login-config.xml</literal>
           and remove jboss-mq security policies</para>
 
           <programlisting>
@@ -346,11 +738,18 @@
     </section>
   </section>
 
-  <section id="install.old.installation">
-    <title>JBoss Messaging on JBoss 4.0.4.GA and JBoss 4.0.5.GA</title>
+  <section id="install.jboss40x">
+    <title>JBoss Messaging on JBoss 4.0.x</title>
 
     <warning>
-       You should avoid using JBossMessaging on any version prior to JBoss 4.2.0.GA, such as 4.0.5.GA and 4.0.4.GA. JBoss Messaging uses newer versions of JBoss AOP, JBoss Remoting and JGroups compared to JBoss 4.0.X. If you really need to install JBoss Messaging on those versions you will have to update those jars as described on this section but this might cause problems with other components such as JBoss Web Services and EJB3. 
+       You should avoid using JBossMessaging on any version prior to JBoss 4.2.0.GA,
+        such as 4.0.5.GA and 4.0.4.GA.
+        JBoss Messaging uses newer versions of JBoss AOP, JBoss Remoting and JGroups compared to JBoss 4.0.X.
+        If you really need to install JBoss Messaging on those versions you will have to update those jars
+         as described on this section but this might cause problems with other components such as JBoss Web
+          Services and EJB3, and may cause other parts of JBoss AS to stop functioning.
+        Also there may be support implications when running in this configuration since the installation
+        procedure requires overwriting some of the jars in JBoss AS. Do this at your own peril!
     </warning>
 
     <itemizedlist>
@@ -362,9 +761,9 @@
       </listitem>
 
       <listitem>
-        <para>Replace the jars on this following list. You could download
-        these jars from www.jboss.org or use the repository links provided
-        bellow:</para>
+        <para>Replace the jars on this following list. You can download
+        these jars the repository links provided
+        below:</para>
 
         <itemizedlist>
           <listitem>
@@ -409,11 +808,6 @@
         </itemizedlist>
       </listitem>
 
-      <listitem>
-        <para>Make sure you use jboss-messaging-fat-client.jar on any client
-        VM. This file should have precedence on jboss-all-client.jar on the
-        ClassPath</para>
-      </listitem>
     </itemizedlist>
   </section>
 
@@ -423,83 +817,67 @@
     <para>To run the server, execute the <filename>run.bat</filename> or
     <filename>run.sh</filename> script as appropriate for your operating
     system, in the <filename>$JBOSS_HOME/bin</filename> directory.</para>
-
+    
     <programlisting>
 cd $JBOSS_HOME/bin
-./run.sh -c messaging
+./run.sh -c &lt;config name&gt;
    </programlisting>
+   
+   <para>Where config_name is the name of the JBoss AS configuration where you have installed messaging.
+   (The default is 'messaging')
+   </para>
 
     <para>A successful JBoss Messaging deployment generates logging output
-    similar to:</para>
+    similar to for a non clustered installation (for a clustered installation you will also see extra
+    cluster related output)</para>
 
     <programlisting>
 ....
-01:44:48,317 WARN  [JDBCPersistenceManager]
+13:19:14,914 WARN  [JDBCPersistenceManager] 
 
-JBoss Messaging Warning: DataSource connection transaction isolation should be
-       READ_COMMITTED, but it is currently NONE.
-       Using an isolation level less strict than READ_COMMITTED may lead to data
-       consistency problems.
-       Using an isolation level more strict than READ_COMMITTED may lead to deadlock.
+JBoss Messaging Warning: DataSource connection transaction isolation should be READ_COMMITTED, but it is currently NONE.
+                         Using an isolation level less strict than READ_COMMITTED may lead to data consistency problems.
+                         Using an isolation level more strict than READ_COMMITTED may lead to deadlock.
 
-01:44:50,450 INFO  [ServerPeer] JBoss Messaging 1.2.0.GA server [0] started
-01:44:51,311 INFO  [ConnectionFactory] Connector bisocket://192.168.1.104:4457 has
-leasing enabled, lease period 10000 milliseconds
-01:44:51,311 INFO  [ConnectionFactory] [/ConnectionFactory, /XAConnectionFactory,
-java:/ConnectionFactory, java:/XAConnectionFactory] started
-01:44:51,441 INFO  [ConnectionFactory] Connector bisocket://192.168.1.104:4457 has
-leasing enabled, lease period 10000 milliseconds
-01:44:51,441 INFO  [ConnectionFactory] [/NonClusteredConnectionFactory,
-/NonClusteredXAConnectionFactory, java:/NonClusteredConnectionFactory,
-java:/NonClusteredXAConnectionFactory] started
-01:44:51,681 INFO  [QueueService] Queue[/queue/DLQ] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,681 INFO  [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,732 INFO  [TopicService] Topic[/topic/testTopic] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,732 INFO  [TopicService] Topic[/topic/securedTopic] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,732 INFO  [TopicService] Topic[/topic/testDurableTopic] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,752 INFO  [QueueService] Queue[/queue/testQueue] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,752 INFO  [QueueService] Queue[/queue/A] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,762 INFO  [QueueService] Queue[/queue/B] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,762 INFO  [QueueService] Queue[/queue/C] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,882 INFO  [QueueService] Queue[/queue/D] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,882 INFO  [QueueService] Queue[/queue/ex] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,882 INFO  [QueueService] Queue[/queue/PrivateDLQ] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,892 INFO  [QueueService] Queue[/queue/PrivateExpiryQueue] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,892 INFO  [QueueService] Queue[/queue/QueueWithOwnDLQAndExpiryQueue] started,
-fullSize=200000, pageSize=2000, downCacheSize=2000
-01:44:51,892 INFO  [TopicService] Topic[/topic/TopicWithOwnDLQAndExpiryQueue] started,
-fullSize=200000, pageSize=2000, downCacheSize=2000
-01:44:51,942 INFO  [QueueService] Queue[/queue/QueueWithOwnRedeliveryDelay] started,
-fullSize=200000, pageSize=2000, downCacheSize=2000
-01:44:51,942 INFO  [TopicService] Topic[/topic/TopicWithOwnRedeliveryDelay] started,
-fullSize=200000, pageSize=2000, downCacheSize=2000
-01:44:51,952 INFO  [QueueService] Queue[/queue/testDistributedQueue] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:51,952 INFO  [TopicService] Topic[/topic/testDistributedTopic] started, fullSize=200000,
-pageSize=2000, downCacheSize=2000
-01:44:52,372 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager
-'jboss.jca:name=JmsXA,service=ConnectionFactoryBinding' to JNDI name 'java:JmsXA'
-....
+13:19:15,166 INFO  [ServerPeer] JBoss Messaging 1.3.0.GA server [0] started
+13:19:15,411 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
+13:19:15,412 INFO  [ConnectionFactory] [/ConnectionFactory, /XAConnectionFactory, java:/ConnectionFactory, java:/XAConnectionFactory] started
+13:19:15,412 WARN  [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
+13:19:15,413 WARN  [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing
+13:19:15,449 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
+13:19:15,449 INFO  [ConnectionFactory] [/ClusteredConnectionFactory, /ClusteredXAConnectionFactory, java:/ClusteredConnectionFactory, java:/ClusteredXAConnectionFactory] started
+13:19:15,468 INFO  [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,474 INFO  [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,476 INFO  [TopicService] Topic[/topic/testTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,478 INFO  [TopicService] Topic[/topic/securedTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,479 INFO  [TopicService] Topic[/topic/testDurableTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,482 INFO  [QueueService] Queue[/queue/testQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,483 INFO  [QueueService] Queue[/queue/A] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,485 INFO  [QueueService] Queue[/queue/B] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,487 INFO  [QueueService] Queue[/queue/C] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,489 INFO  [QueueService] Queue[/queue/D] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,490 INFO  [QueueService] Queue[/queue/ex] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,501 INFO  [QueueService] Queue[/queue/PrivateDLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,503 INFO  [QueueService] Queue[/queue/PrivateExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,507 INFO  [QueueService] Queue[/queue/QueueWithOwnDLQAndExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,508 INFO  [TopicService] Topic[/topic/TopicWithOwnDLQAndExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,511 INFO  [QueueService] Queue[/queue/QueueWithOwnRedeliveryDelay] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,512 INFO  [TopicService] Topic[/topic/TopicWithOwnRedeliveryDelay] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,514 INFO  [QueueService] Queue[/queue/testDistributedQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,519 INFO  [TopicService] Topic[/topic/testDistributedTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
+13:19:15,809 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
+13:19:15,834 INFO  [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
+13:19:16,322 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
+13:19:16,342 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
+13:19:16,480 INFO  [Server] JBoss (MX MicroKernel) [4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)] Started in 19s:359ms
+
    </programlisting>
 
     <note>
        The warning message 
 
-      <literal>DataSource connection transaction isolation should be
-      READ_COMMITTED, but it is currently NONE</literal>
+      <literal>"DataSource connection transaction isolation should be
+      READ_COMMITTED, but it is currently NONE"</literal>
 
        is there to remind you that by default JBossAS ships with Hypersonic, an in-memory Java-based database engine, which is apropriate for demo purposes, but not for heavy load production environments. The 
 
@@ -538,6 +916,8 @@
     bundle and drill down to <filename>/examples/queue</filename>. Apache Ant
     must pe present in your path in order to be able to run the
     example.</para>
+    
+    <para>Make sure you start the JBoss server before trying to run the tests</para>
 
     <programlisting>
 
@@ -550,38 +930,40 @@
     <para>A successfull execution log output looks similar to:</para>
 
     <programlisting>
-$ ant
+[tim at Vigor14 queue]$ ant
 Buildfile: build.xml
 
 identify:
-[echo] ###########################################################################
-[echo] #                       Running the QUEUE example                         #
-[echo] ###########################################################################
-[echo] The queue:      testQueue
-[echo] The client jar: ../../../output/lib/jboss-messaging-client.jar
+     [echo] ###########################################################################
+     [echo] #                       Running the QUEUE example                         #
+     [echo] ###########################################################################
+     [echo] The queue:      testQueue
+     [echo] The client jar: ../../../output/lib/jboss-messaging-client.jar
 
 sanity-check:
 
 init:
-[mkdir] Created dir: c:\work\src\svn\messaging\docs\examples\queue\output
-[mkdir] Created dir: c:\work\src\svn\messaging\docs\examples\common\output
+    [mkdir] Created dir: /home/tim/dev/jboss-messaging/trunk/docs/examples/queue/output/classes
+    [mkdir] Created dir: /home/tim/dev/jboss-messaging/trunk/docs/examples/common/output/classes
 
 compile:
-[javac] Compiling 5 source files to c:\work\src\svn\messaging\docs\examples\common\output
-[javac] Compiling 1 source file to c:\work\src\svn\messaging\docs\examples\queue\output
+    [javac] Compiling 5 source files to /home/tim/dev/jboss-messaging/trunk/docs/examples/common/output/classes
+    [javac] Compiling 1 source file to /home/tim/dev/jboss-messaging/trunk/docs/examples/queue/output/classes
 
 run:
-   [java] Queue /queue/testQueue exists
-   [java] The message was successfully sent to the testQueue queue
-   [java] Received message: Hello!
-   [java] The example connected to JBoss Messaging version 1.2.0.GA (1.2)
-   [java]
-   [java] #####################
-   [java] ###    SUCCESS!   ###
-   [java] #####################
+     [java] Queue /queue/testQueue exists
+     [java] The message was successfully sent to the testQueue queue
+     [java] Received message: Hello!
+     [java] The example connected to JBoss Messaging version 1.3.0.GA (1.3)
 
+     [java] #####################
+     [java] ###    SUCCESS!   ###
+     [java] #####################
+
 BUILD SUCCESSFUL
-Total time: 9 seconds
+Total time: 5 seconds
+[tim at Vigor14 queue]$
+
 </programlisting>
 
     <para>It is recommended to run <literal>all</literal> validation examples
@@ -591,4 +973,62 @@
     linkend="examples" />, we will have a look at each of those
     examples.</para>
   </section>
+  
+  <section id="inst.remoteclient">
+    <title>Accessing JBoss Messaging from a remote client</title>
+    
+    <para>
+       In order to access JBoss Messaging from a client outside the JBoss app server, you will need to ensure the
+       following jar files are on the client classpath:
+    </para>
+    
+    <itemizedlist>
+       <listitem>
+          <para>
+          jboss-messaging-client.jar - This is available in the messaging distribution
+          </para>
+       </listitem>
+       <listitem>
+          <para>
+          jbossall-client.jar - This is available in your $JBOSS_HOME/client directory
+          </para>
+       </listitem>
+       <listitem>
+            <para>$JBOSS_HOME/server/&lt;SERVER_NAME&gt;/deploy/jboss-aop.deployer/jboss-aop.jar</para>
+
+            <para>JBoss AOP 1.5.5.GA+</para>
+
+            <para><ulink
+            url="http://repository.jboss.com/jboss/aop/1.5.5.GA/lib/">http://repository.jboss.com/jboss/aop/1.5.5.GA/lib/</ulink></para>
+
+            <para>(For AOP, sometimes you have to use a specific JAR according
+            to your JVM of choice. Use the most convenient for you)</para>
+       </listitem>
+          
+       <listitem>
+            <para>$JBOSS_HOME/server/&lt;SERVER_NAME&gt;/lib/javassist.jar</para>
+
+            <para>Javassist 3.5.0.GA-brew+</para>
+
+            <para><ulink
+            url="http://repository.jboss.com/javassist/3.5.0.GA-brew/lib/">http://repository.jboss.com/javassist/3.5.0.GA-brew/lib/</ulink></para>
+       </listitem>
+          
+       <listitem>
+       
+           <para>$JBOSS_HOME/server/&lt;SERVER_NAME&gt;/lib/trove.jar</para>
+       
+           <para>trove 1.0.2-brew</para>
+           
+           <para><ulink
+            url="http://repository.jboss.com/trove/1.0.2-brew/lib/">http://repository.jboss.com/trove/1.0.2-brew/lib/</ulink></para>
+
+       </listitem>
+                    
+       <listitem>
+          <para>log4j</para>
+       </listitem>
+       
+    </itemizedlist>
+  </section>
 </chapter>
\ No newline at end of file

Modified: trunk/docs/userguide/en/modules/introduction.xml
===================================================================
--- trunk/docs/userguide/en/modules/introduction.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/docs/userguide/en/modules/introduction.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -11,16 +11,24 @@
       JBoss Messaging implements a high performance, robust messaging core that is designed to
       support the largest and most heavily utilized SOAs, enterprise service buses (ESBs) and other
       integration needs ranging from the simplest to the highest demand networks.
+   </para>
+   <para>
       It will allow you to smoothly distribute your application load across your cluster,
       intelligently balancing and utilizing each nodes CPU cycles, with no single point of failure,
-      providing a highly scalable and perform-ant clustering implementation. JBoss Messaging includes
+      providing a highly scalable and perform-ant clustering implementation.
+   </para>
+   <para>   
+    JBoss Messaging includes
       a JMS front-end to deliver messaging in a standards-based format as well as being designed to be
-     able to support other messaging protocols in the future.
+      able to support other messaging protocols in the future.
    </para>
 
    <para>
       JBoss Messaging is destined to become an integral part of the JBoss Enterprise Application Platform, 
-      and the new Service Integration Platform. Currently itis available for embedded use within the JBoss Application Server
+      and the new Service Integration Platform.
+   </para>
+   <para>   
+    Currently it is available for embedded use within the JBoss Application Server
       4.2.0.GA or later (JBossAS). Work to integrate JBoss Messaging with the new JBoss Microcontainer is under way.      
    </para>
    
@@ -41,15 +49,14 @@
          Messaging.
       </para>
       <para>
-         Until that point developer assist support is available for JBoss Messaging when installed in JBoss 4.2.x
+         Currently developer support is available for JBoss Messaging when installed in JBoss 4.2.x
       </para>
-      <para>Exceptions can be made for existing customers or new customers already using or intending to use JBoss Messaging in production environments
-      </para>
 
+
    </section>
 
    <section id="features">
-      <title>JBoss Messaging 1.2.0.GA Features</title>
+      <title>JBoss Messaging Features</title>
 
       <para>
          JBoss Messaging provides:
@@ -59,60 +66,24 @@
          <listitem>
             <para>
                A fully compatible and Sun certified JMS 1.1 implementation, that currently works
-               with a standard 4.2.x installation.
+               with a standard 4.2.x JBoss Application Server installation.
             </para>
          </listitem>
          <listitem>
             <para>
                A strong focus on performance, reliability and scalability with high throughput and
-               low latency. JBoss Messaging already exceeds JBoss MQ in a number of measured
-               performance metrics. Full results will follow.
+               low latency.
             </para>
          </listitem>
          <listitem>
             <para>
                A foundation for JBoss ESB for SOA initiatives; JBoss ESB uses
-               JBoss Messaging as its foundation.
+               JBoss Messaging as its default JMS provider.
             </para>
          </listitem>
       </itemizedlist>
 
       <para>
-         JBoss Messaging consists of two major parts:
-      </para>
-
-      <itemizedlist>
-         <listitem>
-            <para>
-               JBoss Messaging Core – a transactional, reliable messaging transport system.
-            </para>
-            <itemizedlist>
-               <listitem>
-                  <para>
-                     Supports generalized messages (not just JMS)
-                  </para>
-               </listitem>
-               <listitem>
-                  <para>
-                     Enables other messaging protocol façades to be added
-                  </para>
-               </listitem>
-               <listitem>
-                  <para>
-                     Distributed, transactional and reliable
-                  </para>
-               </listitem>
-            </itemizedlist>
-         </listitem>
-
-         <listitem>
-            <para>
-               JMS Façade – the JMS "personality" of JBoss Messaging.
-            </para>
-         </listitem>
-      </itemizedlist>
-
-      <para>
          Other JBoss Messaging features include:
       </para>
 
@@ -124,17 +95,12 @@
          </listitem>
          <listitem>
             <para>
-               Topics that feed multiple message queues
-            </para>
-         </listitem>
-         <listitem>
-            <para>
                Persistent and non-persistent messages
             </para>
          </listitem>
          <listitem>
             <para>
-               Guaranteed message delivery that ensures that messages arrive once and only once
+               Guaranteed message delivery that ensures that messages arrive once and only once where required
             </para>
          </listitem>
          <listitem>
@@ -167,10 +133,15 @@
                HTTP transport
             </para>
          </listitem>
+         <listitem>
+            <para>
+               SSL transport
+            </para>
+         </listitem>
       </itemizedlist>
 
       <para>
-         JBoss Messaging 1.2.0.GA Clustering provides the following features:
+         Clustering features:
       </para>
 
       <itemizedlist>
@@ -227,7 +198,7 @@
          </listitem>
          <listitem>
             <para>
-               Message bridge. JBoss Messaging 1.2 contains a message bridge component which enables you to bridge messages between any two JMS1.1 destinations
+               Message bridge. JBoss Messaging contains a message bridge component which enables you to bridge messages between any two JMS1.1 destinations
                on the same or physical separate locations. (E.g. separated by a WAN)
          </para>
          </listitem>
@@ -241,52 +212,25 @@
       <title>Compatibility with JBossMQ</title>
 
       <para>
-         JBossMQ is the JMS implementation currently shipped within JBossAS.
+         JBoss MQ is the JMS implementation currently shipped within JBoss AS.
          Since JBoss Messaging is JMS 1.1 and JMS 1.0.2b compatible, the JMS code  written against
          JBossMQ will run with JBoss Messaging without any changes.
       </para>
+      
+      <para>
+         JBoss Messaging does not have wire format compatibility with JBoss MQ so it would be necessary to upgrade
+         JBoss MQ clients with JBoss Messaging client jars
+      </para>
 
       <important>
          Even if JBoss Messaging deployment descriptors are very similar to JBoss MQ
          deployment descriptors, they are <emphasis>not</emphasis> identical, so they will require
          some simple adjustments to get them to work with JBoss Messaging. Also, the database
-         data model is completely different, so don't attempt to use JBoss Messaging with a JBossMQ
+         data model is completely different, so don't attempt to use JBoss Messaging with a JBoss MQ
          data schema and vice-versa.
       </important>
+            
    </section>
+   
 
-   <section id="missingfeatures">
-      <title>
-      Features not yet available in the 1.2.0.GA release, but coming soon
-      </title>
-
-      <para>
-    All the final features are available apart from:
-    </para>
-
-    <itemizedlist>
-
-        <listitem>
-           <para>
-              In a very near future, it will be possible to guarantee persistent level reliability
-               guarantee without persistence. By replicating persistent messages between nodes in
-               memory, we can obtain comparable reliability levels to persisting messages to disk,
-               without actually storing them to disk. However, this feature is not available
-               in the 1.2.0.GA release. If you're interested in how this feature will be available,
-               this is the JIRA issue you can use to track it:
-               <ulink url="http://jira.jboss.org/jira/browse/JBMESSAGING-574">http://jira.jboss.org/jira/browse/JBMESSAGING-574</ulink>
-           </para>
-        </listitem>
-
-        <listitem>
-            <para>
-                The "unreliable link scenario"
-                <ulink url="http://jira.jboss.org/jira/browse/JBMESSAGING-676">http://jira.jboss.org/jira/browse/JBMESSAGING-676</ulink>
-                whose development is still on-going on a parallel branch.
-            </para>
-        </listitem>
-
-    </itemizedlist>
-    </section>
-
 </chapter>

Deleted: trunk/docs/userguide/en/modules/performance.xml
===================================================================
--- trunk/docs/userguide/en/modules/performance.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/docs/userguide/en/modules/performance.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -1,185 +0,0 @@
-<chapter id="performance">
-
-  <title>Generating Performance Benchmark Results</title>
-
-  <para>
-      As we discussed in <xref linkend="about"/>, the key advantage of JBoss Messaging is
-      its superior performance. In fact, the JBoss Messaging comes with a set of standard
-      performance test. You can run them on your server and generate your own performance
-      benchmark results. In this chapter, we will show you how to run a JBoss Messaging server
-      and a JBossMQ server side-by-side on a single machine, and compare their performance.
-      To get the performance tests, you have to obtain the JBoss Messaging source code from SVN
-      as described in <xref linkend="gettingstarted"/>.
-  </para>
-
-  <para>
-    To get the performance tests, you first need to check out the source code and build the project. The location of the framework's source code will be
-    referred to as $PERF_HOME throughout the rest of the document.
-  </para>
-
-  <programlisting>
-svn co https://svn.jboss.org/repos/messaging/projects/perf/trunk messaging-perf
-cd $PERF_HOME
-ant
-  </programlisting>
-
-  <para>The test consists in sending bursts of 1000 0 Kilobytes non-persistent messages to both JBoss Messaging and JBossMQ instances while gradually increasing the send rate (200 messages/sec, 400 messages/sec, etc) and measuring the receive rate. At the end, the framework generates the graph representing the receive rate as function of the send rate for two executions (JBoss Messaging and JBossMQ).</para>
-
-  <section>
-    <title>Run JBoss Messaging and JBossMQ Side-by-side</title>
-
-    <para>
-        To run performance tests side-by-side on the same machine, we assume that you create
-        two JBoss AS configurations with the JBoss Messaging and JBossMQ modules respectively.
-        We assume that the JBoss Messaging module is installed in the
-        <literal>server/messaging</literal> directory (see <xref linkend="installation"/>),
-        and the default JBossMQ module is installed in <literal>server/jbossmq</literal>
-        directory (just copy the original <literal>default</literal> directory that comes with
-        the server).</para>
-
-    <para>Now, if you run the two configurations on the same server, there will be port conflicts. To avoid that, we use the JBoss <literal>ServiceBindingManager</literal> to increase the port numbers in the <literal>jbossmq</literal> configuration by 100 (i.e., the JNDI service will be available at port 1199 instead of 1099). To do that, un-comment the following line in <literal>server/jbossmq/conf/jboss-service.xml</literal></para>
-
-    <programlisting>
-&lt;mbean code="org.jboss.services.binding.ServiceBindingManager"
-       name="jboss.system:service=ServiceBindingManager">
-
-  &lt;attribute name="ServerName">ports-01&lt;/attribute>WWWr
-  &lt;attribute name="StoreURL">
-    ../docs/examples/binding-manager/sample-bindings.xml
-  &lt;/attribute>
-  &lt;attribute name="StoreFactoryClassName">
-    org.jboss.services.binding.XMLServicesStoreFactory
-  &lt;/attribute>
-&lt;/mbean>
-    </programlisting>
-
-    <para>Now, you can start the <literal>messaging</literal> and <literal>jbossmq</literal> configurations side-by-side for testing.</para>
-
-    <programlisting>
-run -c messaging
-run -c jbossmq
-    </programlisting>
-
-  </section>
-
-  <section>
-    <title>Setup the Tests</title>
-
-    <para>The performance framework relies on distributed executors to send messages into the providers being tested. The executors can run standalone in their own VM and act as "remote" JMS connections, or colocated, in which case they are deployed as JBoss services and simulate "colocated" JMS connections.</para>
-
-    <para>In order to correctly deploy the colocated executors, the framework relies on the <literal>JBOSS_HOME</literal> environment variable. It assumes directories <literal>$JBOSS_HOME/server/messaging</literal> and <literal>$JBOSS_HOME/server/jbossmq</literal> exist.</para>
-
-    <programlisting>
-ant sar
-ant start-executors
-    </programlisting>
-
-    <para>Next, we need to deploy test message destinations. They are in the <literal>messaging-destinations-service.xml</literal>, <literal>jbossmq-destinations-service.xml</literal> files. Feel free to add your own destinations (must add equivalent ones in both files) and then deploy them via the following command.</para>
-
-    <programlisting>
-ant deploy-destinations
-    </programlisting>
-
-  </section>
-
-  <section>
-    <title>Configure Test Runs</title>
-
-    <para>The <literal>etc/perf.xml</literal> file is used to configure tests. In our setting (i.e., <literal>jbossmq</literal> runs in +100 port range from default), the <literal>&lt;providers></literal> section should look like the following. We can easily run the two JMS server configurations on different machines or in other port ranges. You just need to change the host and port numbers here for tests.</para>
-
-    <programlisting>
-&lt;provider name="JBossMessaging">
-  &lt;factory>org.jnp.interfaces.NamingContextFactory&lt;/factory>
-  &lt;url>jnp://localhost:1099&lt;/url>
-  &lt;pkg>org.jboss.naming:org.jnp.interfaces&lt;/pkg>
-  &lt;executor name="REMOTE" url="rmi://localhost:7777/standalone"/>
-  &lt;executor name="REMOTE2" url="rmi://localhost:7777/standalone2"/>
-  &lt;executor name="COLOCATED" url="rmi://localhost:7777/local-messaging"/>
-  &lt;executor name="COLOCATED2" url="rmi://localhost:7777/local-messaging2"/>
-&lt;/provider>
-
-&lt;provider name="JBossMQ">
-  &lt;factory>org.jnp.interfaces.NamingContextFactory&lt;/factory>
-  &lt;url>jnp://localhost:1199&lt;/url>
-  &lt;pkg>org.jboss.naming:org.jnp.interfaces&lt;/pkg>
-  &lt;executor name="REMOTE" url="rmi://localhost:7777/standalone"/>
-  &lt;executor name="REMOTE2" url="rmi://localhost:7777/standalone2"/>
-  &lt;executor name="COLOCATED" url="rmi://localhost:7777/local-jbossmq"/>
-  &lt;executor name="COLOCATED2" url="rmi://localhost:7777/local-jbossmq2"/>
-&lt;/provider>
-    </programlisting>
-
-    <para>The performance configuration section configures how to ramp up the load from 200 messages / sec to 3000 message / sec. We will gather statistics on the number of processed messages versus the number of sent messages.</para>
-
-    <programlisting>
-&lt;performance-test name="Throughput O KB Message
-   Non-Persistent Non-Transactional, 1 sender, 1 receiver">
-
-  &lt;message-size>0&lt;/message-size>
-  &lt;messages>10000&lt;/messages>
-
-  &lt;drain/>
-
-  &lt;parallel>
-    &lt;send rate="200" executor="COLOCATED"/>
-    &lt;receive executor="COLOCATED2"/>
-  &lt;/parallel>
-
-  &lt;parallel>
-    &lt;send rate="400" executor="COLOCATED"/>
-    &lt;receive executor="COLOCATED2"/>
-  &lt;/parallel>
-
-  &lt;parallel>
-    &lt;send rate="800" executor="COLOCATED"/>
-    &lt;receive executor="COLOCATED2"/>
-  &lt;/parallel>
-
-  &lt;parallel>
-    &lt;send rate="1000" executor="COLOCATED"/>
-    &lt;receive executor="COLOCATED2"/>
-  &lt;/parallel>
-
-  &lt;parallel>
-    &lt;send rate="1500" executor="COLOCATED"/>
-    &lt;receive executor="COLOCATED2"/>
-  &lt;/parallel>
-
-  &lt;parallel>
-    &lt;send rate="2000" executor="COLOCATED"/>
-    &lt;receive executor="COLOCATED2"/>
-  &lt;/parallel>
-
-  &lt;parallel>
-    &lt;send rate="2500" executor="COLOCATED"/>
-    &lt;receive executor="COLOCATED2"/>
-  &lt;/parallel>
-
-  &lt;parallel>
-    &lt;send rate="3000" executor="COLOCATED"/>
-    &lt;receive executor="COLOCATED2"/>
-  &lt;/parallel>
-
-  &lt;execution provider="JBossMessaging"/>
-  &lt;execution provider="JBossMQ"/>
-
-&lt;/performance-test>
-    </programlisting>
-
-  </section>
-
-  <section>
-    <title>Run the Tests</title>
-
-    <para>To run the tests, simply execute <literal>ant run</literal> from the command line. You can access the benchmark result graphs from <literal>output/results/benchmark-results.html</literal>.</para>
-
-    <para>After running the test, you can clean up the executors and test destinations using the following commands.</para>
-
-    <programlisting>
-ant stop-executors
-ant undeploy-destinations
-    </programlisting>
-
-  </section>
-
-</chapter>
\ No newline at end of file

Modified: trunk/docs/userguide/en/modules/runningexamples.xml
===================================================================
--- trunk/docs/userguide/en/modules/runningexamples.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/docs/userguide/en/modules/runningexamples.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -3,775 +3,93 @@
   <title>Running the Examples</title>
 
   <para>
-      Since JBoss Messaging is a fully compliant JMS 1.1 provider, it supports the entire JMS 1.1 API. So, all
-      JMS applications should work without modification. Integrated inside a JBoss AS, we should
-      also be able access the JMS system from EJBs and write message-driven beans against JMS
-      destinations.
+      In the directory <literal>docs/examples</literal>, you will find a set of examples demonstrating
+      JBoss Messaging working in various examples, they include:
+      
+      <itemizedlist>
+         <listitem>
+            <para>docs/example/queue</para>
+            <para>This example shows a simple send and receive to a remote queue using a JMS client</para>
+         </listitem>
+         
+         <listitem>
+            <para>docs/example/topic</para>
+            <para>This example shows a simple send and receive to a remote topic using a JMS client</para>
+         </listitem>
+         
+         <listitem>
+            <para>docs/example/mdb</para>
+            <para>This example demonstrates usage of an EJB2.1 MDB with JBoss Messaging</para>
+         </listitem> 
+         
+         <listitem>
+            <para>docs/example/ejb3mdb</para>
+            <para>This example demonstrates usage of an EJB3 MDB with JBoss Messaging</para>
+         </listitem>   
+         
+         <listitem>
+            <para>docs/example/stateless</para>
+            <para>This example demonstrates an EJB2.1 stateless session bean interacting with JBoss Messaging</para>
+         </listitem>
+         
+         <listitem>
+            <para>docs/example/mdb-failure</para>
+            <para>This example demonstrates rollback and redelivery occuring with an EJB2.1 MDB</para>
+         </listitem> 
+         
+         <listitem>
+            <para>docs/example/secure-socket</para>
+            <para>This example demonstrates a JMS client interacting with a JBoss Messaging server
+            using SSL encrypted transport</para>
+         </listitem>  
+         
+         <listitem>
+            <para>docs/example/http</para>
+            <para>This example demonstrates a JMS client interacting with a JBoss Messaging server
+            tunneling traffic over the HTTP protocol</para>
+         </listitem>   
+         
+         <listitem>
+            <para>docs/example/web-service</para>
+            <para>This example demonstrates JBoss web-service interacting with JBoss Messaging</para>
+         </listitem>   
+         
+         <listitem>
+            <para>docs/example/distributed-queue</para>
+            <para>This example demonstrates a JMS client interacting with a JBoss Messaging distributed
+            queue - it requires two JBoss AS instances to be running</para>
+         </listitem>   
+         
+         <listitem>
+            <para>docs/example/distributed-topic</para>
+            <para>This example demonstrates a JMS client interacting with a JBoss Messaging distributed
+            topic - it requires two JBoss AS instances to be running</para>
+         </listitem>  
+         
+         <listitem>
+            <para>docs/example/stateless-clustered</para>
+            <para>This example demonstrates a JMS client interacting with clustered EJB2.1
+            stateless session bean, which in turn interactes with JBoss Messaging.
+            The example uses HAJNDI to lookup the connection factory</para>
+         </listitem>                                                              
+               
+      </itemizedlist>
   </para>
-
-
+  
+  <para>It is highly recommended that you familiarise yourself with the examples.</para>
+  
   <para>
-      In the following sections, we will look at examples of the various JMS messaging models
-      and message-driven beans. They make use of pre-configured JMS destinations and connection
-      factories that come default with the server. So, no extra configuration is needed to run
-      those examples. Just set JBOSS_HOME and run <literal>ant</literal> in each example
-      directory, as we described in <xref linkend="inst.validation"/>. The example source
-      directories are located in the distribution under <literal>docs/examples</literal>.
+     Make sure you start the JBoss server(s) before running the examples!
   </para>
+  
+  <para>The non clustered examples expect a JBoss AS instance to be running with all the default settings
+  </para>
+  
+  <para>The clustered examples expect two JBoss AS instances to running with ports settings as per ports-01 and
+  ports-02.</para>
+  
+  <para>For each example, you can always override the default ports it will try to connect to by editing
+  jndi.properties in the particular example directory
+  </para>
 
-  <section id="examples.queue">
-    <title>Sending messages to a queue</title>
-
-    <para>
-    Open an new command line. Set the JBOSS_HOME environment variable to point at a JBossAS 4.x
-    installation. Navigate to the folder where you exploded the main archive and drill down to
-    <literal>/examples/queue</literal>. You need to use Apache <literal>ant</literal> to execute
-    the <literal>build.xml</literal> file.
-    </para>
-
-    <para>
-        Make sure the JBoss server reference by the JBOSS_HOME is started.
-   </para>
-
-    <programlisting>
-public class QueueExample extends ExampleSupport
-{
-
-   public void example() throws Exception
-   {
-      String destinationName = getDestinationJNDIName();
-
-      InitialContext ic = null;
-      ConnectionFactory cf = null;
-      Connection connection =  null;
-
-      try
-      {
-         ic = new InitialContext();
-
-         cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
-         Queue queue = (Queue)ic.lookup(destinationName);
-         log("Queue " + destinationName + " exists");
-
-         connection = cf.createConnection();
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer sender = session.createProducer(queue);
-
-         TextMessage message = session.createTextMessage("Hello!");
-         sender.send(message);
-         log("The message was successfully sent to the " + queue.getQueueName() + " queue");
-
-         MessageConsumer consumer =  session.createConsumer(queue);
-
-         connection.start();
-
-         message = (TextMessage)consumer.receive(2000);
-         log("Received message: " + message.getText());
-         assertEquals("Hello!", message.getText());
-
-         displayProviderInfo(connection.getMetaData());
-
-      }
-      finally
-      {
-         if(ic != null)
-         {
-            try
-            {
-               ic.close();
-            }
-            catch(Exception e)
-            {
-               throw e;
-            }
-         }
-
-         // ALWAYS close your connection in a finally block to avoid leaks.
-         // Closing connection also takes care of closing its related objects e.g. sessions.
-         closeConnection(connection);
-      }
-   }
-
-   private void closeConnection(Connection con)
-   {
-      try
-      {
-         if (con != null)
-         {
-            con.close();
-         }
-      }
-      catch(JMSException jmse)
-      {
-         log("Could not close connection " + con +" exception was " + jmse);
-      }
-   }
-
-   protected boolean isQueueExample()
-   {
-      return true;
-   }
-
-   public static void main(String[] args)
-   {
-      new QueueExample().run();
-   }
-
-}
-    </programlisting>
-
-  </section>
-
-
-  <section id="examples.topic">
-    <title>Sending messages to a topic</title>
-    <para>In this example, a standalone Java client publishes a text-based JMS message to a topic and a single subscriber pulls the message off the queue.
-    </para>
-
-    <para>
-    Open an new command line. Set the JBOSS_HOME environment variable to point at a JBossAS 4.x installation. Navigate to the folder where you exploded the main archive and drill down to <literal>/examples/queue</literal>. You need to use Apache Ant to execute the build.xml file
-    Make sure the JBoss server reference by the JBOSS_HOME is started.
-   </para>
-
-   <programlisting>
-public class TopicExample extends ExampleSupport
-{
-   public void example() throws Exception
-   {
-      String destinationName = getDestinationJNDIName();
-
-      InitialContext ic = null;
-      Connection connection = null;
-
-      try
-      {
-         ic = new InitialContext();
-
-         ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
-         Topic topic = (Topic)ic.lookup(destinationName);
-         log("Topic " + destinationName + " exists");
-
-         connection = cf.createConnection();
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer publisher = session.createProducer(topic);
-         MessageConsumer subscriber = session.createConsumer(topic);
-
-         ExampleListener messageListener = new ExampleListener();
-         subscriber.setMessageListener(messageListener);
-         connection.start();
-
-         TextMessage message = session.createTextMessage("Hello!");
-         publisher.send(message);
-         log("The message was successfully published on the topic");
-
-         messageListener.waitForMessage();
-
-         message = (TextMessage)messageListener.getMessage();
-         log("Received message: " + message.getText());
-         assertEquals("Hello!", message.getText());
-
-         displayProviderInfo(connection.getMetaData());
-
-      }
-      finally
-      {
-         if (ic != null)
-         {
-            try
-            {
-               ic.close();
-            }
-            catch(Exception e)
-            {
-               throw e;
-            }
-         }
-
-         // ALWAYS close your connection in a finally block to avoid leaks.
-         // Closing connection also takes care of closing its related objects e.g. sessions.
-         closeConnection(connection);
-      }
-   }
-
-   private void closeConnection(Connection con) throws JMSException
-   {
-
-      try
-      {
-         if (con != null)
-         {
-            con.close();
-         }
-      }
-      catch(JMSException jmse)
-      {
-         log("Could not close connection " + con +" exception was " + jmse);
-      }
-   }
-
-   protected boolean isQueueExample()
-   {
-      return false;
-   }
-
-   public static void main(String[] args)
-   {
-      new TopicExample().run();
-   }
-
-}
-   </programlisting>
-
-  </section>
-
-  <section id="examples.stateless">
-    <title>Using JMS from an EJB</title>
-    <para>This example deploys a simple Stateless Session Bean that is used as a proxy to send and receive JMS messages in a managed environment.
-    </para>
-
-      <warning>
-         Receiving a JMS message from inside an EJB (or MBean or servlet) method is considered an anti-pattern since it will require the creation
-         of a new JMS consumer on every send - even when using the JCA adaptor. This is likely to make it very slow. (Users of the Spring JMSTemplate be warned that this is what it uses
-         to implement it's receive.)
-         If you want to receive messages as part of a global transaction then use an MDB instead.
-      </warning>
-
-    <programlisting>
-public class StatelessSessionExampleBean implements SessionBean
-{
-
-   private ConnectionFactory cf = null;
-
-   public void drain(String queueName) throws Exception
-   {
-      InitialContext ic = new InitialContext();
-      Queue queue = (Queue)ic.lookup(queueName);
-      ic.close();
-
-      Session session = null;
-      Connection conn = null;
-
-      try
-      {
-         conn = getConnection();
-         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageConsumer consumer = session.createConsumer(queue);
-         Message m = null;
-         do
-         {
-            m = consumer.receiveNoWait();
-         }
-         while(m != null);
-      }
-      finally
-      {
-         if (conn != null)
-         {
-            closeConnection(conn);
-         }
-      }
-   }
-
-   public void send(String txt, String queueName) throws Exception
-   {
-      InitialContext ic = new InitialContext();
-
-      Queue queue = (Queue)ic.lookup(queueName);
-
-      ic.close();
-
-      Session session = null;
-      Connection conn = null;
-
-      try
-      {
-         conn = getConnection();
-
-         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         MessageProducer producer = session.createProducer(queue);
-
-         TextMessage tm = session.createTextMessage(txt);
-
-         producer.send(tm);
-
-         System.out.println("message " + txt + " sent to " + queueName);
-      }
-      finally
-      {
-         if (conn != null)
-         {
-            closeConnection(conn);
-         }
-      }
-   }
-
-   public int browse(String queueName) throws Exception
-   {
-      InitialContext ic = new InitialContext();
-      Queue queue = (Queue)ic.lookup(queueName);
-      ic.close();
-
-      Session session = null;
-      Connection conn = null;
-
-      try
-      {
-         conn = getConnection();
-         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         QueueBrowser browser = session.createBrowser(queue);
-
-         ArrayList list = new ArrayList();
-         for(Enumeration e = browser.getEnumeration(); e.hasMoreElements(); )
-         {
-            list.add(e.nextElement());
-         }
-
-         return list.size();
-      }
-      finally
-      {
-         if (conn != null)
-         {
-            closeConnection(conn);
-         }
-      }
-   }
-
-   public String receive(String queueName) throws Exception
-   {
-      InitialContext ic = new InitialContext();
-      Queue queue = (Queue)ic.lookup(queueName);
-      ic.close();
-
-      Session session = null;
-      Connection conn = null;
-
-      // WARN! this is an anti-pattern - please see above warning
-
-      try
-      {
-         conn = getConnection();
-         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         MessageConsumer consumer = session.createConsumer(queue);
-
-         System.out.println("blocking to receive message from queue " + queueName + " ...");
-         TextMessage tm = (TextMessage)consumer.receive(5000);
-
-         if (tm == null)
-         {
-            throw new Exception("No message!");
-         }
-
-         System.out.println("Message " + tm.getText() + " received");
-
-         return tm.getText();
-      }
-      finally
-      {
-         if (conn != null)
-         {
-            closeConnection(conn);
-         }
-      }
-   }
-
-   public Connection getConnection() throws Exception
-   {
-
-      Connection connection = null;
-
-      try
-      {
-         connection = cf.createConnection();
-
-         connection.start();
-      }
-      catch(Exception e )
-      {
-         if(connection != null)
-         {
-            closeConnection(connection);
-         }
-         System.out.println("Failed to get connection...exception is " + e);
-         throw e;
-      }
-
-      return connection;
-   }
-
-   public void closeConnection(Connection con) throws Exception
-   {
-      try
-      {
-         con.close();
-      }
-      catch(JMSException jmse)
-      {
-         System.out.println("Could not close connection " + con +" exception was " + jmse);
-         throw jmse;
-      }
-   }
-
-   public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException
-   {
-   }
-
-   public void ejbCreate()
-   {
-      try
-      {
-         InitialContext ic = new InitialContext();
-
-         cf = (ConnectionFactory)ic.lookup("java:/JmsXA");
-
-         ic.close();
-      }
-      catch(Exception e)
-      {
-         e.printStackTrace();
-         throw new EJBException("Initalization failure: " + e.getMessage());
-      }
-   }
-
-   public void ejbRemove() throws EJBException
-   {
-      try
-      {
-         if(cf != null)
-         {
-            cf = null;
-         }
-      }
-      catch(Exception e)
-      {
-         throw new EJBException("ejbRemove ", e);
-      }
-   }
-
-   public void ejbActivate() throws EJBException, RemoteException
-   {
-   }
-
-   public void ejbPassivate() throws EJBException, RemoteException
-   {
-   }
-
-}
-    </programlisting>
-
-  </section>
-
-  <section id="examples.mdb.ejb21">
-    <title>Using EJB2.1 Message Driven Beans</title>
-    <para>This example deploys a simple Message Driven Bean that processes messages sent to a test queue.  Once it receives a message and "processes" it, the MDB sends an acknowledgment message to a temporary destination created by the sender for this purpose. The example is considered successful if the sender receives the acknowledgment message.
-    </para>
-
-   <para>The MDB ejb-jar.xml descriptor
-    </para>
-    <programlisting>
-&lt;ejb-jar&gt;
-  &lt;enterprise-beans&gt;
-    &lt;message-driven&gt;
-      &lt;ejb-name&gt;MDBExample&lt;/ejb-name&gt;
-      &lt;ejb-class&gt;org.jboss.example.jms.mdb.MDBExample&lt;/ejb-class&gt;
-      &lt;transaction-type&gt;Container&lt;/transaction-type&gt;
-    &lt;/message-driven&gt;
-  &lt;/enterprise-beans&gt;
-&lt;/ejb-jar&gt;
-    </programlisting>
-
-   <para>The MDB jboss.xml descriptor
-   </para>
-    <programlisting>
-&lt;enterprise-beans&gt;
-  &lt;message-driven&gt;
-    &lt;ejb-name&gt;MDBExample&lt;/ejb-name&gt;
-    &lt;destination-jndi-name&gt;queue/@QUEUE_NAME@&lt;/destination-jndi-name&gt;
-  &lt;/message-driven&gt;
-&lt;/enterprise-beans&gt;
-    </programlisting>
-
-   <programlisting>
-public class MDBExample implements MessageDrivenBean, MessageListener
-{
-   private MessageDrivenContext ctx;
-
-   private ConnectionFactory cf = null;
-
-   public void onMessage(Message m)
-   {
-      Session session = null;
-      Connection conn = null;
-
-      try
-      {
-         TextMessage tm = (TextMessage)m;
-
-         String text = tm.getText();
-         System.out.println("message " + text + " received");
-         String result = process(text);
-         System.out.println("message processed, result: " + result);
-
-         conn = getConnection();
-         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Destination replyTo = m.getJMSReplyTo();
-         MessageProducer producer = session.createProducer(replyTo);
-         TextMessage reply = session.createTextMessage(result);
-
-         producer.send(reply);
-         producer.close();
-
-      }
-      catch(Exception e)
-      {
-         ctx.setRollbackOnly();
-         e.printStackTrace();
-         System.out.println("The Message Driven Bean failed!");
-      }
-      finally
-      {
-         if (conn != null)
-         {
-            try
-            {
-               closeConnection(conn);
-            }
-            catch(Exception e)
-            {
-               System.out.println("Could not close the connection!" +e);
-            }
-         }
-      }
-   }
-
-   private String process(String s)
-   {
-      // flip the string
-
-      String result = "";
-
-      for (int i = 0; i &lt; text.length(); i++)
-      {
-         result = text.charAt(i) + result;
-      }
-      return result;
-   }
-
-   public Connection getConnection() throws Exception
-   {
-      Connection connection = null;
-
-      try
-      {
-         connection = cf.createConnection();
-         connection.start();
-      }
-      catch(Exception e )
-      {
-         if(connection != null)
-         {
-            closeConnection(connection);
-         }
-         System.out.println("Failed to get connection...exception is " + e);
-         throw e;
-      }
-
-      return connection;
-   }
-
-   public void closeConnection(Connection con) throws Exception
-   {
-      try
-      {
-         con.close();
-      }
-      catch(JMSException e)
-      {
-         System.out.println("Could not close connection " + con + " exception was " + e);
-      }
-   }
-
-   public void ejbCreate()
-   {
-      try
-      {
-         InitialContext ic = new InitialContext();
-
-         cf = (ConnectionFactory)ic.lookup("java:/JmsXA");
-
-         ic.close();
-      }
-      catch(Exception e)
-      {
-         e.printStackTrace();
-         throw new EJBException("Failure to get connection factory: " + e.getMessage());
-      }
-   }
-
-   public void ejbRemove() throws EJBException
-   {
-      try
-      {
-         if(cf != null)
-         {
-            cf = null;
-         }
-      }
-      catch(Exception e)
-      {
-         throw new EJBException("ejbRemove", e);
-      }
-   }
-
-   public void setMessageDrivenContext(MessageDrivenContext ctx)
-   {
-      this.ctx = ctx;
-   }
-
-
-}
-
-   </programlisting>
-
-
-  </section>
-
-
-   <section id="examples.mdb.ejb3">
-     <title>Using EJB3 Message Driven Beans</title>
-
-      <para>
-         This example deploys a simple EJB3 Message Driven Bean that processes messages sent to a
-         test queue.  Once it receives a message and "processes" it, the MDB sends an
-         acknowledgment message to a temporary destination created by the sender for this purpose.
-         The example is considered successful if the sender receives the acknowledgment message.
-      </para>
-
-      <para>
-         This example relies on having access to a running JBoss Messaging instance.
-         The JBoss Messaging instance must be installed and started according to the
-         "Installation" chapter of this document. The example will automatically deploy
-         its own queue, unless a queue with the same name is already deployed.
-      </para>
-
-      <para>
-         This example also relies on having access to the
-         <filename>jboss-messaging-client.jar</filename> archive that comes with the release bundle.
-         If you run this example from an unzipped installation bundle, the example run script
-         is correctly configured to find the client jar. Otherwise, you must modify example's
-         <filename>build.xml</filename> accordingly.
-      </para>
-
-      <para>
-         The example was designed to deploy its server-side artifacts under a JBoss'
-         <literal>messaging</literal> configuration. If you intend to use the script with
-         a JBoss configuration that is named differently, please modify the example's
-         <filename>build.xml</filename> accordingly.
-      </para>
-
-      <important>
-         The JBoss instance that runs the Messaging server must also have EJB3 support
-         previously installed. If the EJB3 support is not installed, the example will fail
-         with an error message similar to:
-
-         <programlisting>
-C:\work\src\cvs\jboss-head\jms\docs\examples\ejb3mdb\build.xml:60: EJB3 does not seem
-to be installed in C:\work\src\jboss-4.0.3-src\build\output\jboss-4.0.3/server/messaging!
-Install it and try again.
-         </programlisting>
-
-         <para>
-            For instructions on how to install EJB3 support,
-            please go to <ulink url="http://docs.jboss.org/ejb3">JBoss EJB3 documentation page</ulink>
-            or use the JBoss Installer.
-         </para>
-      </important>
-
-      <para>
-         The EJB3 Message Driven Bean source code:
-      </para>
-     <programlisting>
- at MessageDriven(activationConfig =
-{
-      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
-      @ActivationConfigProperty(propertyName="destination", propertyValue="queue/testQueue"),
-      @ActivationConfigProperty(propertyName="DLQMaxResent", propertyValue="10")
-})
-public class EJB3MDBExample implements MessageListener
-{
-   public void onMessage(Message m)
-   {
-      businessLogic(m);
-   }
-
-   private void businessLogic(Message m)
-   {
-      Connection conn = null;
-      Session session = null;
-
-      try
-      {
-         TextMessage tm = (TextMessage)m;
-
-         String text = tm.getText();
-         System.out.println("message " + text + " received");
-
-         // flip the string
-         String result = "";
-         for(int i = 0; i &lt; text.length(); i++)
-         {
-            result = text.charAt(i) + result;
-         }
-
-         System.out.println("message processed, result: " + result);
-
-
-         InitialContext ic = new InitialContext();
-         ConnectionFactory cf = (ConnectionFactory)ic.lookup("java:/JmsXA");
-         ic.close();
-
-         conn = cf.createConnection();
-         conn.start();
-         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         Destination replyTo = m.getJMSReplyTo();
-         MessageProducer producer = session.createProducer(replyTo);
-         TextMessage reply = session.createTextMessage(result);
-
-         producer.send(reply);
-         producer.close();
-
-      }
-      catch(Exception e)
-      {
-         e.printStackTrace();
-         System.out.println("The Message Driven Bean failed!");
-      }
-      finally
-      {
-         if (conn != null)
-         {
-            try
-            {
-               conn.close();
-            }
-            catch(Exception e)
-            {
-               System.out.println("Could not close the connection!" +e);
-            }
-         }
-      }
-   }
-}
-     </programlisting>
-
-     <para>The basic test examples in this chapter serve as the sanity check for your JBoss Messaging installation. They also provide basic programming examples. To develop your own JMS services, you probably need to configure JBoss Messaging to setup your own destinations and connection factories etc. In <xref linkend="configuration"/>, we will discuss JBoss Messaging configuration files and options.</para>
-
-   </section>
-
-
-
 </chapter>

Modified: trunk/src/etc/server/default/deploy/messaging-service.xml
===================================================================
--- trunk/src/etc/server/default/deploy/messaging-service.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/src/etc/server/default/deploy/messaging-service.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -21,7 +21,7 @@
          <arg type="java.lang.String" value="/topic"/>
       </constructor>
 
-	   <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
+	  <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
       <attribute name="SecurityDomain">java:/jaas/messaging</attribute>
       <attribute name="DefaultSecurityConfig">
         <security>

Modified: trunk/src/etc/xmdesc/Bridge-xmbean.xml
===================================================================
--- trunk/src/etc/xmdesc/Bridge-xmbean.xml	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/src/etc/xmdesc/Bridge-xmbean.xml	2007-06-01 09:16:18 UTC (rev 2747)
@@ -17,18 +17,18 @@
       <type>org.jboss.messaging.core.plugin.contract.MessagingComponent</type>
    </attribute>
 
-	<attribute access="read-write" getMethod="getSourceProviderAdaptorLookup"
-	   setMethod="setSourceProviderAdaptorLookup">
-	   <description>JNDI lookup for the source JMS provider Adaptor</description>
-	   <name>SourceProviderAdaptorLookup</name>
-	   <type>java.lang.String</type>
+	<attribute access="read-write" getMethod="getSourceProviderLoader"
+	   setMethod="setSourceProviderLoader">
+	   <description>JMS Provider Loader for the source destination</description>
+	   <name>SourceProviderLoader</name>
+	   <type>javax.management.ObjectName</type>
 	</attribute>
 	
-	<attribute access="read-write" getMethod="getTargetProviderAdaptorLookup"
-	   setMethod="setTargetProviderAdaptorLookup">
-	   <description>JNDI lookup for the target JMS provider Adaptor</description>
-	   <name>TargetProviderAdaptorLookup</name>
-	   <type>java.lang.String</type>
+	<attribute access="read-write" getMethod="getTargetProviderLoader"
+	   setMethod="setTargetProviderLoader">
+	   <description>JMS Provider Loader for the target destination</description>
+	   <name>TargetProviderLoader</name>
+	   <type>javax.management.ObjectName</type>
 	</attribute>	
 		
 	<attribute access="read-write" getMethod="getSourceDestinationLookup"

Modified: trunk/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/ServerPeer.java	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/src/main/org/jboss/jms/server/ServerPeer.java	2007-06-01 09:16:18 UTC (rev 2747)
@@ -1384,10 +1384,6 @@
       mbeanServer.invoke(on, "start", new Object[0], new String[0]);
 
       return (String)mbeanServer.getAttribute(on, "JNDIName");
-
-      //
-      // end of TODO
-      //
    }
 
    

Modified: trunk/src/main/org/jboss/jms/server/bridge/BridgeMBean.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/bridge/BridgeMBean.java	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/src/main/org/jboss/jms/server/bridge/BridgeMBean.java	2007-06-01 09:16:18 UTC (rev 2747)
@@ -21,7 +21,9 @@
  */
 package org.jboss.jms.server.bridge;
 
+import javax.management.ObjectName;
 
+
 /**
  * A BridgeMBean
  *
@@ -35,13 +37,13 @@
 {
    // JMX attributes
    
-   void setSourceProviderAdaptorLookup(String lookup);
+   void setSourceProviderLoader(ObjectName sourceProviderLoader);
    
-   String getSourceProviderAdaptorLookup();
+   ObjectName getSourceProviderLoader();
    
-   void setTargetProviderAdaptorLookup(String lookup);
+   void setTargetProviderLoader(ObjectName targetProviderLoader);
    
-   String getTargetProviderAdaptorLookup();
+   ObjectName getTargetProviderLoader();
    
    String getSourceDestinationLookup();
 

Modified: trunk/src/main/org/jboss/jms/server/bridge/BridgeService.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/bridge/BridgeService.java	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/src/main/org/jboss/jms/server/bridge/BridgeService.java	2007-06-01 09:16:18 UTC (rev 2747)
@@ -21,11 +21,13 @@
  */
 package org.jboss.jms.server.bridge;
 
+import java.util.Properties;
+
 import javax.jms.Destination;
+import javax.management.ObjectName;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 
-import org.jboss.jms.jndi.JMSProviderAdapter;
 import org.jboss.messaging.core.plugin.contract.MessagingComponent;
 import org.jboss.messaging.core.plugin.contract.ServerPlugin;
 import org.jboss.system.ServiceMBeanSupport;
@@ -48,9 +50,9 @@
    
    private String targetDestinationLookup;
    
-   private String sourceProviderAdaptorLookup;
+   private ObjectName sourceProviderLoader;
    
-   private String targetProviderAdaptorLookup;
+   private ObjectName targetProviderLoader;
    
       
    public BridgeService()
@@ -60,34 +62,34 @@
    
    // JMX attributes ----------------------------------------------------------------
    
-   public synchronized String getSourceProviderAdaptorLookup()
+   public synchronized ObjectName getSourceProviderLoader()
    {
-      return sourceProviderAdaptorLookup;
+      return sourceProviderLoader;
    }
    
-   public synchronized void setSourceProviderAdaptorLookup(String lookup)
+   public synchronized void setSourceProviderLoader(ObjectName sourceProvider)
    {
       if (bridge.isStarted())
       {
-          log.warn("Cannot set SourceProviderAdaptorLookup when bridge is started");
+          log.warn("Cannot set SourceProvider when bridge is started");
           return;
       }
-      sourceProviderAdaptorLookup = checkAndTrim(lookup);
+      this.sourceProviderLoader = sourceProvider;
    }
    
-   public synchronized String getTargetProviderAdaptorLookup()
+   public synchronized ObjectName getTargetProviderLoader()
    {
-      return targetProviderAdaptorLookup;
+      return targetProviderLoader;
    }
    
-   public synchronized void setTargetProviderAdaptorLookup(String lookup)
+   public synchronized void setTargetProviderLoader(ObjectName targetProvider)
    {
       if (bridge.isStarted())
       {
-          log.warn("Cannot set TargetProviderAdaptorLookup when bridge is started");
+          log.warn("Cannot set TargetProvider when bridge is started");
           return;
       }
-      targetProviderAdaptorLookup = checkAndTrim(lookup);
+      this.targetProviderLoader = targetProvider;
    }
    
    public String getSourceDestinationLookup()
@@ -280,14 +282,14 @@
       
       super.startService();
       
-      if (this.sourceProviderAdaptorLookup == null)
+      if (this.sourceProviderLoader == null)
       {
-         throw new IllegalArgumentException("sourceProviderAdaptorLookup cannot be null");
+         throw new IllegalArgumentException("sourceProvider cannot be null");
       }
       
-      if (this.targetProviderAdaptorLookup == null)
+      if (this.targetProviderLoader == null)
       {
-         throw new IllegalArgumentException("targetProviderAdaptorLookup cannot be null");
+         throw new IllegalArgumentException("targetProvider cannot be null");
       }
       
       if (sourceDestinationLookup == null)
@@ -300,41 +302,38 @@
          throw new IllegalArgumentException("Target destination lookup cannot be null");
       }
       
-      InitialContext ic = new InitialContext();
+      boolean sameSourceAndTarget = sourceProviderLoader.equals(targetProviderLoader);
       
-      JMSProviderAdapter sourceAdaptor = (JMSProviderAdapter)ic.lookup(sourceProviderAdaptorLookup);
-
-      boolean sameSourceAndTarget = sourceProviderAdaptorLookup.equals(targetProviderAdaptorLookup);
+      Properties sourceProps = (Properties)server.getAttribute(sourceProviderLoader, "Properties");
       
-      JMSProviderAdapter targetAdaptor;
+      Properties targetProps = (Properties)server.getAttribute(targetProviderLoader, "Properties");
       
-      if (sameSourceAndTarget)
-      {
-         targetAdaptor = sourceAdaptor;
-      }
-      else
-      {
-         targetAdaptor = (JMSProviderAdapter)ic.lookup(targetProviderAdaptorLookup);
-      }
+      Context icSource = new InitialContext(sourceProps);
       
-      Context icSource = sourceAdaptor.getInitialContext();
+      Context icTarget = new InitialContext(targetProps);
       
-      Context icTarget = targetAdaptor.getInitialContext();
-      
       Destination sourceDest = (Destination)icSource.lookup(sourceDestinationLookup);
       
       Destination targetDest = (Destination)icTarget.lookup(targetDestinationLookup);
             
-      String sourceCFRef = sourceAdaptor.getFactoryRef();
+      String sourceCFRef = (String)server.getAttribute(sourceProviderLoader, "FactoryRef");
       
-      String targetCFRef = targetAdaptor.getFactoryRef();
+      String targetCFRef = (String)server.getAttribute(targetProviderLoader, "FactoryRef");
       
       ConnectionFactoryFactory sourceCff =
-         new JNDIConnectionFactoryFactory(sourceAdaptor.getProperties(), sourceCFRef);
+         new JNDIConnectionFactoryFactory(sourceProps, sourceCFRef);
       
-      ConnectionFactoryFactory destCff =
-         new JNDIConnectionFactoryFactory(targetAdaptor.getProperties(), targetCFRef);
+      ConnectionFactoryFactory destCff;
       
+      if (sameSourceAndTarget)
+      {
+      	destCff = sourceCff;
+      }
+      else
+      {      
+      	destCff= new JNDIConnectionFactoryFactory(targetProps, targetCFRef);
+      }
+      
       bridge.setSourceDestination(sourceDest);
       
       bridge.setTargetDestination(targetDest);
@@ -345,7 +344,7 @@
       
       bridge.start();      
       
-      if (log.isTraceEnabled()) { log.trace("Started bridge"); }
+      log.info("Started bridge " + this.getName() + ". Source: " + sourceDestinationLookup + " Target: " + targetDestinationLookup);
    }
    
 
@@ -355,7 +354,7 @@
       
       bridge.stop();
       
-      if (log.isTraceEnabled()) { log.trace("Stopped bridge"); }
+      log.info("Stopped bridge " + this.getName());
    }
    
    // Private ---------------------------------------------------------------------------------

Modified: trunk/tests/src/org/jboss/test/messaging/jms/bridge/BridgeMBeanTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/bridge/BridgeMBeanTest.java	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/tests/src/org/jboss/test/messaging/jms/bridge/BridgeMBeanTest.java	2007-06-01 09:16:18 UTC (rev 2747)
@@ -21,6 +21,7 @@
  */
 package org.jboss.test.messaging.jms.bridge;
 
+import java.io.ByteArrayOutputStream;
 import java.util.Properties;
 
 import javax.jms.Connection;
@@ -34,11 +35,9 @@
 import javax.management.ObjectName;
 import javax.naming.InitialContext;
 
-import org.jboss.jms.jndi.JMSProviderAdapter;
 import org.jboss.jms.server.bridge.Bridge;
 import org.jboss.logging.Logger;
 import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.test.messaging.tools.TestJMSProviderAdaptor;
 
 /**
  * A BridgeMBeanTest
@@ -77,6 +76,8 @@
       
    }
    
+   
+   
    public void testStopStartPauseResume() throws Exception
    {
       ServerManagement.deployQueue("sourceQueue", 1);
@@ -88,17 +89,17 @@
       Properties props2 = new Properties();
       props2.putAll(ServerManagement.getJNDIEnvironment(2));
       
-      JMSProviderAdapter sourceAdaptor = new TestJMSProviderAdaptor(props1, "/XAConnectionFactory", "adaptor1");
+      installJMSProviderLoader(0, props1, "/XAConnectionFactory", "adaptor1");
       
-      JMSProviderAdapter targetAdaptor = new TestJMSProviderAdaptor(props2, "/XAConnectionFactory", "adaptor2");
+      installJMSProviderLoader(0, props2, "/XAConnectionFactory", "adaptor2");
       
-      ServerManagement.installJMSProviderAdaptor(0, "adaptor1", sourceAdaptor);
+      log.info("Deploying bridge");
       
-      ServerManagement.installJMSProviderAdaptor(0, "adaptor2", targetAdaptor);
+      ObjectName sourceProviderLoader = new ObjectName("jboss.messaging:service=JMSProviderLoader,name=adaptor1");
+      ObjectName targetProviderLoader = new ObjectName("jboss.messaging:service=JMSProviderLoader,name=adaptor2");
       
-      log.info("Deploying bridge");
       
-      ObjectName on = deployBridge(0, "Bridge1", "adaptor1", "adaptor2",
+      ObjectName on = deployBridge(0, "Bridge1", sourceProviderLoader, targetProviderLoader,
                                    "/queue/sourceQueue", "/queue/targetQueue",
                                    null, null, null, null,
                                    Bridge.QOS_AT_MOST_ONCE, null, 1,
@@ -285,9 +286,9 @@
             //Ignore            
          }
          
-         ServerManagement.uninstallJMSProviderAdaptor(0, "adaptor1");
+         uninstallJMSProviderLoader(0, "adaptor1");
          
-         ServerManagement.uninstallJMSProviderAdaptor(0, "adaptor2");
+         uninstallJMSProviderLoader(0,  "adaptor2");
       }
    }
          
@@ -308,15 +309,14 @@
          Properties props2 = new Properties();
          props2.putAll(ServerManagement.getJNDIEnvironment(2));
          
-         JMSProviderAdapter sourceAdaptor = new TestJMSProviderAdaptor(props1, "/XAConnectionFactory", "adaptor1");
+         installJMSProviderLoader(0, props1, "/XAConnectionFactory", "adaptor1");
          
-         JMSProviderAdapter targetAdaptor = new TestJMSProviderAdaptor(props2, "/XAConnectionFactory", "adaptor2");
+         installJMSProviderLoader(0, props2, "/XAConnectionFactory", "adaptor2");
          
-         ServerManagement.installJMSProviderAdaptor(0, "adaptor1", sourceAdaptor);
+         ObjectName sourceProviderLoader = new ObjectName("jboss.messaging:service=JMSProviderLoader,name=adaptor1");
+         ObjectName targetProviderLoader = new ObjectName("jboss.messaging:service=JMSProviderLoader,name=adaptor2");
          
-         ServerManagement.installJMSProviderAdaptor(0, "adaptor2", targetAdaptor);
-         
-         on = deployBridge(0, "Bridge1", "adaptor1", "adaptor2",
+         on = deployBridge(0, "Bridge1", sourceProviderLoader, targetProviderLoader,
                            "/queue/sourceQueue", "/queue/targetQueue",
                            null, null, null, null,
                            Bridge.QOS_ONCE_AND_ONLY_ONCE, null, 1,
@@ -329,21 +329,22 @@
          log.trace("Created bridge");
             
          {
-            String lookup = (String)ServerManagement.getAttribute(on, "SourceProviderAdaptorLookup");
-            assertEquals("adaptor1", lookup);
-            ServerManagement.setAttribute(on, "SourceProviderAdaptorLookup", "blah");
-            lookup = (String)ServerManagement.getAttribute(on, "SourceProviderAdaptorLookup");
-            assertEquals("blah", lookup);
-            ServerManagement.setAttribute(on, "SourceProviderAdaptorLookup", "adaptor1");
+            ObjectName sourceProviderLoader2 = (ObjectName)ServerManagement.getAttribute(on, "SourceProviderLoader");
+            assertEquals(sourceProviderLoader, sourceProviderLoader2);
+            ServerManagement.setAttribute(on, "SourceProviderLoader", "jboss.messaging:service=JMSProviderLoader,name=blah");
+            sourceProviderLoader2 = (ObjectName)ServerManagement.getAttribute(on, "SourceProviderLoader");
+            assertEquals(new ObjectName("jboss.messaging:service=JMSProviderLoader,name=blah"), sourceProviderLoader2);
+            ServerManagement.setAttribute(on, "SourceProviderLoader", sourceProviderLoader.toString());
          }
               
          {
-            String lookup = (String)ServerManagement.getAttribute(on, "TargetProviderAdaptorLookup");
-            assertEquals("adaptor2", lookup);
-            ServerManagement.setAttribute(on, "TargetProviderAdaptorLookup", "blah");
-            lookup = (String)ServerManagement.getAttribute(on, "TargetProviderAdaptorLookup");
-            assertEquals("blah", lookup);
-            ServerManagement.setAttribute(on, "TargetProviderAdaptorLookup", "adaptor2");
+         	ObjectName targetProviderLoader2 = (ObjectName)ServerManagement.getAttribute(on, "TargetProviderLoader");
+            assertEquals(targetProviderLoader, targetProviderLoader2);
+            ServerManagement.setAttribute(on, "TargetProviderLoader", "jboss.messaging:service=JMSProviderLoader,name=blah2");
+            targetProviderLoader2 = (ObjectName)ServerManagement.getAttribute(on, "TargetProviderLoader");
+            assertEquals(new ObjectName("jboss.messaging:service=JMSProviderLoader,name=blah2"), targetProviderLoader2);
+            ServerManagement.setAttribute(on, "TargetProviderLoader", targetProviderLoader.toString());
+  
          }
          
          {
@@ -477,20 +478,21 @@
          //Should not be able to change attributes when bridge is started - need to stop first         
          
          {
-            String cfLookup = (String)ServerManagement.getAttribute(on, "SourceProviderAdaptorLookup");
-            assertEquals("adaptor1", cfLookup);
-            ServerManagement.setAttribute(on, "SourceProviderAdaptorLookup", "blah");
-            cfLookup = (String)ServerManagement.getAttribute(on, "SourceProviderAdaptorLookup");
-            assertEquals("adaptor1", cfLookup);            
+            ObjectName sourceProviderLoader2 = (ObjectName)ServerManagement.getAttribute(on, "SourceProviderLoader");
+            assertEquals(sourceProviderLoader, sourceProviderLoader2);
+            ServerManagement.setAttribute(on, "SourceProviderLoader", "jboss.messaging:service=JMSProviderLoader,name=blah");
+            sourceProviderLoader2 = (ObjectName)ServerManagement.getAttribute(on, "SourceProviderLoader");
+            assertEquals(sourceProviderLoader, sourceProviderLoader2);
          }
-         
+              
          {
-            String cfLookup = (String)ServerManagement.getAttribute(on, "TargetProviderAdaptorLookup");
-            assertEquals("adaptor2", cfLookup);
-            ServerManagement.setAttribute(on, "TargetProviderAdaptorLookup", "blah");
-            cfLookup = (String)ServerManagement.getAttribute(on, "TargetProviderAdaptorLookup");
-            assertEquals("adaptor2", cfLookup); 
-         }
+         	ObjectName targetProviderLoader2 = (ObjectName)ServerManagement.getAttribute(on, "TargetProviderLoader");
+            assertEquals(targetProviderLoader, targetProviderLoader2);
+            ServerManagement.setAttribute(on, "TargetProviderLoader", "jboss.messaging:service=JMSProviderLoader,name=blah2");
+            targetProviderLoader2 = (ObjectName)ServerManagement.getAttribute(on, "TargetProviderLoader");
+            assertEquals(targetProviderLoader, targetProviderLoader2);
+ 
+         }         
          
          {
             String destLookup = (String)ServerManagement.getAttribute(on, "SourceDestinationLookup");
@@ -633,15 +635,16 @@
          ServerManagement.undeployQueue("sourceQueue", 1);
          ServerManagement.undeployQueue("targetQueue", 2);
          
-         ServerManagement.uninstallJMSProviderAdaptor(0, "adaptor1");
-         ServerManagement.uninstallJMSProviderAdaptor(0, "adaptor2");
+         uninstallJMSProviderLoader(0, "adaptor1");
+         
+         uninstallJMSProviderLoader(0, "adaptor2");
       }
             
    }
    
    
    private ObjectName deployBridge(int server, String bridgeName,
-            String sourceProviderAdaptorLookup, String targetProviderAdaptorLookup,
+            ObjectName sourceProviderLoader, ObjectName targetProviderLoader,
             String sourceDestLookup, String targetDestLookup,
             String sourceUsername, String sourcePassword,
             String targetUsername, String targetPassword,
@@ -653,8 +656,8 @@
          "<mbean code=\"org.jboss.jms.server.bridge.BridgeService\" " +
          "name=\"jboss.messaging:service=Bridge,name=" + bridgeName + "\" " +
          "xmbean-dd=\"xmdesc/Bridge-xmbean.xml\">" +      
-         "<attribute name=\"SourceProviderAdaptorLookup\">" + sourceProviderAdaptorLookup + "</attribute>"+      
-         "<attribute name=\"TargetProviderAdaptorLookup\">" + targetProviderAdaptorLookup + "</attribute>"+     
+         "<attribute name=\"SourceProviderLoader\">" + sourceProviderLoader + "</attribute>"+      
+         "<attribute name=\"TargetProviderLoader\">" + targetProviderLoader + "</attribute>"+     
          "<attribute name=\"SourceDestinationLookup\">" + sourceDestLookup + "</attribute>"+     
          "<attribute name=\"TargetDestinationLookup\">" + targetDestLookup + "</attribute>";
       if (sourceUsername != null)
@@ -773,4 +776,35 @@
       }
    }
    
+   private void installJMSProviderLoader(int server, Properties props, String factoryRef, String name)
+      throws Exception
+   {
+   	ByteArrayOutputStream boa = new ByteArrayOutputStream();
+   	props.store(boa, "");
+   	String propsString =  new String(boa.toByteArray());
+
+   	String config =
+   		"<mbean code=\"org.jboss.jms.jndi.JMSProviderLoader\"" + 
+   		" name=\"jboss.messaging:service=JMSProviderLoader,name=" + name + "\">" +
+   		"<attribute name=\"ProviderName\">" + name + "</attribute>" +
+   		"<attribute name=\"ProviderAdapterClass\">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>" +
+   		"<attribute name=\"FactoryRef\">" + factoryRef + "</attribute>" +
+   		"<attribute name=\"QueueFactoryRef\">" + factoryRef + "</attribute>" +
+   		"<attribute name=\"TopicFactoryRef\">" + factoryRef + "</attribute>" +
+   		"<attribute name=\"Properties\">" + propsString + "</attribute></mbean>";
+   	
+   	log.info("Installing bridge: " + config);
+
+   	ServerManagement.getServer(0).deploy(config);
+   }
+
+   private void uninstallJMSProviderLoader(int server, String name) throws Exception
+   {
+   	ObjectName on = new ObjectName("jboss.messaging:service=JMSProviderLoader,name=" + name);
+   	
+   	log.info("Uninstalling bridge:" + name);
+   	
+   	ServerManagement.getServer(0).undeploy(on);
+   }
+   
 }

Modified: trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java	2007-06-01 09:16:18 UTC (rev 2747)
@@ -1138,21 +1138,6 @@
       return servers[serverIndex].getServer().getRemotingTransport();
    }
    
-   public static void installJMSProviderAdaptor(int serverIndex, String jndi, JMSProviderAdapter adaptor)
-      throws Exception
-   {
-      insureStarted(serverIndex);
-      
-      servers[serverIndex].getServer().installJMSProviderAdaptor(jndi, adaptor);
-   }
-   
-   public static void uninstallJMSProviderAdaptor(int serverIndex, String jndi)
-      throws Exception
-   {
-      insureStarted(serverIndex);
-      
-      servers[serverIndex].getServer().uninstallJMSProviderAdaptor(jndi);
-   }
 
    // Attributes ----------------------------------------------------
 

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java	2007-06-01 09:16:18 UTC (rev 2747)
@@ -284,6 +284,13 @@
          Class implementation = ServiceContainer.class.getClassLoader().loadClass(valueAsString);
          return implementation.newInstance();
       }
+      else if (type.startsWith("java.util.Properties"))
+      {
+      	ByteArrayInputStream is = new ByteArrayInputStream(valueAsString.getBytes());
+         Properties props = new Properties();
+         props.load(is);
+         return props;
+      }
 
       throw new Exception("Don't know to handle type " + type);
 

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java	2007-06-01 09:16:18 UTC (rev 2747)
@@ -35,7 +35,6 @@
 import javax.transaction.UserTransaction;
 
 import org.jboss.aop.AspectXmlLoader;
-import org.jboss.jms.jndi.JMSProviderAdapter;
 import org.jboss.jms.server.DestinationManager;
 import org.jboss.jms.server.ServerPeer;
 import org.jboss.logging.Logger;
@@ -872,18 +871,8 @@
 //      AspectXmlLoader.undeployXML(url);
       
       PoisonInterceptor.setType(type);
-   }
-   
-   public void installJMSProviderAdaptor(String jndi, JMSProviderAdapter adaptor) throws Exception
-   {
-      sc.installJMSProviderAdaptor(jndi, adaptor);
-   }
+   }   
 
-   public void uninstallJMSProviderAdaptor(String jndi) throws Exception
-   {
-      sc.uninstallJMSProviderAdaptor(jndi);
-   }
-
    // Public ---------------------------------------------------------------------------------------
 
    // Package protected ----------------------------------------------------------------------------

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java	2007-06-01 09:16:18 UTC (rev 2747)
@@ -483,17 +483,7 @@
    {
       server.poisonTheServer(type);
    }
-   
-   public void installJMSProviderAdaptor(String jndi, JMSProviderAdapter adaptor) throws Exception
-   {
-      server.installJMSProviderAdaptor(jndi, adaptor);
-   }
 
-   public void uninstallJMSProviderAdaptor(String jndi) throws Exception
-   {
-      server.uninstallJMSProviderAdaptor(jndi);
-   }
-
    // Public --------------------------------------------------------
 
    // Package protected ---------------------------------------------

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java	2007-05-31 08:07:01 UTC (rev 2746)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/Server.java	2007-06-01 09:16:18 UTC (rev 2747)
@@ -282,8 +282,4 @@
 
    void poisonTheServer(int type) throws Exception;
    
-   void installJMSProviderAdaptor(String jndi, JMSProviderAdapter adaptor) throws Exception;
-   
-   void uninstallJMSProviderAdaptor(String jndi) throws Exception;
-
 }




More information about the jboss-cvs-commits mailing list