[jboss-cvs] JBoss Messaging SVN: r6209 - in branches/Branch_1416_merge: docs and 18 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 30 03:04:26 EDT 2009


Author: gaohoward
Date: 2009-03-30 03:04:26 -0400 (Mon, 30 Mar 2009)
New Revision: 6209

Added:
   branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/core/postoffice/PostOfficeManagementTest.java
   branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/DeliveryOnConnectionFailureTest.java
   branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/bridge/BridgeMBeanExtraTest.java
Modified:
   branches/Branch_1416_merge/build-messaging.xml
   branches/Branch_1416_merge/build-thirdparty-AS5.xml
   branches/Branch_1416_merge/docs/README.html
   branches/Branch_1416_merge/docs/examples/bridge/etc/test-bridge-service.xml
   branches/Branch_1416_merge/docs/userguide/en/modules/about.xml
   branches/Branch_1416_merge/docs/userguide/en/modules/installation.xml
   branches/Branch_1416_merge/docs/userguide/en/modules/runningexamples.xml
   branches/Branch_1416_merge/integration/AS5/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java
   branches/Branch_1416_merge/integration/EAP4/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java
   branches/Branch_1416_merge/src/main/org/jboss/jms/server/bridge/Bridge.java
   branches/Branch_1416_merge/src/main/org/jboss/jms/server/bridge/BridgeService.java
   branches/Branch_1416_merge/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java
   branches/Branch_1416_merge/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
   branches/Branch_1416_merge/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
   branches/Branch_1416_merge/src/main/org/jboss/messaging/core/impl/clusterconnection/MessageSucker.java
   branches/Branch_1416_merge/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
   branches/Branch_1416_merge/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java
   branches/Branch_1416_merge/tests/build.properties
   branches/Branch_1416_merge/tests/build.xml
   branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/ClusterViewUpdateTest.java
   branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java
   branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java
   branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/tools/container/Server.java
   branches/Branch_1416_merge/tools/etc/buildmagic/aliases.ent
   branches/Branch_1416_merge/tools/etc/jbossbuild/jbossbuild.properties
   branches/Branch_1416_merge/tools/etc/jbossbuild/tasks.xml
Log:
merge from Branch_1_4



Modified: branches/Branch_1416_merge/build-messaging.xml
===================================================================
--- branches/Branch_1416_merge/build-messaging.xml	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/build-messaging.xml	2009-03-30 07:04:26 UTC (rev 6209)
@@ -51,11 +51,11 @@
 
    <property name="messaging.version.major" value="1"/>
    <property name="messaging.version.minor" value="4"/>
-   <property name="messaging.version.revision" value="0"/>
-   <property name="messaging.version.incrementing" value="28"/>
-   <property name="messaging.version.tag" value="SP3-CP06"/>
-   <property name="messaging.version.name" value="Hotpot"/>
-   <property name="messaging.version.cvstag" value="JBossMessaging_1_4_0_SP3_CP06"/>
+   <property name="messaging.version.revision" value="3"/>
+   <property name="messaging.version.incrementing" value="31"/>
+   <property name="messaging.version.tag" value="GA"/>
+   <property name="messaging.version.name" value="Lowood"/>
+   <property name="messaging.version.cvstag" value="JBossMessaging_1_4_3_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}"/>

Modified: branches/Branch_1416_merge/build-thirdparty-AS5.xml
===================================================================
--- branches/Branch_1416_merge/build-thirdparty-AS5.xml	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/build-thirdparty-AS5.xml	2009-03-30 07:04:26 UTC (rev 6209)
@@ -81,30 +81,30 @@
            Dependencies required to build the project.
       -->
       <componentref name="retrotranslator" version="0.9.6jboss"/>
-      <componentref name="sun-javacc" version="3.2"/>
+      <componentref name="sun-javacc" version="4.0"/>
       <componentref name="oswego-concurrent" version="1.3.4-jboss-update1"/>
       <componentref name="apache-log4j" version="1.2.14"/>
       <componentref name="javassist" version="3.9.0.GA"/>
-      <componentref name="jgroups" version="2.6.7.GA"/>
+      <componentref name="jgroups" version="2.6.8.GA"/>
       <componentref name="trove" version="1.0.2"/>
-      <componentref name="jboss/common-core" version="2.2.8.GA"/>
-      <componentref name="jboss/common-logging-jdk" version="2.0.2.GA"/>
-      <componentref name="jboss/common-logging-log4j" version="2.0.2.GA"/>
-      <componentref name="jboss/common-logging-spi" version="2.0.2.GA"/>
-   	  <componentref name="jboss/jboss-mdr" version="2.0.0.Beta12"/>
-      <componentref name="jboss/aop" version="2.0.0.SP1"/>
+      <componentref name="jboss/common-core" version="2.2.11.GA"/>
+      <componentref name="jboss/common-logging-jdk" version="2.0.5.GA"/>
+      <componentref name="jboss/common-logging-log4j" version="2.0.5.GA"/>
+      <componentref name="jboss/common-logging-spi" version="2.0.5.GA"/>
+      <componentref name="jboss/jboss-mdr" version="2.0.1.GA"/>
+      <componentref name="jboss/aop" version="2.0.1.GA"/>
       <componentref name="jboss/remoting" version="2.5.0.SP2"/>
       <componentref name="jboss/jbossts" version="4.4.0.GA"/>
       <componentref name="jbossas/core-libs" version="4.2.0.GA"/>
    	
       
-   	  <!-- <componentref name="jboss/microcontainer" version="2.0.0.Beta5"/>
+  	  <!-- <componentref name="jboss/microcontainer" version="2.0.0.Beta5"/>
       <componentref name="jboss/jboss-security-spi" version="2.0.1.GA"/>
       <componentref name="jboss/jboss-jaspi-api" version="1.0-BETA1"/>
       <componentref name="jboss/integration" version="5.0.0.Beta4"/>
-      <componentref name="jboss/jbosssx-client" version="2.0.1.GA"/>
-      <componentref name="jboss/jboss-javaee" version="5.0.0.Beta3Update1"/>
-      <componentref name="jboss/jboss-common-logging-spi" version="2.0.4.GA"/> -->
+      <componentref name="org/jboss/jbosssx-client" version="2.0.1.GA"/>
+      <componentref name="org/jboss/jboss-javaee" version="5.0.0.Beta3Update1"/>
+      <componentref name="org/jboss/jboss-common-logging-spi" version="2.0.4.GA"/> -->
    	
 
 
@@ -120,10 +120,10 @@
       -->
       <componentref name="junit" version="3.8.2-brew"/>
       <componentref name="hsqldb" version="1.8.0.8-brew"/>
-      <componentref name="dom4j" version="1.6.1-brew"/>
+      <componentref name="dom4j" version="1.6.1"/>
       <componentref name="apache-xerces" version="2.9.1"/> <!-- needed by org.jboss.logging.Log4jLoggerPlugin -->
-      <componentref name="jboss/profiler/jvmti" version="1.0.0.CR5-brew"/>
-      <componentref name="jboss/jbossxb" version="2.0.0.CR7"/>
+      <componentref name="jboss/profiler/jvmti" version="1.0.0.CR5"/>
+      <componentref name="jboss/jbossxb" version="2.0.0.GA"/>
       <componentref name="jboss/test14" version="1.0.0.GA"/>
 
       <!-- This is a non declared dependency of jboss/test14 -->

Modified: branches/Branch_1416_merge/docs/README.html
===================================================================
--- branches/Branch_1416_merge/docs/README.html	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/docs/README.html	2009-03-30 07:04:26 UTC (rev 6209)
@@ -3,26 +3,22 @@
 <head>
   <meta content="text/html; charset=ISO-8859-1"
  http-equiv="content-type">
-  <title>Release Notes - JBoss Messaging - Version 1.4.0.SP3-CP06.</title>
+  <title>Release Notes - JBoss Messaging - Version 1.4.3.GA</title>
 </head>
 <body>
 
-<h1>Release Notes - JBoss Messaging - Version 1.4.0.SP3-CP06</h1>
+<h1>Release Notes - JBoss Messaging - Version 1.4.3.GA</h1>
 
 <br>
 
-<h2>3 February 2009</h2>
+<h2>5 March 2009</h2>
 
-These are the release notes for JBoss Messaging 1.4.0.SP3-CP06<br><br>
+<p>JBoss Messaging Version 1.4.3.GA is a release made and tested exclusively for the <b>JBoss AS 5.1.0.Beta1 only</b> and it should be part of the JBoss 5 download bundle.</p>
 
-For full description of the contents please see the <a href="https://jira.jboss.org/jira/secure/ReleaseNote.jspa?version=12313144&styleName=Html&projectId=12310061">JBoss Messaging project JIRA.</a><br><br>
+<p>For the full description of this release, see the <a href="https://jira.jboss.org/jira/secure/ReleaseNote.jspa?version=12313042&styleName=Html&projectId=12310061">JBoss Messaging project JIRA.</a></p>
 
-When upgrading an existing installation be sure to update all the configuration files in server/&lt;server name&gt;/deploy/jboss-messaging.sar with the newer versions and replace jboss-messaging.jar in server/&lt;server name&gt;/lib and on the client classpath. <br><br>
+<p>Enjoy!</p>
 
-This release of JBoss Messaging also requires specific versions of JBoss Remoting, JBoss AOP and Javassist. For the correct versions see the user-guide installation section. Be sure that server/&lt;server name&gt;/lib contains these jar and they are also present as the first entry on the client classpath. This is critical to ensure proper operation of JBoss Messaging!<br><br>
-
-Enjoy!<br><br>
-
 </body>
 </html>
 

Modified: branches/Branch_1416_merge/docs/examples/bridge/etc/test-bridge-service.xml
===================================================================
--- branches/Branch_1416_merge/docs/examples/bridge/etc/test-bridge-service.xml	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/docs/examples/bridge/etc/test-bridge-service.xml	2009-03-30 07:04:26 UTC (rev 6209)
@@ -14,10 +14,10 @@
           xmbean-dd="xmdesc/Bridge-xmbean.xml">
           
       <!-- The JMS provider loader that is used to lookup the source destination -->   
-      <depends optional-attribute-name="SourceProviderLoader">jboss.jms:service=JMSProviderLoader,name=JMSProvider</depends>     
+      <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.jms:service=JMSProviderLoader,name=JMSProvider</depends>    
+      <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> 

Modified: branches/Branch_1416_merge/docs/userguide/en/modules/about.xml
===================================================================
--- branches/Branch_1416_merge/docs/userguide/en/modules/about.xml	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/docs/userguide/en/modules/about.xml	2009-03-30 07:04:26 UTC (rev 6209)
@@ -6,7 +6,7 @@
   is a complete rewrite of JBossMQ, the legacy JBoss JMS provider.</para>
   
   <para>JBoss Messaging is the default JMS provider in JBoss Enterprise Application Platform version 4.3 or later, and JBoss SOA Platform. 
-	It is also the default JMS provider in JBoss Application  Server 5, and is the default JMS provider for JBoss ESB.</para>
+	It is also 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>

Modified: branches/Branch_1416_merge/docs/userguide/en/modules/installation.xml
===================================================================
--- branches/Branch_1416_merge/docs/userguide/en/modules/installation.xml	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/docs/userguide/en/modules/installation.xml	2009-03-30 07:04:26 UTC (rev 6209)
@@ -9,7 +9,7 @@
 
   <para>Please note that JBoss EAP 4.3 and JBoss 5 comes with JBoss Messaging
   pre-installed as default JMS provider so if you are using that, there is no need to manually
-  install JBoss Messaging.</para>
+  install JBoss Messaging</para>
 
   <para>By default, JBoss AS 4.2 ships with JBossMQ as default JMS provider.
   In order to use the JBoss AS instance with JBoss Messaging, you need to
@@ -175,7 +175,12 @@
         <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>      
+          you can use the ServiceBindingManager to do this as follows:</para>
+
+	        <para><warning>JBoss5 has introduced a much simpler ServiceBindingManager. 
+	                    You should refer to the JBoss5 documentation about how to administer the new bindingManager if you are using JBoss5.
+	        </warning></para>
+      
                        
           <itemizedlist>
             <listitem>
@@ -256,8 +261,8 @@
               may be out of date and you will need to copy the config from
               <literal>remoting-bisocket-service.xml. DO NOT just copy and
               paste from the above example - copy it from the JBoss Messaging
-              distribution.</literal>. 
-	      </warning>
+              distribution.</literal>. On JBoss5 the ports are controlled by 
+              system-property substitution hence you don't need to worry about copying the config into bindings.xml</warning>
 
               <para>You should ensure that each node is configured to use a
               different ports range.</para>
@@ -608,16 +613,17 @@
         <listitem>
           <para>
             <note>
-            JBoss Messaging 1.4 requires a patched version of jboss-remoting.jar. This version is available
-            and can be downloaded from <ulink url="http://repository.jboss.com/jboss/remoting/2.2.2.SP11-brew/"> here</ulink>. 
-	    The version is JBoss Remoting 2.2.2.SP11-brew. Please download it and copy it into the
-            <literal>$JBOSS_HOME/server/&lt;your server name&gt;/lib</literal> directory of any server profiles that use JBoss 
-	    Messaging. If you are using JBoss Messaging from a standalone client also make sure this jar is on your
-            classpath *before* jbossall-client.jar.
-           </note>
+            JBoss Messaging 1.4.3.GA requires pecific versions
+            of jboss-remoting.jar if used outside of JBoss 5. If you are installing JBoss Messaging 1.4.3.GA at JBoss 4.2+, you should use this version:
+            <ulink url="http://repository.jboss.com/jboss/remoting/2.5.0.SP2/ ">Remoting 2.5.0.SP2</ulink>. 
+            If you are using JBoss5 you don't need to take any extra steps on the remoting installation.
+            </note>
           </para>
         </listitem>
 
+        <para>You should also make these changes on any configuration you
+        choose, to remove all references to the old JBossMQ:</para>
+
         <listitem>
           <para>Edit <literal>$JBOSS_CONFIG/deploy/jms-ds.xml</literal> and
           replace jboss.mq by jboss.messaging on every occurrence</para>
@@ -909,11 +915,14 @@
     <itemizedlist>
       <listitem>
         <para><note>
-        JBoss Messaging 1.4 requires a patched version of jboss-remoting.jar. The version is JBoss Remoting
-        2.2.2.SP11-brew. This version is available on JBoss EAP 4.3, so if you're using a different version you
-        should download it. The patched jar can be found at <ulink url="http://repository.jboss.com/jboss/remoting/2.2.2.SP11-brew/lib/">here</ulink>.
-	Please download it and make sure this jar is on your classpath *before* jbossall-client.jar.
-	</note></para>
+             If you are using JBoss Messaging 1.4.3.GA outiside of JBoss 4.2 or EAP 4.3, you need to make sure you use a JBoss Remoting 2.5.0.SP2. If you are using JBoss5 or EAP 4.3 you will have the required JAR available already: 
+             The version could be found at: 
+
+            <ulink
+            url="http://repository.jboss.com/jboss/remoting/2.5.0.SP2/lib/">here</ulink>
+
+             . Please download it and make sure this jar is on your classpath *before* jbossall-client.jar. 
+          </note></para>
       </listitem>
 
       <listitem>
@@ -929,9 +938,9 @@
       <listitem>
         <para>$JBOSS_HOME/server/&lt;SERVER_NAME&gt;/deploy/jboss-aop.deployer/jboss-aop.jar</para>
 
-        <para>JBoss AOP 1.5.5.GA_CP03-brew</para>
+        <para>JBoss AOP 2.0.1.GA</para>
 
-	<para><ulink  url="http://repository.jboss.com/jboss/aop/1.5.5.GA_CP03-brew/lib/">http://repository.jboss.com/jboss/aop/1.5.5.GA_CP03-brew/lib/</ulink></para>
+	<para><ulink  url="http://repository.jboss.com/jboss/aop/2.0.1.GA/lib/">http://repository.jboss.com/jboss/aop/2.0.1.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>
@@ -940,19 +949,19 @@
       <listitem>
         <para>$JBOSS_HOME/server/&lt;SERVER_NAME&gt;/lib/javassist.jar</para>
 
-        <para>Javassist 3.8.0.GA</para>
+        <para>Javassist 3.9.0.GA</para>
 
         <para><ulink
-		    url="http://repository.jboss.com/javassist/3.8.0.GA-brew/lib/">http://repository.jboss.com/javassist/3.8.0.GA-brew/lib/</ulink></para>
+		    url="http://repository.jboss.com/javassist/3.9.0.GA/lib/">http://repository.jboss.com/javassist/3.9.0.GA/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>trove 1.0.2</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>
+        url="http://repository.jboss.com/trove/1.0.2/lib/">http://repository.jboss.com/trove/1.0.2/lib/</ulink></para>
       </listitem>
 
       <listitem>
@@ -961,6 +970,59 @@
     </itemizedlist>
   </section>
 
+  <section id="inst.remoteclient.jb5">
+    <title>Accessing JBoss Messaging from a remote client - JBoss 5.0</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_HOME/client/jnp-client.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/jboss-javaee.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/jboss-messaging.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/jboss-remoting.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/jboss-serialization.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/javassist.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/jboss-aop-client.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/trove.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/log4j.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/jboss-logging-spi.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/jboss-logging-log4j.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/jboss-common-core.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/jboss-mdr.jar</para>
+      </listitem>
+      <listitem>
+        <para>$JBOSS_HOME/client/concurrent.jar</para>
+      </listitem>
+    </itemizedlist>
+  </section>
+
   <section id="inst.mqmessagemigration">
     <title>Migrating Messages from JBoss MQ to JBoss Messaging</title>
 

Modified: branches/Branch_1416_merge/docs/userguide/en/modules/runningexamples.xml
===================================================================
--- branches/Branch_1416_merge/docs/userguide/en/modules/runningexamples.xml	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/docs/userguide/en/modules/runningexamples.xml	2009-03-30 07:04:26 UTC (rev 6209)
@@ -118,7 +118,8 @@
   <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>
+  <para>The clustered examples expect two JBoss AS instances to running with 
+  ports settings as per ports-01 and ports-02.   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>
 </chapter>
\ No newline at end of file

Modified: branches/Branch_1416_merge/integration/AS5/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java
===================================================================
--- branches/Branch_1416_merge/integration/AS5/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/integration/AS5/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -1107,6 +1107,12 @@
       }
    }
 
+
+   public ObjectName getPostOfficeObjectName()
+   {
+      return postOfficeObjectName;
+   }
+
    // Inner classes --------------------------------------------------------------------------------
 
 }

Modified: branches/Branch_1416_merge/integration/EAP4/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java
===================================================================
--- branches/Branch_1416_merge/integration/EAP4/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/integration/EAP4/tests-src/org/jboss/test/messaging/tools/container/LocalTestServer.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -513,6 +513,11 @@
       return serverPeerObjectName;
    }
 
+   public ObjectName getPostOfficeObjectName()
+   {
+      return postOfficeObjectName;
+   }
+
    public Set getConnectorSubsystems() throws Exception
    {
       RemotingJMXWrapper remoting = (RemotingJMXWrapper)sc.getService(ServiceContainer.REMOTING_OBJECT_NAME);

Modified: branches/Branch_1416_merge/src/main/org/jboss/jms/server/bridge/Bridge.java
===================================================================
--- branches/Branch_1416_merge/src/main/org/jboss/jms/server/bridge/Bridge.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/src/main/org/jboss/jms/server/bridge/Bridge.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -186,10 +186,14 @@
    
    private boolean isSameSourceAndTarget;
    
-   private String queueCffName;
+   private String sourceQueueCffName;
    
-   private String topicCffName;
+   private String sourceTopicCffName;
    
+   private String targetQueueCffName;
+   
+   private String targetTopicCffName;
+   
    private ConnectionFactoryFactory sourceCff;
    
    private ConnectionFactoryFactory targetCff;
@@ -262,8 +266,10 @@
       this.targetProviderProperties = tarProps;
       this.sourceDestName = srcDestName;
       this.targetDestName = tarDestName;
-      this.queueCffName = qCffName;
-      this.topicCffName = tCffName;
+      this.sourceQueueCffName = qCffName;
+      this.sourceTopicCffName = qCffName;
+      this.targetQueueCffName = tCffName;
+      this.targetTopicCffName = tCffName;
       this.sourceUsername = sourceUsername;
       this.sourcePassword = sourcePassword;
       this.targetUsername = targetUsername;
@@ -742,15 +748,25 @@
       isSameSourceAndTarget = sameSourceAndTarget;
    }
 
-   public void setQueueCffName(String name)
+   public void setSourceQueueCffName(String name)
    {
-      queueCffName = name;
+      sourceQueueCffName = name;
    }   
 
-   public void setTopicCffName(String name)
+   public void setSourceTopicCffName(String name)
    {
-      topicCffName = name;
+      sourceTopicCffName = name;
    }   
+
+   public void setTargetQueueCffName(String name)
+   {
+      targetQueueCffName = name;
+   }   
+
+   public void setTargetTopicCffName(String name)
+   {
+      targetTopicCffName = name;
+   }   
    
    // Private -------------------------------------------------------------------
    
@@ -927,6 +943,7 @@
     * *before* the batch has been sent
     * 
     */
+   
    private boolean setupJMSObjects()
    {
       try
@@ -941,11 +958,11 @@
          //factories
          if(sourceDestination instanceof Topic)
          {
-            sourceCffName = topicCffName;
+            sourceCffName = sourceTopicCffName;
          }
          else
          {
-            sourceCffName = queueCffName;
+            sourceCffName = sourceQueueCffName;
          }
          
          sourceCff = new JNDIConnectionFactoryFactory(sourceProviderProperties, sourceCffName);
@@ -958,11 +975,11 @@
          {
             if(targetDestination instanceof Topic)
             {
-               targetCffName = topicCffName;
+               targetCffName = targetTopicCffName;
             }
             else
             {
-               targetCffName = queueCffName;
+               targetCffName = targetQueueCffName;
             }
             
             targetCff = new JNDIConnectionFactoryFactory(targetProviderProperties, targetCffName);

Modified: branches/Branch_1416_merge/src/main/org/jboss/jms/server/bridge/BridgeService.java
===================================================================
--- branches/Branch_1416_merge/src/main/org/jboss/jms/server/bridge/BridgeService.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/src/main/org/jboss/jms/server/bridge/BridgeService.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -317,16 +317,21 @@
       
       Properties targetProps = (Properties)server.getAttribute(targetProviderLoader, "Properties");
       
-      String queueCffName = (String)server.getAttribute(getSourceProviderLoader(), "QueueFactoryRef");      
-      String topicCffName = (String)server.getAttribute(getSourceProviderLoader(), "TopicFactoryRef"); 
+      String srcQueueCffName = (String)server.getAttribute(getSourceProviderLoader(), "QueueFactoryRef");      
+      String srcTopicCffName = (String)server.getAttribute(getSourceProviderLoader(), "TopicFactoryRef"); 
+      String targetQueueCffName = (String)server.getAttribute(getTargetProviderLoader(), "QueueFactoryRef");      
+      String targetTopicCffName = (String)server.getAttribute(getTargetProviderLoader(), "TopicFactoryRef"); 
       
       bridge.setIsSameSourceAndTarget(sameSourceAndTarget);
       bridge.setSourceProps(sourceProps);
       bridge.setTargetProps(targetProps);
       bridge.setSourceDestinationName(sourceDestinationLookup);
       bridge.setTargetDestinationName(targetDestinationLookup);
-      bridge.setQueueCffName(queueCffName);
-      bridge.setTopicCffName(topicCffName);
+      bridge.setSourceQueueCffName(srcQueueCffName);
+      bridge.setSourceTopicCffName(srcTopicCffName);
+      bridge.setTargetQueueCffName(targetQueueCffName);
+      bridge.setTargetTopicCffName(targetTopicCffName);
+      bridge.setName(serviceName.getCanonicalName());
 
       bridge.start();      
       

Modified: branches/Branch_1416_merge/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java
===================================================================
--- branches/Branch_1416_merge/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -219,17 +219,6 @@
     */
    public void handleConnectionException(Throwable t, Client client)
    {  
-      if (t instanceof ClientDisconnectedException)
-      {
-         // This is OK
-         if (trace) { log.trace(this + " notified that client " + client + " has disconnected"); }
-         return;
-      }
-      else
-      {
-         if (trace) { log.trace(this + " detected failure on client " + client, t); }
-      }
-
       String remotingSessionID = client.getSessionId();
       
       if (remotingSessionID != null)

Modified: branches/Branch_1416_merge/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
===================================================================
--- branches/Branch_1416_merge/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -362,7 +362,12 @@
       }
    }
 
-   public void close() throws JMSException
+   //reason for synchronization
+   //Sometimes the server side detects a connection failure but 
+   //client side is normal. So it's possible the client side is calling
+   //connection.close() while in the mean time the server side connection
+   //failure handler call it also.
+   public synchronized void close() throws JMSException
    {
       try
       {

Modified: branches/Branch_1416_merge/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- branches/Branch_1416_merge/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -1175,6 +1175,8 @@
       //Note we don't maintain order using a LinkedHashMap since then we lose
       //concurrency since we would have to lock it exclusively
 
+      synchronized (deliveries)
+      {
       List entries = new ArrayList(deliveries.entrySet());
 
       //Sort them in reverse delivery id order
@@ -1229,7 +1231,8 @@
       executor.shutdownAfterProcessingCurrentlyQueuedTasks();
 
       deliveries.clear();
-
+      }
+      
       sp.removeSession(id);
 
       Dispatcher.instance.unregisterTarget(id, this);
@@ -1733,7 +1736,19 @@
    {
       if (trace) { log.trace(this + " acknowledging delivery " + ack); }
 
-      DeliveryRecord rec = (DeliveryRecord)deliveries.remove(new Long(ack.getDeliveryID()));
+      DeliveryRecord rec = null;
+      
+      //I put synchronized here to prevent the following:
+      //a clustered server node detects connection failure and cancel deliveries.
+      //but the consumer on it get through to here
+      //if not synchronized, the remove may get the record before the above cancel action clear up the deliveries map.
+      //so the cancel action makes the message back to queue and this method cause the delivery count to decrement.
+      //as the cancel will decrease the delivery count once, so this will result the delivery count being decremented twice
+      //for one same message.
+      synchronized (deliveries)
+      {
+         rec = (DeliveryRecord)deliveries.remove(new Long(ack.getDeliveryID()));
+      }
 
       if (rec == null)
       {

Modified: branches/Branch_1416_merge/src/main/org/jboss/messaging/core/impl/clusterconnection/MessageSucker.java
===================================================================
--- branches/Branch_1416_merge/src/main/org/jboss/messaging/core/impl/clusterconnection/MessageSucker.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/src/main/org/jboss/messaging/core/impl/clusterconnection/MessageSucker.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -129,66 +129,68 @@
 								
 		consumer.setMessageListener(this);		
 		
+		started = true;
 		//Register ourselves with the local queue - this queue will handle flow control for us
 		
 		if (trace) { log.trace(this + " Registering sucker"); }
 		
 		localQueue.registerSucker(this);
 		
-		started = true;
-		
 		if (trace) { log.trace(this + " Registered sucker"); }
 	}
 	
-	synchronized void stop()
-	{
-		if (!started)
-		{
-			return;
-		}
-		
-		setConsuming(false);
-				
-		localQueue.unregisterSucker(this);
-		
-		try
-		{
-			consumer.closing(-1);
-		}
-		catch (Throwable t)
-		{
-			// Ignore
-		}
-		try
-		{
-			consumer.close();
-		}
-		catch (Throwable t)
-		{
-			//Ignore
-		}
-		
-		try
-		{
-			producer.close();
-		}
-		catch (Throwable t)
-		{
-			//Ignore
-		}
+   void stop()
+   {
+      localQueue.unregisterSucker(this);
 
-		sourceSession = null;
-		
-		localSession = null;
-		
-		consumer = null;
-		
-		clientConsumer = null;
-		
-		producer = null;
-		
-		started = false;
-	}
+      synchronized (this)
+      {
+         if (!started)
+         {
+            return;
+         }
+
+         setConsuming(false);
+
+         try
+         {
+            consumer.closing(-1);
+         }
+         catch (Throwable t)
+         {
+            // Ignore
+         }
+         try
+         {
+            consumer.close();
+         }
+         catch (Throwable t)
+         {
+            // Ignore
+         }
+
+         try
+         {
+            producer.close();
+         }
+         catch (Throwable t)
+         {
+            // Ignore
+         }
+
+         sourceSession = null;
+
+         localSession = null;
+
+         consumer = null;
+
+         clientConsumer = null;
+
+         producer = null;
+
+         started = false;
+      }
+   }
 	
 	public String getQueueName()
 	{
@@ -198,6 +200,11 @@
 	public synchronized void setConsuming(boolean consume)
 	{
 		if (trace) { log.trace(this + " setConsuming " + consume); }
+      
+		if (!started)
+      {
+         return;
+      }
 		
 		try
 		{

Modified: branches/Branch_1416_merge/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
===================================================================
--- branches/Branch_1416_merge/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -240,6 +240,16 @@
       
    // Constructors ---------------------------------------------------------------------------------
 
+   public boolean isFailoverOnNodeLeave()
+   {
+      return failoverOnNodeLeave;
+   }
+
+   public void setFailoverOnNodeLeave(boolean failoverOnNodeLeave)
+   {
+      this.failoverOnNodeLeave = failoverOnNodeLeave;
+   }
+
    /*
     * Constructor for a non clustered post office
     */

Modified: branches/Branch_1416_merge/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java
===================================================================
--- branches/Branch_1416_merge/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -326,17 +326,23 @@
    
 	public boolean isFailoverOnNodeLeave()
 	{
-		return failoverOnNodeLeave;
+	   if (started)
+	   {
+		   return postOffice.isFailoverOnNodeLeave();
+	   }
+	   return failoverOnNodeLeave;
 	}
 
-	public void setFailoverOnNodeLeave(boolean failoverOnNodeLeave)
+	public void setFailoverOnNodeLeave(boolean fover)
 	{
-		if (started)
-      {
-         log.warn("Cannot set attribute when service is started");
-         return;
-      }
-		this.failoverOnNodeLeave = failoverOnNodeLeave;
+	   if (started)
+	   {
+	      postOffice.setFailoverOnNodeLeave(fover);
+	   }
+	   else
+	   {
+	      failoverOnNodeLeave = fover;
+	   }
 	}
 
    

Modified: branches/Branch_1416_merge/tests/build.properties
===================================================================
--- branches/Branch_1416_merge/tests/build.properties	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/tests/build.properties	2009-03-30 07:04:26 UTC (rev 6209)
@@ -2,7 +2,7 @@
 # Local overrides for the builds initiated by build.sh
 #
 
-test.bind.address=192.168.1.101
+#test.bind.address=192.168.1.101
 test.bind.address=localhost
 jgroups.bind_addr=localhost
 #default.database=mysql

Modified: branches/Branch_1416_merge/tests/build.xml
===================================================================
--- branches/Branch_1416_merge/tests/build.xml	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/tests/build.xml	2009-03-30 07:04:26 UTC (rev 6209)
@@ -351,6 +351,7 @@
 					<include name="**/messaging/core/**/${test-mask}.class" />
 					<include name="**/jms/**/${test-mask}.class" />
 					<include name="**/messaging/util/**/${test-mask}.class" />
+                                        <exclude name="**/jms/DeliveryOnConnectionFailureTest.class" />
 					<exclude name="**/jms/MemLeakTest.class" />
 					<exclude name="**/jms/RemotingConnectionConfigurationTest.class" />
 					<exclude name="**/jms/XAResourceRecoveryTest.class" />
@@ -722,13 +723,45 @@
 				<formatter type="plain" usefile="${junit.formatter.usefile}" />
 
 				<fileset dir="${build.tests.classes}">
-					<include name="**/jms/bridge/**/${test-mask}.class" />
+                                        <include name="**/jms/bridge/**/BridgeMBeanExtraTest.class" />
 				</fileset>
 			</batchtest>
 		</junit>
 
 		<antcall target="stop-rmi-server" />
 
+		<junit printsummary="${junit.printsummary}" fork="on" forkMode="once" includeantruntime="yes" haltonerror="${junit.haltonerror}" haltonfailure="${junit.haltonfailure}" showoutput="${junit.showoutput}" timeout="${bridge.junit.timeout}">
+
+			<sysproperty key="remote" value="true" />
+			<sysproperty key="module.output" value="${tests.output}" />
+			<sysproperty key="test.bind.address" value="${test.bind.address}" />
+			<sysproperty key="jgroups.bind_addr" value="${test.bind.address}" />
+			<sysproperty key="test.database" value="${functional.tests.database}" />
+			<sysproperty key="test.remoting" value="${test.remoting}" />
+			<sysproperty key="test.logfile.suffix" value="remote-client" />
+			<sysproperty key="objectstore.dir" value="${objectstore.dir}" />
+			<jvmarg value="-Xmx512M" />
+			<!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=n,suspend=n,address=antjunit"/>
+         -->
+			<classpath>
+				<path refid="test.execution.classpath" />
+			</classpath>
+
+			<sysproperty key="jboss-junit-configuration" value="Remote-${test.remoting}" />
+			<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter" usefile="${junit.formatter.usefile}" extension="-Remote-${test.remoting}.xml" />
+
+			<batchtest todir="${junit.batchtest.todir}" haltonfailure="${junit.batchtest.haltonfailure}" haltonerror="${junit.batchtest.haltonerror}">
+				<formatter type="plain" usefile="${junit.formatter.usefile}" />
+
+				<fileset dir="${build.tests.classes}">
+					<include name="**/jms/bridge/**/${test-mask}.class" />
+                                        <exclude name="**/jms/bridge/**/BridgeMBeanExtraTest.class" />
+				</fileset>
+			</batchtest>
+		</junit>
+		<antcall target="stop-rmi-server" />
+
 	</target>
 
 	<target name="memory-leak-tests" depends="tests-jar, prepare-testdirs, clear-test-logs" description="Runs MemoryLeakTests, but it starts the clustering for leak-clustering-tests">

Copied: branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/core/postoffice/PostOfficeManagementTest.java (from rev 6208, branches/Branch_1_4/tests/src/org/jboss/test/messaging/core/postoffice/PostOfficeManagementTest.java)
===================================================================
--- branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/core/postoffice/PostOfficeManagementTest.java	                        (rev 0)
+++ branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/core/postoffice/PostOfficeManagementTest.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2009, Red Hat Middleware LLC, and individual contributors
+ * 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.test.messaging.core.postoffice;
+
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+
+import org.jboss.test.messaging.MessagingTestCase;
+import org.jboss.test.messaging.core.PostOfficeTestBase;
+import org.jboss.test.messaging.jms.JMSTestCase;
+import org.jboss.test.messaging.tools.ServerManagement;
+
+/**
+ * A PostOfficeManagementTest
+ *
+ * @author <a href="mailto:hgao at redhat.com">Howard Gao</a>
+ *
+ *
+ */
+public class PostOfficeManagementTest extends MessagingTestCase
+{
+
+   /**
+    * @param name
+    */
+   public PostOfficeManagementTest(String name)
+   {
+      super(name);
+   }
+   
+   public void setUp() throws Exception
+   {
+      super.setUp();
+      
+      ServerManagement.stop();
+      
+      ServerManagement.start("all");
+            
+   }
+
+   public void tearDown() throws Exception
+   {
+      super.tearDown();
+      
+      ServerManagement.stop();
+   }
+   
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+   public void testDeployAndPropertyChange() throws Exception
+   {
+      ObjectName poName = ServerManagement.getServer(0).getPostOfficeObjectName();
+      boolean failoverOnNodeLeave = ((Boolean)ServerManagement.getAttribute(poName, "FailoverOnNodeLeave")).booleanValue();
+      assertFalse(failoverOnNodeLeave);
+      ServerManagement.setAttribute(poName, "FailoverOnNodeLeave", "true");
+      failoverOnNodeLeave = ((Boolean)ServerManagement.getAttribute(poName, "FailoverOnNodeLeave")).booleanValue();
+      assertTrue(failoverOnNodeLeave);
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}

Copied: branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/DeliveryOnConnectionFailureTest.java (from rev 6208, branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/DeliveryOnConnectionFailureTest.java)
===================================================================
--- branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/DeliveryOnConnectionFailureTest.java	                        (rev 0)
+++ branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/DeliveryOnConnectionFailureTest.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -0,0 +1,291 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2009, Red Hat Middleware LLC, and individual contributors
+ * 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.test.messaging.jms;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+import org.jboss.jms.client.JBossConnection;
+import org.jboss.jms.client.JBossConnectionFactory;
+import org.jboss.jms.client.delegate.ClientConnectionDelegate;
+import org.jboss.jms.client.remoting.JMSRemotingConnection;
+import org.jboss.jms.server.ServerPeer;
+import org.jboss.jms.server.connectionmanager.SimpleConnectionManager;
+import org.jboss.remoting.Client;
+import org.jboss.test.messaging.tools.ServerManagement;
+import org.jboss.test.messaging.tools.container.Command;
+import org.jboss.test.messaging.tools.container.Server;
+
+/**
+ * A DeliveryOnConnectionFailureTest
+ *
+ * @author <a href="mailto:hgao at redhat.com">Howard Gao</a>
+ * 
+ * Created Mar 26, 2009 3:14:28 PM
+ *
+ */
+public class DeliveryOnConnectionFailureTest extends JMSTestCase
+{
+
+   public DeliveryOnConnectionFailureTest(String name)
+   {
+      super(name);
+   }
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+   
+   //https://jira.jboss.org/jira/browse/JBMESSAGING-1456
+   //Message Stuck means messages are kept in delivering state and never be delivered again
+   //unless the server is restarted (for persistent messages).
+   //this can happen in the following conditions:
+   //1. The client ping timeout and JBM tries to disconnect from the server (this happens in cluster).
+   //2. Due to the network/remoting issue, the server will receive a 'normal' disconnection event
+   //3. The server assumes the client has already closed it's connection and therefore doesn't clean up
+   //4. So the connection at the server is left open, including the sessions created on that connection.
+   //5. If the sessions contains messages in delivering, those messages will appear stuck.
+   //To fix this, either the server side always tries to clean up the connection whenever a disconnection happens
+   //or the remoting layer handle this correctly.
+   //
+   //Here we simplify the situation. First start the server and get a connection to it. Then
+   //we send a message to the server with client ack. We receive it without ack, 
+   //next we directly call the client.disconnect() from client without closing the connection
+   //the server should cancel the message. Then we receive the message and ack it.
+   public void testMessageStuckOnConnectionFailure() throws Exception
+   {
+      ConnectionFactory cf = (JBossConnectionFactory)ic.lookup("/ConnectionFactory");
+      
+      JBossConnection conn1 = null;
+      JBossConnection conn2 = null;
+
+      try
+      {
+         //create a connection
+         conn1 = (JBossConnection)cf.createConnection();
+         Session sess1 = conn1.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+         MessageProducer prod1 = sess1.createProducer(queue1);
+         TextMessage msg = sess1.createTextMessage("dont-stuck-me!");
+         conn1.start();
+         
+         //send a message
+         prod1.send(msg);
+         
+         //receive the message but not ack
+         MessageConsumer cons1 = sess1.createConsumer(queue1);
+         TextMessage rm = (TextMessage)cons1.receive(2000);
+         
+         assertNotNull(rm);
+         assertEquals("dont-stuck-me!", rm.getText());
+         
+         //break connection.
+         JMSRemotingConnection jmsConn = ((ClientConnectionDelegate)conn1.getDelegate()).getRemotingConnection();
+         Client rmClient = jmsConn.getRemotingClient();
+         rmClient.disconnect();
+         
+         //wait for server side cleanup
+         try
+         {
+            Thread.sleep(5000);
+         }
+         catch (InterruptedException e)
+         {
+            //ignore.
+         }
+         
+         //now receive the message 
+         conn2 = (JBossConnection)cf.createConnection();
+         conn2.start();
+         Session sess2 = conn2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+         MessageConsumer cons2 = sess2.createConsumer(queue1);
+         TextMessage rm2 = (TextMessage)cons2.receive(2000);
+
+         assertNotNull(rm2);
+         assertEquals("dont-stuck-me!", rm2.getText());
+         rm2.acknowledge();
+         
+         //Message count should be zero.
+         //this is checked in tearDown().
+      }
+      finally
+      {
+         if (conn1 != null)
+         {
+            conn1.close();
+         }
+         if (conn2 != null)
+         {
+            conn2.close();
+         }
+      }
+
+   }
+   
+   //https://jira.jboss.org/jira/browse/JBMESSAGING-1456
+   //another issue with jira 1456 is negative message count.
+   //This test guarantees the message count won't go negative
+   //Error Scenario:
+   // 1. Server side detects the connection failure (lease timeout) and close the connection/session
+   // 2. The session endpoint will cancel the messages being delivered to the queue.
+   // 3. At the same time the client side received some of the messages and acknowledge them
+   // 4. The acknowledge action will decrease the delivering count of the queue, and the session endpoint
+   //    cancel also decrease the delivering count.
+   // 5. If not synchronized, one message may be canceled and acked at the same time, so the delivering count
+   //    will be decreased twice for each message, resulting in negative message count.
+   //
+   //The test first creates a connection and send messages, then it receives the messages, then ack the last
+   //msg (client-ack), at the same time, simulate the server side connection failure to trigger server side
+   //clean up. This will create a possibility that when not properly synchronized, the above 
+   //described issue may happen. At the end check the message count, it should always be zero.
+   public void testMessageCountOnConnectionFailure() throws Exception
+   {
+      ConnectionFactory cf = (JBossConnectionFactory)ic.lookup("/ConnectionFactory");
+      
+      JBossConnection conn1 = null;
+      JBossConnection conn2 = null;
+      
+      try
+      {
+         conn1 = (JBossConnection)cf.createConnection();
+         conn1.start();
+         Session sess1 = conn1.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+         
+         //now send messages
+         MessageProducer prod1 = sess1.createProducer(queue1);
+         
+         final int NUM_MSG = 2000;
+         for (int i = 0; i < NUM_MSG; ++i)
+         {
+            TextMessage tm = sess1.createTextMessage("-m"+i);
+            prod1.send(tm);
+         }
+         
+         //receive the messages
+         MessageConsumer cons1 = sess1.createConsumer(queue1);
+         for (int j = 0; j < NUM_MSG-1; ++j)
+         {
+            TextMessage rm = (TextMessage)cons1.receive(2000);
+            assertNotNull(rm);
+            assertEquals("-m"+j, rm.getText());
+         }
+         
+         //last message
+         TextMessage lastRm = (TextMessage)cons1.receive(2000);
+         assertNotNull(lastRm);
+         assertEquals("-m"+(NUM_MSG-1), lastRm.getText());
+         
+         final ServerClientFailureCommand cmd = new ServerClientFailureCommand();
+         
+         Thread exeThr = new Thread()
+         {
+            public void run()
+            {
+               try
+               {
+                  ServerManagement.getServer().executeCommand(cmd);
+               }
+               catch (Exception e)
+               {
+                  log.error("failed to invoke command", e);
+                  fail("failure in executing command.");
+               }               
+            }
+         };
+         
+         exeThr.start();
+
+         //ack last message, making server side ack happening.
+         lastRm.acknowledge();
+
+         //receive possible canceled messages
+         TextMessage prm = null;
+         conn2 = (JBossConnection)cf.createConnection();
+         conn2.start();
+         Session sess2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageConsumer cons2 = sess2.createConsumer(queue1);
+         prm = (TextMessage)cons2.receive(2000);
+         while (prm != null)
+         {
+            prm = (TextMessage)cons2.receive(2000);
+         }
+         
+         //check message count
+         //tearDown will do the check.
+      }
+      finally
+      {
+         if (conn1 != null)
+         {
+            conn1.close();
+         }
+         if (conn2 != null)
+         {
+            conn2.close();
+         }
+      }      
+   }
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+   public static class ServerClientFailureCommand implements Command
+   {
+
+      private static final long serialVersionUID = 2603154447586447658L;
+
+      public Object execute(Server server) throws Exception
+      {
+         ServerPeer peer = server.getServerPeer();
+
+         SimpleConnectionManager cm = (SimpleConnectionManager)peer.getConnectionManager();
+
+         Map jmsClients = cm.getClients();
+         assertEquals(1, jmsClients.size());
+         Map endpoints = (Map)jmsClients.values().iterator().next();
+         assertEquals(1, endpoints.size());
+         Map.Entry entry = (Map.Entry)endpoints.entrySet().iterator().next();
+         String sessId = (String)entry.getKey();
+
+         // triggering server side clean up
+         cm.handleClientFailure(sessId);
+         return null;
+      }
+      
+   }
+}

Copied: branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/bridge/BridgeMBeanExtraTest.java (from rev 6208, branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/bridge/BridgeMBeanExtraTest.java)
===================================================================
--- branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/bridge/BridgeMBeanExtraTest.java	                        (rev 0)
+++ branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/bridge/BridgeMBeanExtraTest.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -0,0 +1,470 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2009, Red Hat Middleware LLC, and individual contributors
+ * 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.test.messaging.jms.bridge;
+
+import java.io.ByteArrayOutputStream;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+
+import org.jboss.jms.server.bridge.Bridge;
+import org.jboss.jms.server.bridge.ConnectionFactoryFactory;
+import org.jboss.jms.server.bridge.DestinationFactory;
+import org.jboss.jms.server.bridge.JNDIConnectionFactoryFactory;
+import org.jboss.jms.server.bridge.JNDIDestinationFactory;
+import org.jboss.logging.Logger;
+import org.jboss.test.messaging.MessagingTestCase;
+import org.jboss.test.messaging.tools.ServerManagement;
+import org.jboss.test.messaging.tools.container.ServiceAttributeOverrides;
+import org.jboss.test.messaging.tools.container.ServiceContainer;
+
+/**
+ * A BridgeMBeanExtraTest
+ *
+ * @author <a href="mailto:hgao at redhat.com">Howard Gao</a>
+ * 
+ * Created Feb 11, 2009 11:31:47 AM
+ *
+ *
+ */
+public class BridgeMBeanExtraTest extends MessagingTestCase
+{
+   private static final Logger log = Logger.getLogger(BridgeMBeanExtraTest.class);
+   protected static boolean firstTime = true;
+   protected static ServiceContainer sc;
+   
+   protected static Queue sourceQueue, targetQueue, localTargetQueue;
+   protected static ConnectionFactory cf0, cf1;
+   protected static DestinationFactory sourceQueueFactory, targetQueueFactory, localTargetQueueFactory, sourceTopicFactory;
+   protected static Properties sourceProps;
+   protected static Properties targetProps;
+   protected static ConnectionFactoryFactory cff0, cff1;
+   protected static Topic sourceTopic;   
+                                                      
+   public BridgeMBeanExtraTest(String name)
+   {
+      super(name);
+   }
+   
+   private static ObjectName sourceProviderLoader;
+   
+   private static ObjectName targetProviderLoader;
+   
+   protected void setUpServers() throws Exception
+   {
+      
+      if (firstTime)
+      {
+         //Start the servers
+         
+         ServerManagement.start(0, "all", true);
+
+         ServiceAttributeOverrides overrides = new ServiceAttributeOverrides();
+         ObjectName on = new ObjectName("jboss.messaging.connectionfactory:service=ConnectionFactory");
+         overrides.put(on, "JNDIBindings", "<bindings><binding>/ConnectionFactory2</binding>"
+                       + "<binding>/XAConnectionFactory2</binding>"
+                       + "<binding>java:/ConnectionFactory2</binding>"
+                       + "<binding>java:/XAConnectionFactory</binding>"
+                       + "</bindings>");
+         //overrides.put(on, attrName, attrValue);
+         
+         ServerManagement.start(1, "all", overrides, false);
+
+         ServerManagement.deployQueue("sourceQueue", 0);
+
+         ServerManagement.deployTopic("sourceTopic", 0);  
+
+         ServerManagement.deployQueue("localTargetQueue", 0);
+
+         ServerManagement.deployQueue("targetQueue", 1);     
+         
+         setUpAdministeredObjects();
+         
+         //We need a local transaction and recovery manager
+         //We must start this after the remote servers have been created or it won't
+         //have deleted the database and the recovery manager may attempt to recover transactions
+         sc = new ServiceContainer("transaction");   
+         
+         sc.start(false);   
+         
+         Properties props1 = new Properties();
+         props1.putAll(ServerManagement.getJNDIEnvironment(0));
+         
+         Properties props2 = new Properties();
+         props2.putAll(ServerManagement.getJNDIEnvironment(1));
+         
+         installJMSProviderLoader(0, props1, "/XAConnectionFactory", "adaptor1");
+         
+         installJMSProviderLoader(0, props2, "/XAConnectionFactory2", "adaptor2");
+         
+         sourceProviderLoader = new ObjectName("jboss.messaging:service=JMSProviderLoader,name=adaptor1");
+         targetProviderLoader = new ObjectName("jboss.messaging:service=JMSProviderLoader,name=adaptor2");
+         
+         firstTime = false;
+      }          
+            
+   }
+
+   public void setUp() throws Exception
+   {      
+      super.setUp();
+      
+      setUpServers();
+   }
+   
+   public void tearDown() throws Exception
+   {
+      super.tearDown();
+   }
+   
+   /**
+    * This test is mainly copied from BridgeMBeanTest with the exception that
+    * the FactoryRef Name for the targetProviderLoader is made different from the sourceProviderLoader's.
+    * see: https://jira.jboss.org/jira/browse/JBMESSAGING-1502
+    * @throws Exception
+    */
+   public void testProviderConfigParams() throws Exception
+   {
+      ObjectName on = null;
+      Connection connSource = null;
+      Connection connTarget = null;
+
+      try
+      {
+         on = deployBridge(0, "Bridge1", sourceProviderLoader, targetProviderLoader,
+                                      "/queue/sourceQueue", "/queue/targetQueue",
+                                      null, null, null, null,
+                                      Bridge.QOS_AT_MOST_ONCE, null, 1,
+                                      -1, null, null, 5000, -1, false);
+         log.info("Deployed bridge");
+         
+         ServerManagement.getServer(0).invoke(on, "create", new Object[0], new String[0]);
+         
+         log.info("Created bridge");
+                      
+         connSource = cf0.createConnection();
+         
+         connTarget = cf1.createConnection();
+         
+         connTarget.start();
+         
+         connSource.start();
+         
+         final int NUM_MESSAGES = 50;
+         
+         Session sessSource = connSource.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         
+         MessageProducer prod = sessSource.createProducer(sourceQueue);
+         
+         Session sessTarget = connTarget.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         
+         MessageConsumer cons = sessTarget.createConsumer(targetQueue);
+         
+         for (int i = 0; i < NUM_MESSAGES; i++)
+         {
+            TextMessage tm = sessSource.createTextMessage("message" + i);
+            
+            prod.send(tm);
+         }
+         
+         //It's stopped so no messages should be received
+         
+         checkEmpty(targetQueue, 1);
+         
+         //Start it
+         
+         log.info("Starting bridge");
+         ServerManagement.getServer(0).invoke(on, "start", new Object[0], new String[0]);
+         log.info("Started bridge");
+         
+         //Now should receive the messages
+                  
+         for (int i = 0; i < NUM_MESSAGES; i++)
+         {
+            TextMessage tm = (TextMessage)cons.receive(2000);
+            
+            assertNotNull(tm);
+
+            assertEquals("message" + i, tm.getText());
+         }
+         
+         checkEmpty(targetQueue, 1);
+                  
+         //Send some more
+         
+         for (int i = NUM_MESSAGES; i < 2 * NUM_MESSAGES; i++)
+         {
+            TextMessage tm = sessSource.createTextMessage("message" + i);
+            
+            prod.send(tm);
+         }
+         
+         //These should be received too
+         
+         for (int i = NUM_MESSAGES; i < 2 * NUM_MESSAGES; i++)
+         {
+            TextMessage tm = (TextMessage)cons.receive(2000);
+            
+            assertNotNull(tm);
+
+            assertEquals("message" + i, tm.getText());
+         }
+         
+         checkEmpty(targetQueue, 1);
+         
+         //Pause it
+         
+         ServerManagement.getServer(0).invoke(on, "pause", new Object[0], new String[0]);
+         
+         boolean isPaused = ((Boolean)ServerManagement.getAttribute(on, "Paused")).booleanValue();
+         
+         assertTrue(isPaused);
+         
+         // Send some more
+         
+         for (int i = 2 * NUM_MESSAGES; i < 3 * NUM_MESSAGES; i++)
+         {
+            TextMessage tm = sessSource.createTextMessage("message" + i);
+            
+            prod.send(tm);
+         }
+         
+         //These shouldn't be received
+         
+         checkEmpty(targetQueue, 1);
+         
+         // Resume
+         
+         ServerManagement.getServer(0).invoke(on, "resume", new Object[0], new String[0]);
+         
+         //Now messages should be received
+         
+         for (int i = 2 * NUM_MESSAGES; i < 3 * NUM_MESSAGES; i++)
+         {
+            TextMessage tm = (TextMessage)cons.receive(2000);
+            
+            assertNotNull(tm);
+
+            assertEquals("message" + i, tm.getText());
+         }
+         
+         checkEmpty(targetQueue, 1);
+         
+         isPaused = ((Boolean)ServerManagement.getAttribute(on, "Paused")).booleanValue();
+         
+         assertFalse(isPaused);
+         
+         //Stop
+         
+         ServerManagement.getServer(0).invoke(on, "stop", new Object[0], new String[0]);
+         
+         boolean isStarted = ((Boolean)ServerManagement.getAttribute(on, "Started")).booleanValue();
+         
+         assertFalse(isStarted); 
+      }
+      finally
+      {         
+         if (connSource != null)
+         {
+            connSource.close();
+         }
+         
+         if (connTarget != null)
+         {
+            connTarget.close();
+         }
+         
+         try
+         {
+            if (on != null)
+            {
+               ServerManagement.getServer(0).invoke(on, "stop", new Object[0], new String[0]);
+               ServerManagement.getServer(0).invoke(on, "destroy", new Object[0], new String[0]);
+            }
+         }
+         catch(Exception e)
+         {
+            //Ignore            
+         }
+      }
+
+   }
+   
+   protected void setUpAdministeredObjects() throws Exception
+   {
+      InitialContext ic0 = null, ic1 = null;
+      try
+      {
+         Hashtable props0 = ServerManagement.getJNDIEnvironment(0);
+         
+         sourceProps = new Properties();
+         Enumeration keys = props0.keys();
+         while (keys.hasMoreElements())
+         {
+            Object key = keys.nextElement();
+            sourceProps.put(key, props0.get(key));
+         }
+         
+         Hashtable props1 = ServerManagement.getJNDIEnvironment(1);
+         targetProps = new Properties();
+         keys = props1.keys();
+         while (keys.hasMoreElements())
+         {
+            Object key = keys.nextElement();
+            targetProps.put(key, props1.get(key));
+         }
+         
+         cff0 = new JNDIConnectionFactoryFactory(props0, "/ConnectionFactory");
+         
+         cff1 = new JNDIConnectionFactoryFactory(props1, "/ConnectionFactory2");
+               
+         ic0 = new InitialContext(props0);
+         
+         ic1 = new InitialContext(props1);
+         
+         cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");
+         
+         cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory2");
+         
+         sourceQueueFactory = new JNDIDestinationFactory(props0, "/queue/sourceQueue");
+         
+         sourceQueue = (Queue)sourceQueueFactory.createDestination();
+         
+         targetQueueFactory = new JNDIDestinationFactory(props1, "/queue/targetQueue");
+         
+         targetQueue = (Queue)targetQueueFactory.createDestination();
+         
+         sourceTopicFactory = new JNDIDestinationFactory(props0, "/topic/sourceTopic");
+         
+         sourceTopic = (Topic)sourceTopicFactory.createDestination();
+         
+         localTargetQueueFactory = new JNDIDestinationFactory(props0, "/queue/localTargetQueue"); 
+         
+         localTargetQueue = (Queue)localTargetQueueFactory.createDestination();
+      }
+      finally
+      {
+         if (ic0 != null)
+         {
+            ic0.close();
+         }
+         if (ic1 != null)
+         {
+            ic1.close();
+         }
+      }    
+   }
+   
+   private ObjectName deployBridge(int server, String bridgeName,
+            ObjectName sourceProviderLoader, ObjectName targetProviderLoader,
+            String sourceDestLookup, String targetDestLookup,
+            String sourceUsername, String sourcePassword,
+            String targetUsername, String targetPassword,
+            int qos, String selector, int maxBatchSize,
+            long maxBatchTime, String subName, String clientID,
+            long failureRetryInterval, int maxRetries, boolean addMessageIDInHeader) throws Exception
+   {
+      String config = 
+         "<mbean code=\"org.jboss.jms.server.bridge.BridgeService\" " +
+         "name=\"jboss.messaging:service=Bridge,name=" + bridgeName + "\" " +
+         "xmbean-dd=\"xmdesc/Bridge-xmbean.xml\">" +      
+         "<attribute name=\"SourceProviderLoader\">" + sourceProviderLoader + "</attribute>"+      
+         "<attribute name=\"TargetProviderLoader\">" + targetProviderLoader + "</attribute>"+     
+         "<attribute name=\"SourceDestinationLookup\">" + sourceDestLookup + "</attribute>"+     
+         "<attribute name=\"TargetDestinationLookup\">" + targetDestLookup + "</attribute>";
+      if (sourceUsername != null)
+      {
+         config += "<attribute name=\"SourceUsername\">" + sourceUsername + "</attribute>";
+      }
+      if (sourcePassword != null)
+      {
+         config += "<attribute name=\"SourcePassword\">" + sourcePassword +"</attribute>";
+      }
+      if (targetUsername != null)
+      {
+         config +=  "<attribute name=\"TargetUsername\">" + targetUsername +"</attribute>";
+      }
+      if (targetPassword != null)
+      {
+         config += "<attribute name=\"TargetPassword\">" + targetPassword + "</attribute>";
+      }
+      config += "<attribute name=\"QualityOfServiceMode\">" + qos +"</attribute>";
+      if (selector != null)
+      {
+         config += "<attribute name=\"Selector\">" + selector + "</attribute>";
+      }
+      config += "<attribute name=\"MaxBatchSize\">" + maxBatchSize + "</attribute>"+           
+      "<attribute name=\"MaxBatchTime\">" + maxBatchTime +"</attribute>";
+      if (subName != null)
+      {
+         config += "<attribute name=\"SubName\">" + subName + "</attribute>";
+      }
+      if (clientID != null)
+      {
+         config += "<attribute name=\"ClientID\">" + clientID + "</attribute>";
+      }
+      config += "<attribute name=\"FailureRetryInterval\">" + failureRetryInterval + "</attribute>";    
+      
+      config += "<attribute name=\"MaxRetries\">" + maxRetries +"</attribute>";
+      
+      config += "<attribute name=\"AddMessageIDInHeader\">" + addMessageIDInHeader + "</attribute>";
+      config += "</mbean>";
+      
+      return ServerManagement.getServer(server).deploy(config);            
+   }
+   
+   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);
+   }
+
+}

Modified: branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/ClusterViewUpdateTest.java
===================================================================
--- branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/ClusterViewUpdateTest.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/ClusterViewUpdateTest.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -231,7 +231,7 @@
          ServerManagement.log(ServerManagement.INFO, "Killing server1", 2);
          ServerManagement.kill(1);
          // Need some time for Lease 
-         Thread.sleep(5000);
+         Thread.sleep(11000);
 
          assertEquals("Delegates are different on topology", 2,clusterDelegate.getTopology().getDelegates().length);
          assertEquals(2, clusterDelegate.getDelegates().length);

Modified: branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java
===================================================================
--- branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -6,13 +6,16 @@
  */
 package org.jboss.test.messaging.jms.clustering;
 
+import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Set;
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.DeliveryMode;
+import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
@@ -32,6 +35,7 @@
 
 /**
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="mailto:hgao at redhat.com">Howard Gao</a>
  * @version <tt>$Revision$</tt>
  *
  * $Id$
@@ -53,6 +57,54 @@
 
    // Public ---------------------------------------------------------------------------------------
 
+   //https://jira.jboss.org/jira/browse/JBMESSAGING-1547
+   //the dead lock happens when node0 is trying to deliver while node1 
+   //was shutdown.
+   public void testMessageSuckerStopDeadLock() throws Exception
+   {
+      Connection conn = null;
+
+      try 
+      {
+         conn = createConnectionOnServer(cf, 0);
+         conn.start();
+
+         Session session0 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         //killing node 1
+         ServerManagement.kill(1);
+
+         //this will cause the MessagingQueue.informSuckers() called.
+         //there is a chance when nodeLeft is detected, MessageSucker.stop() is being called
+         //just to collide with the informSuckers() call.
+         for (int i = 0; i < 10000; i++)
+         {
+            MessageConsumer consumer1 = session0.createConsumer(queue[0]);
+            consumer1.close();
+            Thread.yield();
+         }
+         
+         //if the deak lock happens, server1 won't be delivering any messages.
+         MessageProducer prod = session0.createProducer(queue[0]);
+         TextMessage msg = session0.createTextMessage("deadlock");
+         prod.send(msg);
+         
+         MessageConsumer cons = session0.createConsumer(queue[0]);
+         msg = (TextMessage)cons.receive(5000);
+         
+         assertNotNull(msg);
+         assertEquals("deadlock", msg.getText());
+         
+      }
+      finally
+      {
+         if (conn != null)
+         {
+            conn.close();
+         }
+      }
+   }
+   
    public void testSimpleConnectionFailover() throws Exception
    {
    	//We need to sleep and relookup the connection factory due to http://jira.jboss.com/jira/browse/JBMESSAGING-1038
@@ -2343,7 +2395,5 @@
    }
 
 
-
    // Inner classes --------------------------------------------------------------------------------
-
 }

Modified: branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java
===================================================================
--- branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -303,6 +303,11 @@
       return server.getServerPeerObjectName();
    }
 
+   public ObjectName getPostOfficeObjectName() throws Exception
+   {
+      return server.getPostOfficeObjectName();
+   }
+
    public boolean isStarted() throws Exception
    {
       return server.isStarted();

Modified: branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/tools/container/Server.java
===================================================================
--- branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/tools/container/Server.java	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/tests/src/org/jboss/test/messaging/tools/container/Server.java	2009-03-30 07:04:26 UTC (rev 6209)
@@ -296,4 +296,6 @@
 
    void deployConnectionFactory(String objectName, String[] jndiBindings, boolean strictTck) throws Exception;
 
+   ObjectName getPostOfficeObjectName() throws Exception;
+
 }

Modified: branches/Branch_1416_merge/tools/etc/buildmagic/aliases.ent
===================================================================
--- branches/Branch_1416_merge/tools/etc/buildmagic/aliases.ent	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/tools/etc/buildmagic/aliases.ent	2009-03-30 07:04:26 UTC (rev 6209)
@@ -1,97 +1,97 @@
-<!-- list of aliases used to bridge gap between buildmagic defs and jbossbuild -->
-
-
-<path id="apache.commons.classpath">
-  <pathelement path="${apache.collections.lib}/commons-collections.jar"/>
-  <pathelement path="${apache.logging.lib}/commons-logging.jar"/>
-  <pathelement path="${apache.httpclient.lib}/commons-httpclient.jar"/>
-  <pathelement path="${apache.pool.lib}/commons-pool.jar"/>
-  <pathelement path="${apache.discovery.lib}/commons-discovery.jar"/>
-  <pathelement path="${apache.fileupload.lib}/commons-fileupload.jar"/>
-  <pathelement path="${apache.lang.lib}/commons-lang-2.0.jar"/>  
-</path>
-
-<path id="sax.classpath">
-  <pathelement path="${xml-sax.classpath}"/>
-</path>
- 
-<property name="xdoclet-xdoclet.lib" value="${xdoclet.xdoclet.lib}"/>
-<path id="xdoclet.task.classpath">
-  <path refid="xdoclet.xdoclet.classpath"/>
-</path>
-   
-<property name="gjt.jpl-util.lib" value="${gjt.jpl.util.lib}"/>   
-<path id="gjt.jpl-util.classpath">
-   <path refid="gjt.jpl.util.classpath"/>
-</path>   
-
-<property name="opennms.joesnmp.lib" value="${joesnmp.joesnmp.lib}"/>   
-<path id="opennms.joesnmp.classpath">
-   <path refid="joesnmp.joesnmp.classpath"/>
-</path>   
-
-<path id="jacorb.idl.classpath">
-   <path refid="apache.avalon.logkit.classpath"/>
-   <pathelement path="${jacorb.jacorb.lib}/idl.jar"/>
-</path>
-
-<property name="jacorb.idl.include" value="${jacorb.jacorb.resources}"/>
-<property name="jacorb.jacorb.properties" value="${jacorb.jacorb.resources}"/>
-  
-<property name="sleepycat.lib" value="${sleepycat.sleepycat.lib}"/>
-<path id="sleepycat.classpath">
-   <path refid="sleepycat.sleepycat.classpath"/>
-</path>
-  
-<property name="apache.tomcat55.root" value="${apache.tomcat.root}"/>
-<property name="apache.tomcat55.lib" value="${apache.tomcat.lib}"/>
-<path id="apache.tomcat55.classpath">
-   <path refid="apache.tomcat.classpath"/>
-</path>
-  
-<property name="trove.lib" value="${trove.trove.lib}"/>  
-<path id="trove.classpath">
-   <path refid="trove.trove.classpath"/>
-</path>
-  
-<path id="qdox.classpath">
-   <path refid="qdox.qdox.classpath"/>
-</path>
-  
-<property name="javassist.lib" value="${javassist.javassist.lib}"/>
-<path id="javassist.classpath">
-  <path refid="javassist.javassist.classpath"/>
-</path>
-  
-<property name="hibernate.lib" value="${hibernate.hibernate.lib}"/>  
-<path id="hibernate3.classpath">
-  <path refid="hibernate.hibernate.classpath"/>
-</path>
-
-<property name="odmg.lib" value="${odmg.odmg.lib}"/>
-<path id="odmg.classpath">
-  <path refid="odmg.odmg.classpath"/>
-</path>
-
-<property name="cglib.lib" value="${cglib.cglib.lib}"/>
-<path id="cglib.classpath">
-  <path refid="cglib.cglib.classpath"/>  
-</path>
-
-<path id="ejb3-persistence.classpath">
-   <path refid="hibernate.annotations.classpath"/>
-   <path refid="hibernate.entitymanager.classpath"/>
-</path>
-
-<property name="spring.lib" value="${spring.spring.lib}"/>
-<path id="spring.classpath">
-  <path refid="spring.spring.classpath"/>  
-</path>
-
-<!-- Ant -->
-<property name="apache.ant.root" value="${project.tools}"/>
-<property name="apache.ant.lib" value="${apache.ant.root}/lib"/>
-<path id="apache.ant.classpath">
-  <pathelement path="${apache.ant.lib}/ant.jar"/>
-</path>
+<!-- list of aliases used to bridge gap between buildmagic defs and jbossbuild -->
+
+
+<path id="apache.commons.classpath">
+  <pathelement path="${apache.collections.lib}/commons-collections.jar"/>
+  <pathelement path="${apache.logging.lib}/commons-logging.jar"/>
+  <pathelement path="${apache.httpclient.lib}/commons-httpclient.jar"/>
+  <pathelement path="${apache.pool.lib}/commons-pool.jar"/>
+  <pathelement path="${apache.discovery.lib}/commons-discovery.jar"/>
+  <pathelement path="${apache.fileupload.lib}/commons-fileupload.jar"/>
+  <pathelement path="${apache.lang.lib}/commons-lang-2.0.jar"/>  
+</path>
+
+<path id="sax.classpath">
+  <pathelement path="${xml-sax.classpath}"/>
+</path>
+ 
+<property name="xdoclet-xdoclet.lib" value="${xdoclet.xdoclet.lib}"/>
+<path id="xdoclet.task.classpath">
+  <path refid="xdoclet.xdoclet.classpath"/>
+</path>
+   
+<property name="gjt.jpl-util.lib" value="${gjt.jpl.util.lib}"/>   
+<path id="gjt.jpl-util.classpath">
+   <path refid="gjt.jpl.util.classpath"/>
+</path>   
+
+<property name="opennms.joesnmp.lib" value="${joesnmp.joesnmp.lib}"/>   
+<path id="opennms.joesnmp.classpath">
+   <path refid="joesnmp.joesnmp.classpath"/>
+</path>   
+
+<path id="jacorb.idl.classpath">
+   <path refid="apache.avalon.logkit.classpath"/>
+   <pathelement path="${jacorb.jacorb.lib}/idl.jar"/>
+</path>
+
+<property name="jacorb.idl.include" value="${jacorb.jacorb.resources}"/>
+<property name="jacorb.jacorb.properties" value="${jacorb.jacorb.resources}"/>
+  
+<property name="sleepycat.lib" value="${sleepycat.sleepycat.lib}"/>
+<path id="sleepycat.classpath">
+   <path refid="sleepycat.sleepycat.classpath"/>
+</path>
+  
+<property name="apache.tomcat55.root" value="${apache.tomcat.root}"/>
+<property name="apache.tomcat55.lib" value="${apache.tomcat.lib}"/>
+<path id="apache.tomcat55.classpath">
+   <path refid="apache.tomcat.classpath"/>
+</path>
+  
+<property name="trove.lib" value="${trove.trove.lib}"/>  
+<path id="trove.classpath">
+   <path refid="trove.trove.classpath"/>
+</path>
+  
+<path id="qdox.classpath">
+   <path refid="qdox.qdox.classpath"/>
+</path>
+  
+<property name="javassist.lib" value="${javassist.javassist.lib}"/>
+<path id="javassist.classpath">
+  <path refid="javassist.javassist.classpath"/>
+</path>
+  
+<property name="hibernate.lib" value="${hibernate.hibernate.lib}"/>  
+<path id="hibernate3.classpath">
+  <path refid="hibernate.hibernate.classpath"/>
+</path>
+
+<property name="odmg.lib" value="${odmg.odmg.lib}"/>
+<path id="odmg.classpath">
+  <path refid="odmg.odmg.classpath"/>
+</path>
+
+<property name="cglib.lib" value="${cglib.cglib.lib}"/>
+<path id="cglib.classpath">
+  <path refid="cglib.cglib.classpath"/>  
+</path>
+
+<path id="ejb3-persistence.classpath">
+   <path refid="hibernate.annotations.classpath"/>
+   <path refid="hibernate.entitymanager.classpath"/>
+</path>
+
+<property name="spring.lib" value="${spring.spring.lib}"/>
+<path id="spring.classpath">
+  <path refid="spring.spring.classpath"/>  
+</path>
+
+<!-- Ant -->
+<property name="apache.ant.root" value="${project.tools}"/>
+<property name="apache.ant.lib" value="${apache.ant.root}/lib"/>
+<path id="apache.ant.classpath">
+  <pathelement path="${apache.ant.lib}/ant.jar"/>
+</path>
   
\ No newline at end of file

Modified: branches/Branch_1416_merge/tools/etc/jbossbuild/jbossbuild.properties
===================================================================
--- branches/Branch_1416_merge/tools/etc/jbossbuild/jbossbuild.properties	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/tools/etc/jbossbuild/jbossbuild.properties	2009-03-30 07:04:26 UTC (rev 6209)
@@ -1,9 +1,9 @@
-
-# The location of the thirdparty (prebuilt artifacts) directory relative to the project root
-jbossbuild.thirdparty.dir=thirdparty
-
-# The name of the component info file
-jbossbuild.component.info=component-info.xml
-
-# The targetdefs to use
+
+# The location of the thirdparty (prebuilt artifacts) directory relative to the project root
+jbossbuild.thirdparty.dir=thirdparty
+
+# The name of the component info file
+jbossbuild.component.info=component-info.xml
+
+# The targetdefs to use
 jbossbuild.targetdefs.refid=targets
\ No newline at end of file

Modified: branches/Branch_1416_merge/tools/etc/jbossbuild/tasks.xml
===================================================================
--- branches/Branch_1416_merge/tools/etc/jbossbuild/tasks.xml	2009-03-28 00:41:23 UTC (rev 6208)
+++ branches/Branch_1416_merge/tools/etc/jbossbuild/tasks.xml	2009-03-30 07:04:26 UTC (rev 6209)
@@ -1,1023 +1,1023 @@
-<?xml version="1.0"?>
-
-<!--
- JBoss, the OpenSource J2EE webOS
- 
- Distributable under LGPL license.
- See terms of license at gnu.org.
--->
-<project name="jboss.ant.tasks"
-         default="help-fragment"
->
-<!-- ================================================================== -->
-<!-- Properties                                                         -->
-<!-- ================================================================== -->
-
-   <!-- because this file may be imported from various locations
-     locations must be referenced in an absolute fashion   -->
-   <dirname property="imported.basedir" file="${ant.file.jboss.ant.tasks}"/>
-
-
-   <property file="${imported.basedir}/jbossbuild.properties"/>
-
-   <property name="jboss.tasks.path" 
-      value="${imported.basedir}/../../../tools/lib/jbossbuild.jar"   />
-
-   <!-- items required for javcc task --> 
-   <property name="sun.javacc.lib"
-      value="${imported.basedir}/../../../${jbossbuild.thirdparty.dir}/sun-javacc/lib/"/>
-             
-   <property name="jacorb.root"
-      value="${imported.basedir}/../../../${jbossbuild.thirdparty.dir}/jacorb"/> 
-
-   <property name="apache.logkit.lib"
-      value="${imported.basedir}/../../../${jbossbuild.thirdparty.dir}/apache-avalon-logkit/lib"/>              
-
-      
-    <path id="jacorb.idl.classpath">
-       <pathelement path="${jacorb.root}/lib/idl.jar"/>
-       <pathelement path="${apache.logkit.lib}/logkit.jar"/>
-    </path>
-
-
-<!-- ================================================================== -->
-<!-- Type Definitions                                                   -->
-<!-- ================================================================== -->
-
-   <!-- The generate type -->
-   <typedef name="generate"
-            classname="org.jboss.ant.types.Generate" 
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />
-
-   <!-- The build type -->
-   <typedef name="build"
-            classname="org.jboss.ant.types.build.Build" 
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />
-
-   <!-- The artifact type definition type -->
-   <typedef name="artifacttype"
-            classname="org.jboss.ant.types.build.ArtifactType" 
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />
-
-   <!-- The component definition type -->
-   <typedef name="componentdef"
-            classname="org.jboss.ant.types.component.ComponentDefinition" 
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />
-
-   <!-- The component type -->
-   <typedef name="component"
-            classname="org.jboss.ant.types.build.Component" 
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />
-
-   <!-- The includes type -->
-   <typedef name="includes"
-            classname="org.jboss.ant.types.Includes" 
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />
-
-   <!-- The build targets type -->
-   <typedef name="targets"
-            classname="org.jboss.ant.types.target.TargetDefinitions" 
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />
-
-<!-- ================================================================== -->
-<!-- Task Definitions                                                   -->
-<!-- ================================================================== -->
-
-   <!-- Update ide info for the main build -->
-   <taskdef name="idemain"
-            classname="org.jboss.ant.tasks.build.IDETask"
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />
-
-   <!-- Update ide info for the component -->
-   <taskdef name="idecomponent"
-            classname="org.jboss.ant.tasks.component.IDETask"
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />
-   
-   <!-- Generate a componentref graph and resolve the dependencies -->
-   <taskdef name="synchronizeinfo"
-            classname="org.jboss.ant.tasks.build.SynchronizeComponentsTask"
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />
-   
-   <!-- A task which allows a visitor to visit the graph -->
-   <taskdef name="visit-componentref-graph"
-            classname="org.jboss.ant.tasks.build.VisitComponentRefGraphTask"
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />   
-   
-   <!-- Generate libraries.ent with version number in paths -->
-   <taskdef name="gen-lib-file"
-            classname="org.jboss.ant.tasks.build.GenerateLibrariesFile"
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />  
-     
-   <!-- RMIC compilation logic -->
-   <taskdef name="rmic-helper"
-            classname="org.jboss.ant.tasks.build.RMICHelper"
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />     
-
-   <!-- Executes a given target without reparsing the project file -->
-   <taskdef name="execute-target"
-            classname="org.jboss.ant.tasks.build.TargetExecutor"
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   /> 
-  
-   <!-- Copy with support for zipfile sets -->
-   <taskdef name="copy-zfs"
-            classname="org.jboss.ant.tasks.build.CopyWithZipFileSetSupport"
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   /> 
-   
-   <!-- File release task -->
-   <taskdef name="copy-release"
-            classname="org.jboss.ant.tasks.build.CopyRelease"
-            loaderRef="jboss.tasks.path"
-            classpath="${jboss.tasks.path}"
-   />  
-   
-  
-   
-
-   
-
-<!-- ================================================================== -->
-<!-- Artifact Definitions                                               -->
-<!-- ================================================================== -->
-
-   <artifacttype type="jar" outputtype="lib"/>
-   <artifacttype type="zip" outputtype="lib"/>
-   <artifacttype type="sar" outputtype="lib"/>
-   <artifacttype type="rar" outputtype="lib"/>
-   <artifacttype type="war" outputtype="lib"/>
-   <artifacttype type="deployer" outputtype="lib"/>   
-   <artifacttype type="api" outputtype="api"/>
-   <artifacttype type="xml" outputtype="resource"/>
-   <artifacttype type="policy" outputtype="resource"/>
-   <artifacttype type="properties" outputtype="resource"/>
-   <artifacttype type="sh" outputtype="bin"/>
-   <artifacttype type="bat" outputtype="bin"/>
-   <artifacttype type="conf" outputtype="bin"/>
-   <artifacttype type="dtd" outputtype="dtd"/>
-   <artifacttype type="xsd" outputtype="schema"/>
-   <artifacttype type="aop" outputtype="resource"/>
-   <artifacttype type="idl" outputtype="resource"/>   
-   <artifacttype type="md5" outputtype="bin"/>      
-   <artifacttype type="dir" outputtype="lib"/>
-   <artifacttype type="ddl" outputtype="resource"/>
-   
-<!-- ================================================================== -->
-<!-- Target Definitions                                                 -->
-<!-- ================================================================== -->
-
-   <targets id="targets">
-
-      <!-- ============================================================ -->
-      <!-- Build All                                                    -->
-      <!-- Builds everything (build, docs, tests and release archives)  -->
-      <!-- ============================================================ -->
-
-      <targetdef target="all" description="Build All">
-         <main depends="build, doc, test, archives" components="none"/>
-         <component depends="build, doc, test"/>
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!--  Init                                                        -->
-      <!--  Basic initilization tasks and property setup                -->
-      <!-- ============================================================ -->      
-      <targetdef target="build.init" description="initilization tasks and property setup">
-
-         <!-- for each componentdef in jbossbuild file, setup properties 
-              in case a use wishes to access them    
-         -->
-         <component>
-            <property name="build.module" value="@{parentDir}"/>
-            <property name="build.module.src" value="${build.module}/src"/>
-            <property name="build.module.resources" value="${build.module}/src/resources"/>
-            <property name="build.module.etc" value="${build.module}/src/etc"/>
-            <property name="build.module.output" value="@{output}"/>
-            <property name="build.module.output.gen-src" value="${build.module.output}/gen-src"/>            
-            <property name="build.module.dir" value="@{output}"/>
-            <property name="build.module.output.resources" value="${build.module.output}/resources"/>                        
-            <property name="build.module.output.lib" value="${build.module.output}/lib"/>                                    
-            <property name="build.module.output.classes" value="${build.module.output}/classes"/> 
-         </component>
-      </targetdef>      
-
-      <!-- ============================================================ -->
-      <!-- Build                                                        -->
-      <!-- Builds the artifacts and compiles all source                 -->
-      <!-- ============================================================ -->
-
-      <targetdef target="build" description="Build" >
-
-         <!-- Build the main release
-              Creates the main release directory and copies artifacts
-              to the specified location
-         -->
-         <main>
-            <mkdir dir="@{releaseDir}"/>
-            <antCall target="release"/>
-         </main>
-
-
-         <!-- 
-         Build the component
-              Just makes the output folder
-         -->         
-         <component depends="build.init, build.etc">
-            <mkdir dir="@{output}/etc"/>
-            <copy todir="@{output}/etc" filtering="yes">
-               <fileset dir="@{component.dir}/src/etc/" includes="**"/>
-            </copy>
-         </component>
-
-         <!-- Build resources if the component has a 
-              resource node -->
-         <resource depends="build.resources"/>
-         
-         <!-- JTREE-JAVACC source generation  -->
-         <generatedsource when="@{jtree-javacc}">
-
-            <dirname file="/@{jtree-javacc}" property="@{id}.path"/>
-            <property name="@{id}.output.path" value="@{output}/${@{id}.path}"/>
-
-            <mkdir dir="${@{id}.output.path}"/>
-            <jjtree
-               target="src/@{srcdir}/@{jtree-javacc}"
-               outputdirectory="${@{id}.output.path}"
-               javacchome="${sun.javacc.lib}"/>
-
-            <basename file="@{jtree-javacc}" 
-               property="@{id}.basename"
-               suffix="jjt"/>
-
-            <javacc
-               target="${@{id}.output.path}/${@{id}.basename}.jj"
-               javacchome="${sun.javacc.lib}"/>
-
-         </generatedsource>
-
-         <!-- JAVACC source generation -->
-         <generatedsource when="@{javacc}">
-
-            <dirname file="/@{javacc}" property="@{id}.path"/>
-            <property name="@{id}.output.path" value="@{output}/${@{id}.path}"/>
-
-            <mkdir dir="${@{id}.output.path}"/>
-
-            <javacc
-               target="src/@{srcdir}/@{javacc}"
-               javacchome="${sun.javacc.lib}"
-               static="@{static}"
-               outputdirectory="${@{id}.output.path}"/>
-
-         </generatedsource>
-
-         <!-- IDL compilation -->         
-         <generatedsource when="@{idl}">
-
-            <!-- Task to compile idl files required by jacorb -->
-            <taskdef name="jacidl"
-               classname="org.jacorb.idl.JacIDL"
-               classpathref="jacorb.idl.classpath"
-            />             
-            
-            <property name="@{id}.output.path" value="@{output}/@{id}"/>
-
-            <mkdir dir="${@{id}.output.path}"/>
-
-            <jacidl
-               srcdir ="src/@{idl}"
-               destdir="${@{id}.output.path}"
-               includes="*.idl"
-               includepath="${jacorb.root}/resources/"
-             />
-         
-         </generatedsource> 
-         
- 
-         <!-- Compile the source
-              Runs depend on the source output then compiles the source
-         -->
-         <source if="@{compileable}">
-             
-            <mkdir dir="@{output}"/>
-            <depend srcdir="@{sourcePath}"
-                    destdir="@{output}"
-            >
-               <classpath>
-                  <buildpathelements/>
-               </classpath>
-            </depend>
-            <javac srcdir="@{sourcePath}" 
-                   destdir="@{output}"
-                   debug="true"
-                   deprecation="true"
-                   excludes="@{excludes}"
-                   target="@{jvmTarget}"
-                   source="@{jvmSource}"
-                   fork="true"
-                   memoryMaximumSize="512M"
-            >
-               <classpath>
-                  <buildpathelements/>
-               </classpath>
-               <src path="@{sourcePath}"/>
-               <!-- allow multiple sources to be compiled at once to handle circular references -->
-               <srcelements/>
-            </javac>
-
-           <copy toDir="@{output}">
-               <fileset dir="@{sourcePath}">
-                <include name="**/*.properties"/>
-              </fileset>
-           </copy>
-         </source>
-         
-        <source when="@{stubversion}">
-	    <property name="jb.stubversion" value="@{stubversion}"/>
-        </source>         
-         
-
-         <!-- Remote method call compilation.   -->
-         <source when="@{rmic}">
-            <rmic-helper
-                  base="@{output}"
-                  includes="@{rmic}"
-                  verify="true"
-                  debug="false"
-                  iiop="@{iiop}"
-                  idl="false"
-                  external="@{external}"
-                  stubversion="${jb.stubversion}"
-                  
-            >
-               <classpath>
-                  <buildpathelements/>
-               </classpath>
-               </rmic-helper>
-         </source>
-
-         <!-- Create a jar archive
-              Jars the inputs of the jar artifact
-         -->
-         <jar null="@{manifest}" if="@{buildable}">
-            <mkdir dir="@{parentDir}"/>
-            <jar destfile="@{output}">
-               <manifest>
-                  <attribute name="Created-by"               value="@{component.VMVersion} @{component.VMVendor}"/>
-                  <attribute name="Specification-Title"      value="@{component.specTitle}"/>
-                  <attribute name="Specification-Version"    value="@{component.specVersion}"/>
-                  <attribute name="Specification-Vendor"     value="@{component.specVendor}"/>
-                  <attribute name="Implementation-Title"     value="@{component.implTitle}"/>
-                  <attribute name="Implementation-URL"       value="@{component.implURL}"/>
-                  <attribute name="Implementation-Version"   value="@{component.implVersion}"/>
-                  <attribute name="Implementation-Vendor"    value="@{component.implVendor}"/>
-                  <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
-                  <attribute name="Class-Path"               value="@{classpath}"/>
-               </manifest>
-               <filesets/>
-            </jar>
-         </jar>
-
-         <!-- Create an aop archive
-              Jars the inputs of the aop artifact
-         -->
-         <aop  if="@{buildable}">
-            <mkdir dir="@{parentDir}"/>
-            <jar destfile="@{output}">
-                <filesets/>
-            </jar>
-         </aop>         
-
-         <jar when="@{manifest}" if="@{buildable}">
-            <mkdir dir="@{parentDir}"/>
-            <jar destfile="@{output}"
-                 manifest="@{component.output}/etc/manifest/@{manifest}">
-               <filesets/>
-            </jar>
-         </jar>
-         
-         
-
-         <!-- Create a sar archive
-              Jars the inputs of the sar artifact
-         -->
-         <sar null="@{manifest}">
-            <mkdir dir="@{parentDir}"/>
-            <jar destfile="@{output}">
-               <manifest>
-                  <attribute name="Created-by"               value="@{component.VMVersion} @{component.VMVendor}"/>
-                  <attribute name="Specification-Title"      value="@{component.specTitle}"/>
-                  <attribute name="Specification-Version"    value="@{component.specVersion}"/>
-                  <attribute name="Specification-Vendor"     value="@{component.specVendor}"/>
-                  <attribute name="Implementation-Title"     value="@{component.implTitle}"/>
-                  <attribute name="Implementation-URL"       value="@{component.implURL}"/>
-                  <attribute name="Implementation-Version"   value="@{component.implVersion}"/>
-                  <attribute name="Implementation-Vendor"    value="@{component.implVendor}"/>
-                  <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
-                  <attribute name="Class-Path"               value="@{classpath}"/>
-               </manifest>
-               <filesets/>
-            </jar>
-         </sar>
-
-
-         <!-- Create a rar archive
-              Jars the inputs of the rar artifact
-         -->
-         <rar null="@{manifest}">
-            <mkdir dir="@{parentDir}"/>
-            <jar destfile="@{output}">
-               <manifest>
-                  <attribute name="Created-by"               value="@{component.VMVersion} @{component.VMVendor}"/>
-                  <attribute name="Specification-Title"      value="@{component.specTitle}"/>
-                  <attribute name="Specification-Version"    value="@{component.specVersion}"/>
-                  <attribute name="Specification-Vendor"     value="@{component.specVendor}"/>
-                  <attribute name="Implementation-Title"     value="@{component.implTitle}"/>
-                  <attribute name="Implementation-URL"       value="@{component.implURL}"/>
-                  <attribute name="Implementation-Version"   value="@{component.implVersion}"/>
-                  <attribute name="Implementation-Vendor"    value="@{component.implVendor}"/>
-                  <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
-                  <attribute name="Class-Path"               value="@{classpath}"/>
-               </manifest>
-               <filesets/>
-            </jar>
-         </rar>
-
-         <!-- Create a war archive
-              Jars the inputs of the war artifact
-         -->
-         <war null="@{manifest}">
-            <mkdir dir="@{parentDir}"/>
-            <jar destfile="@{output}">
-               <manifest>
-                  <attribute name="Created-by"               value="@{component.VMVersion} @{component.VMVendor}"/>
-                  <attribute name="Specification-Title"      value="@{component.specTitle}"/>
-                  <attribute name="Specification-Version"    value="@{component.specVersion}"/>
-                  <attribute name="Specification-Vendor"     value="@{component.specVendor}"/>
-                  <attribute name="Implementation-Title"     value="@{component.implTitle}"/>
-                  <attribute name="Implementation-URL"       value="@{component.implURL}"/>
-                  <attribute name="Implementation-Version"   value="@{component.implVersion}"/>
-                  <attribute name="Implementation-Vendor"    value="@{component.implVendor}"/>
-                  <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
-                  <attribute name="Class-Path"               value="@{classpath}"/>
-               </manifest>
-               <filesets/>
-            </jar>
-         </war>
-         
-         <!-- Create a deployer archive
-              Jars the inputs of the war artifact
-         -->
-         <deployer null="@{manifest}" if="@{buildable}">
-            <mkdir dir="@{parentDir}"/>
-            <jar destfile="@{output}">
-               <manifest>
-                  <attribute name="Created-by" value="@{component.VMVersion} @{component.VMVendor}"/>
-                  <attribute name="Specification-Title" value="@{component.specTitle}"/>
-                  <attribute name="Specification-Version" value="@{component.specVersion}"/>
-                  <attribute name="Specification-Vendor" value="@{component.specVendor}"/>
-                  <attribute name="Implementation-Title" value="@{component.implTitle}"/>
-                  <attribute name="Implementation-URL" value="@{component.implURL}"/>
-                  <attribute name="Implementation-Version" value="@{component.implVersion}"/>
-                  <attribute name="Implementation-Vendor" value="@{component.implVendor}"/>
-                  <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
-                  <attribute name="Class-Path" value="@{classpath}"/>
-               </manifest>
-               <filesets/>
-            </jar>
-         </deployer>       
-         
-         <!-- Create a md5 checksumarchive  -->
-         <md5 null="@{manifest}">
-            <mkdir dir="@{parentDir}"/>
-            <checksum>
-              <filesets/>
-            </checksum>
-         </md5>         
-         
-         <!-- create a directory and copy into it all of the filesets or zipfilesets -->
-         <dir if="@{buildable}">
-            <mkdir dir="@{output}"/>
-            <copy-zfs todir="@{output}">
-               <filesets/>
-            </copy-zfs>
-         </dir>
-         
-         
-         <!-- this is a hack.  jbbuild will not allow artifacts with same id
-            varia requires a dir to be created called kernel, but cannot be created
-            because kernel already exists as a component.  Only option is to create the dir
-            and rename it to kernel -->
-         <dir if="@{buildable}" when="@{rename}">
-            <mkdir dir="@{parentDir}/@{rename}"/>
-            <copy-zfs todir="@{parentDir}/@{rename}">
-               <filesets/>
-            </copy-zfs>
-         </dir>     
-      
-         <!-- copying of artifacts to new name -->         
-         <artifactdef when="@{toname}">
-            <mkdir dir="@{parentDir}"/>
-            <copy toFile="@{parentDir}/@{toname}">
-               <filesets/>
-            </copy>
-         </artifactdef>
-         
-         <sh depends="build.bin"/>
-         <bat depends="build.bin"/>
-      </targetdef>
-
-      <!-- Copy the etc -->
-      <targetdef target="build.etc">
-
-         <component>
-              
-            <mkdir dir="@{output}/etc"/>
-            <mkdir dir="@{component.dir}/src/etc/"/>
-            <copy todir="@{output}/etc" filtering="yes">
-               
-               <fileset dir="@{component.dir}/src/etc/" includes="**"/>
-               <filterset>
-                  <filter token="java.vm.version"           value="@{component.VMVersion}"/>
-                  <filter token="java.vm.vendor"            value="@{component.VMVendor}"/>
-                  <filter token="specification.title"       value="@{component.specTitle}"/>
-                  <filter token="specification.version"     value="@{component.specVersion}"/>
-                  <filter token="specification.vendor"      value="@{component.specVendor}"/>
-                  <filter token="implementation.title"      value="@{component.implTitle}"/>
-                  <filter token="implementation.url"        value="@{component.implURL}"/>
-                  <filter token="implementation.version"    value="@{component.implVersion}"/>
-                  <filter token="implementation.vendor"     value="@{component.implVendor}"/>
-                  <filter token="implementation.vendor.id"  value="@{component.implURL}"/>
-               </filterset>
-            </copy>
-         </component>
-
-      </targetdef>
-
-      <targetdef target="build.resources">
-     
-         <component>
-            <mkdir dir="@{output}/resources"/>
-            <copy todir="@{output}" filtering="yes">
-               <fileset dir="@{component.dir}/src" includes="resources/**"/>
-            </copy>
-         </component>
-      </targetdef>
-      
-
-
-      <targetdef target="build.bin">
-         <component>
-            <mkdir dir="@{output}/bin"/>
-            <copy todir="@{output}/bin" filtering="yes">
-              <fileset dir="@{component.dir}/src/bin">
-                <include name="**/*"/>
-              </fileset>
-            </copy>
-
-            <fixcrlf srcdir="@{output}/bin"
-              eol="lf" eof="remove"
-              includes="**/*.sh"/>
-
-            <fixcrlf srcdir="@{output}/bin"
-              eol="crlf" eof="remove"
-              includes="**/*.bat, **/*.cmd"/>
-
-            <chmod perm="+x">
-              <fileset dir="@{output}/bin">
-                <include name="**/*.sh"/>
-              </fileset>
-            </chmod>
-
-         </component>
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!-- Release                                                      -->
-      <!-- Create the release by copying all artifacts that have a      -->
-      <!-- release tag to that specified location.                      -->
-      <!-- ============================================================ -->
-
-      <targetdef target="release">
-      
-
-          <!-- Copy the artifact into the release -->
-         <artifact when="@{tofile}">
-             <copy-release release="@{release}" tofile="@{tofile}" requiredJDK="@{requiredJDK}"
-             exploded="@{exploded}" overwrite="@{overwrite}">
-                <output/>
-             </copy-release>
-         </artifact>
-         
-       <artifact null="@{tofile}" when="@{release}" >
-            <copy-release release="@{release}"
-              exploded="@{exploded}"
-              requiredJDK="@{requiredJDK}"
-              overwrite="@{overwrite}"
-              >
-               <output/>
-            </copy-release>
-         </artifact>         
-
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!-- Publish                                                      -->
-      <!-- Copy an artifact to the location specified by                -->
-      <!-- ${jbossbuild.repository.root}                                -->
-      <!-- Used by the continous build to publish to the repository.    -->
-      <!-- ============================================================ -->
-
-      <targetdef target="publish" if="@{local}">
-
-         <!-- copy the component-info.xml into the repository -->
-         <componentmain if="@{local}">
-            <fail unless="repository.root">
-              The publish target requires repository.root to be set.
-            </fail>
-            <mkdir dir="${repository.root}/@{relativePath}"/>
-            <copy failonerror="false" file="@{dir}/${jbossbuild.component.info}"
-                  todir="${repository.root}/@{relativePath}"
-            />
-
-         </componentmain>
-
-         <!-- Copy the artifact into the release -->
-         <artifact if="@{component.local}">
-            <fail unless="repository.root">
-              The publish target requires repository.root to be set.
-            </fail>
-            <mkdir dir="${repository.root}/@{relativePath}"/>
-            <copy todir="${repository.root}/@{relativePath}">
-               <output/>
-            </copy>
-         </artifact>
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!-- Archives                                                     -->
-      <!-- Builds the release archive(s)                                -->
-      <!-- ============================================================ -->
-
-      <!-- Build the release archives -->
-      <targetdef target="archives" description="Build the release archives">
-
-         <!-- Make the archives -->
-         <main>
-         
-            <!-- Create the zip file -->
-            <zip destfile="@{output}/@{releaseName}.zip"
-                 basedir="@{releaseDir}"
-            />
-         </main>
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!-- Doc                                                          -->
-      <!-- Creates the documentation.                                   -->
-      <!-- ============================================================ -->
-
-      <targetdef target="doc" description="Documentation">
-
-         <!-- Generate the documentation -->
-         <component depends="api"/>
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!-- API                                                          -->
-      <!-- Creates the javadoc                                          -->
-      <!-- ============================================================ -->
-
-      <targetdef target="api" description="Javadoc">
-
-         <!-- Generate the javadoc -->
-         <component/>
-         <api>
-            <mkdir dir="@{output}"/>
-            <javadoc packagenames="*"
-                     destdir="@{output}"
-            >
-               <doctitle>
-                  <![CDATA[<h1>@{description} API Documentation</h1>]]>
-               </doctitle>
-               <bottom>
-                  <![CDATA[
-                     <i>
-                        <div align="center">
-                           <font size="-1">
-                              Copyright &#169; 2005 JBoss Inc. All Rights Reservered.
-                           </font>
-                        </div>
-                     </i>
-                  ]]>
-               </bottom>
-               <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
-               <sourcepath>
-                  <sourcepaths/>
-               </sourcepath>
-               <classpath>
-                  <sourcepathelements/>
-               </classpath>
-            </javadoc>
-         </api>
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!-- Clean                                                        -->
-      <!-- Deletes the output folder                                    -->
-      <!-- ============================================================ -->
-
-      <targetdef target="clean" description="Clean">
-         <common>
-            <delete dir="@{output}" failonerror="false"/>
-         </common>
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!-- Clobber                                                      -->
-      <!-- Deletes the output folder and removes thirdparty             -->
-      <!-- ============================================================ -->
-
-      <targetdef target="clobber" description="Clobber">
-         <main depends="clean">
-            <delete dir="@{thirdparty}"/>
-         </main>
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!-- Synchronize                                                  -->
-      <!-- Resynchronizes the project with cvs                          -->
-      <!-- ============================================================ -->
-
-      <targetdef target="synchronize" description="Synchronize">
-
-         <!-- Update the main build folder and tools from cvs
-              then do the same for the components before running
-              the after synchronization processing
-              NOTE: Does not automatically invoke component builds
-              as the list of components maybe out-of-date at this point
-              and we need to conditionally do cvs co/update
-         -->
-         <main components="none">
-            <!-- cvs command="update -dP" failonerror="true"/-->
-            <!--invoke target="synchronize" dir="../tools"/-->
-            <execute-target target="synchronize.components" />
-            <!-- execant target="synchronize.after.main"/-->
-         </main>
-
-         <componentmain unless="@{local}">
-            <mkdir dir="@{thirdpartyDir}"/>
-            <get src="@{location}/${jbossbuild.component.info}"
-                 dest="@{thirdpartyDir}/${jbossbuild.component.info}"
-                 useTimestamp="false"
-                 verbose="true"
-            />
-         </componentmain>
-
-         <!-- If the component exists we just do a cvs update -->
-         <componentmain if="@{exists}">
-           <cvs dest="@{dir}" command="update"/>
-            <!-- NOTE: unable to delegate to component until JBBUILD-62 is resolved -->
-            <!--invoke target="synchronize" dir="@{dir}"/--> 
-            <!--execant target="synchronize.after" dir="@{dir}"/--> 
-         </componentmain>
-
-         <!-- If the component doesn't exist and we want to
-              get the source build check it out from cvs
-         -->
-         <componentmain unless="@{exists}" if="@{local}">
-            <cvs dest="@{dir.parent}">
-               <commandline>
-                  <argument value="-d"/>
-                  <argument value="@{build.cvsroot}"/>
-                  <argument value="co"/>
-                  <argument value="-d"/>
-                  <argument value="@{id}"/>
-                  <argument value="@{module}"/>
-               </commandline>
-            </cvs>
-            <!-- execant target="synchronize.after" dir="@{dir}"/--> 
-         </componentmain>
-
-         <!-- The component already exists do a cvs update
-              and run the after synchronization
-         -->
-         <component nomain="true">
-            <cvs command="update -dP" failonerror="true"/>
-            <!--execant target="synchronize.after"/-->
-         </component>
-
-         <!-- If we are not doing a source checkout of this
-              component, download the artifacts to thirdparty
-         -->
-         <artifact unless="@{component.local}">
-            <mkdir dir="@{parentDir}"/>
-            <get src="@{location}" 
-                 dest="@{output}" 
-                 useTimestamp="false"
-                 verbose="true"
-            />
-         </artifact>
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!-- Commit                                                       -->
-      <!-- Commits the changes to cvs                                   -->
-      <!-- ============================================================ -->
-
-      <targetdef target="commit" description="Commit">
-         <!-- Commit the main build and tools -->
-         <main>
-            <fail message="Use -Dm=&quot;xxx&quot; to specify the commit message" unless="m"/>
-            <cvs failonerror="true">
-               <commandline>
-                  <argument value="commit"/>
-                  <argument value="-m"/>
-                  <argument value="${m}"/>
-               </commandline>
-            </cvs>
-            <invoke target="commit" dir="../tools"/>
-         </main>
-         <!-- Commit the component -->
-         <component>
-            <fail message="Use -Dm=&quot;xxx&quot; to specify the commit message" unless="m"/>
-            <cvs failonerror="true">
-               <commandline>
-                  <argument value="commit"/>
-                  <argument value="-m"/>
-                  <argument value="${m}"/>
-               </commandline>
-            </cvs>
-         </component>
-      </targetdef>
-      
-      <!-- ============================================================ -->
-      <!-- Test                                                         -->
-      <!-- Builds and runs the tests                                    -->
-      <!-- ============================================================ -->
-
-      <targetdef target="test" description="Build and run the tests">
-         <component depends="build, runtest"/>
-      </targetdef>
-      
-      <!-- ============================================================ -->
-      <!-- RunTest                                                      -->
-      <!-- Runs the tests for sources marked with a test attribute      -->
-      <!-- ============================================================ -->
-      
-      <!-- Run the Test -->
-      <targetdef target="runtest" description="Run tests">
-         <component/>
-         <source when="@{test}">
-            <mkdir dir="@{testDir}"/>
-            <delete file="@{testDir}/test.log"/>
-            <junit fork="true"
-                   printSummary="true">
-               <sysproperty key="org.jboss.test.logfile" value="@{testDir}/test.log"/>
-               <formatter type="plain"/>
-               <classpath>
-                  <pathElements/>
-               </classpath>
-               <batchtest todir="@{testDir}">
-                  <fileset dir="@{sourceDir}" includes="@{test}"/>
-               </batchtest>
-            </junit>
-         </source>
-      </targetdef>
-      
-      <!-- ============================================================ -->
-      <!-- Rebuild                                                      -->
-      <!-- Synchronizes then builds                                     -->
-      <!-- ============================================================ -->
-      
-      <!-- Rebuild -->
-      <targetdef target="rebuild" description="Synchronize then build">
-         <common depends="synchronize">
-            <execant target="build"/>
-         </common>
-      </targetdef>
-      
-      <!-- ============================================================ -->
-      <!-- RebuildAll                                                   -->
-      <!-- Synchronizes then builds all                                 -->
-      <!-- ============================================================ -->
-      
-      <!-- Rebuild all -->
-      <targetdef target="rebuildall" description="Synchronize then build all">
-         <common depends="synchronize">
-            <execant target="all"/>
-         </common>
-      </targetdef>
-
-      <!-- ============================================================ -->
-      <!-- Synchronize.After                                            -->
-      <!-- After synchronization processing                             -->
-      <!-- ============================================================ -->
-
-      <!-- After synchronization processing -->
-      <targetdef target="synchronize.after" description="After synchronization processing">
-              <main>
-                 <idemain/>
-              </main>
-              <component>
-                 <idecomponent/>
-              </component>
-      </targetdef>
-      
-
-      
- </targets>   
-
-<!-- ================================================================== -->
-<!-- Macro Definitions                                                  -->
-<!-- ================================================================== -->
-
-   <condition property="execant-executable" value="cmd.exe">
-     <os family="windows"/>
-   </condition>
-   <property name="execant-executable" value="ant"/>
-   <condition property="execant-prefix" value="/c ant">
-     <os family="windows"/>
-   </condition>
-   <property name="execant-prefix" value=""/>
-   <!-- Set the execant.args to empty unless it already exists -->
-   <condition property="execant.args" value="">
-      <not><isset property="execant.args"/></not>
-   </condition>
-
-   <!-- The execant macro -->
-   <macrodef name="execant">
-      <attribute name="dir"
-                 default="${basedir}"
-                 description="The directory"
-      />
-      <attribute name="target"
-                 description="The target"
-      />
-      <attribute name="filename"
-                 default="jbossbuild.xml"
-                 description="The ant file to execute"
-      />
-      <sequential>
-         <!-- Invoke using a new ant -->
-         <exec dir="@{dir}" 
-               executable="${execant-executable}"
-         >
-            <arg line="${execant-prefix} ${execant.args} -f @{filename} @{target}"/>
-         </exec>
-      </sequential>
-   </macrodef>
-
-   <!-- The invoke macro -->
-   <macrodef name="invoke">
-      <attribute name="dir"
-                 default="${basedir}"
-                 description="The directory"
-      />
-      <attribute name="target"
-                 description="The target"
-      />
-      <sequential>
-         <!-- Invoke using a new ant -->
-         <ant antfile="jbossbuild.xml" dir="@{dir}" target="@{target}"/>
-      </sequential>
-   </macrodef>
-
-<!-- ================================================================== -->
-<!-- Targets                                                            -->
-<!-- ================================================================== -->
-
-   <target name="help-fragment">
-      <fail message="Do not execute this build fragment directly!"/>
-   </target>
-   
-</project>
-
+<?xml version="1.0"?>
+
+<!--
+ JBoss, the OpenSource J2EE webOS
+ 
+ Distributable under LGPL license.
+ See terms of license at gnu.org.
+-->
+<project name="jboss.ant.tasks"
+         default="help-fragment"
+>
+<!-- ================================================================== -->
+<!-- Properties                                                         -->
+<!-- ================================================================== -->
+
+   <!-- because this file may be imported from various locations
+     locations must be referenced in an absolute fashion   -->
+   <dirname property="imported.basedir" file="${ant.file.jboss.ant.tasks}"/>
+
+
+   <property file="${imported.basedir}/jbossbuild.properties"/>
+
+   <property name="jboss.tasks.path" 
+      value="${imported.basedir}/../../../tools/lib/jbossbuild.jar"   />
+
+   <!-- items required for javcc task --> 
+   <property name="sun.javacc.lib"
+      value="${imported.basedir}/../../../${jbossbuild.thirdparty.dir}/sun-javacc/lib/"/>
+             
+   <property name="jacorb.root"
+      value="${imported.basedir}/../../../${jbossbuild.thirdparty.dir}/jacorb"/> 
+
+   <property name="apache.logkit.lib"
+      value="${imported.basedir}/../../../${jbossbuild.thirdparty.dir}/apache-avalon-logkit/lib"/>              
+
+      
+    <path id="jacorb.idl.classpath">
+       <pathelement path="${jacorb.root}/lib/idl.jar"/>
+       <pathelement path="${apache.logkit.lib}/logkit.jar"/>
+    </path>
+
+
+<!-- ================================================================== -->
+<!-- Type Definitions                                                   -->
+<!-- ================================================================== -->
+
+   <!-- The generate type -->
+   <typedef name="generate"
+            classname="org.jboss.ant.types.Generate" 
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />
+
+   <!-- The build type -->
+   <typedef name="build"
+            classname="org.jboss.ant.types.build.Build" 
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />
+
+   <!-- The artifact type definition type -->
+   <typedef name="artifacttype"
+            classname="org.jboss.ant.types.build.ArtifactType" 
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />
+
+   <!-- The component definition type -->
+   <typedef name="componentdef"
+            classname="org.jboss.ant.types.component.ComponentDefinition" 
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />
+
+   <!-- The component type -->
+   <typedef name="component"
+            classname="org.jboss.ant.types.build.Component" 
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />
+
+   <!-- The includes type -->
+   <typedef name="includes"
+            classname="org.jboss.ant.types.Includes" 
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />
+
+   <!-- The build targets type -->
+   <typedef name="targets"
+            classname="org.jboss.ant.types.target.TargetDefinitions" 
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />
+
+<!-- ================================================================== -->
+<!-- Task Definitions                                                   -->
+<!-- ================================================================== -->
+
+   <!-- Update ide info for the main build -->
+   <taskdef name="idemain"
+            classname="org.jboss.ant.tasks.build.IDETask"
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />
+
+   <!-- Update ide info for the component -->
+   <taskdef name="idecomponent"
+            classname="org.jboss.ant.tasks.component.IDETask"
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />
+   
+   <!-- Generate a componentref graph and resolve the dependencies -->
+   <taskdef name="synchronizeinfo"
+            classname="org.jboss.ant.tasks.build.SynchronizeComponentsTask"
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />
+   
+   <!-- A task which allows a visitor to visit the graph -->
+   <taskdef name="visit-componentref-graph"
+            classname="org.jboss.ant.tasks.build.VisitComponentRefGraphTask"
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />   
+   
+   <!-- Generate libraries.ent with version number in paths -->
+   <taskdef name="gen-lib-file"
+            classname="org.jboss.ant.tasks.build.GenerateLibrariesFile"
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />  
+     
+   <!-- RMIC compilation logic -->
+   <taskdef name="rmic-helper"
+            classname="org.jboss.ant.tasks.build.RMICHelper"
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />     
+
+   <!-- Executes a given target without reparsing the project file -->
+   <taskdef name="execute-target"
+            classname="org.jboss.ant.tasks.build.TargetExecutor"
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   /> 
+  
+   <!-- Copy with support for zipfile sets -->
+   <taskdef name="copy-zfs"
+            classname="org.jboss.ant.tasks.build.CopyWithZipFileSetSupport"
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   /> 
+   
+   <!-- File release task -->
+   <taskdef name="copy-release"
+            classname="org.jboss.ant.tasks.build.CopyRelease"
+            loaderRef="jboss.tasks.path"
+            classpath="${jboss.tasks.path}"
+   />  
+   
+  
+   
+
+   
+
+<!-- ================================================================== -->
+<!-- Artifact Definitions                                               -->
+<!-- ================================================================== -->
+
+   <artifacttype type="jar" outputtype="lib"/>
+   <artifacttype type="zip" outputtype="lib"/>
+   <artifacttype type="sar" outputtype="lib"/>
+   <artifacttype type="rar" outputtype="lib"/>
+   <artifacttype type="war" outputtype="lib"/>
+   <artifacttype type="deployer" outputtype="lib"/>   
+   <artifacttype type="api" outputtype="api"/>
+   <artifacttype type="xml" outputtype="resource"/>
+   <artifacttype type="policy" outputtype="resource"/>
+   <artifacttype type="properties" outputtype="resource"/>
+   <artifacttype type="sh" outputtype="bin"/>
+   <artifacttype type="bat" outputtype="bin"/>
+   <artifacttype type="conf" outputtype="bin"/>
+   <artifacttype type="dtd" outputtype="dtd"/>
+   <artifacttype type="xsd" outputtype="schema"/>
+   <artifacttype type="aop" outputtype="resource"/>
+   <artifacttype type="idl" outputtype="resource"/>   
+   <artifacttype type="md5" outputtype="bin"/>      
+   <artifacttype type="dir" outputtype="lib"/>
+   <artifacttype type="ddl" outputtype="resource"/>
+   
+<!-- ================================================================== -->
+<!-- Target Definitions                                                 -->
+<!-- ================================================================== -->
+
+   <targets id="targets">
+
+      <!-- ============================================================ -->
+      <!-- Build All                                                    -->
+      <!-- Builds everything (build, docs, tests and release archives)  -->
+      <!-- ============================================================ -->
+
+      <targetdef target="all" description="Build All">
+         <main depends="build, doc, test, archives" components="none"/>
+         <component depends="build, doc, test"/>
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!--  Init                                                        -->
+      <!--  Basic initilization tasks and property setup                -->
+      <!-- ============================================================ -->      
+      <targetdef target="build.init" description="initilization tasks and property setup">
+
+         <!-- for each componentdef in jbossbuild file, setup properties 
+              in case a use wishes to access them    
+         -->
+         <component>
+            <property name="build.module" value="@{parentDir}"/>
+            <property name="build.module.src" value="${build.module}/src"/>
+            <property name="build.module.resources" value="${build.module}/src/resources"/>
+            <property name="build.module.etc" value="${build.module}/src/etc"/>
+            <property name="build.module.output" value="@{output}"/>
+            <property name="build.module.output.gen-src" value="${build.module.output}/gen-src"/>            
+            <property name="build.module.dir" value="@{output}"/>
+            <property name="build.module.output.resources" value="${build.module.output}/resources"/>                        
+            <property name="build.module.output.lib" value="${build.module.output}/lib"/>                                    
+            <property name="build.module.output.classes" value="${build.module.output}/classes"/> 
+         </component>
+      </targetdef>      
+
+      <!-- ============================================================ -->
+      <!-- Build                                                        -->
+      <!-- Builds the artifacts and compiles all source                 -->
+      <!-- ============================================================ -->
+
+      <targetdef target="build" description="Build" >
+
+         <!-- Build the main release
+              Creates the main release directory and copies artifacts
+              to the specified location
+         -->
+         <main>
+            <mkdir dir="@{releaseDir}"/>
+            <antCall target="release"/>
+         </main>
+
+
+         <!-- 
+         Build the component
+              Just makes the output folder
+         -->         
+         <component depends="build.init, build.etc">
+            <mkdir dir="@{output}/etc"/>
+            <copy todir="@{output}/etc" filtering="yes">
+               <fileset dir="@{component.dir}/src/etc/" includes="**"/>
+            </copy>
+         </component>
+
+         <!-- Build resources if the component has a 
+              resource node -->
+         <resource depends="build.resources"/>
+         
+         <!-- JTREE-JAVACC source generation  -->
+         <generatedsource when="@{jtree-javacc}">
+
+            <dirname file="/@{jtree-javacc}" property="@{id}.path"/>
+            <property name="@{id}.output.path" value="@{output}/${@{id}.path}"/>
+
+            <mkdir dir="${@{id}.output.path}"/>
+            <jjtree
+               target="src/@{srcdir}/@{jtree-javacc}"
+               outputdirectory="${@{id}.output.path}"
+               javacchome="${sun.javacc.lib}"/>
+
+            <basename file="@{jtree-javacc}" 
+               property="@{id}.basename"
+               suffix="jjt"/>
+
+            <javacc
+               target="${@{id}.output.path}/${@{id}.basename}.jj"
+               javacchome="${sun.javacc.lib}"/>
+
+         </generatedsource>
+
+         <!-- JAVACC source generation -->
+         <generatedsource when="@{javacc}">
+
+            <dirname file="/@{javacc}" property="@{id}.path"/>
+            <property name="@{id}.output.path" value="@{output}/${@{id}.path}"/>
+
+            <mkdir dir="${@{id}.output.path}"/>
+
+            <javacc
+               target="src/@{srcdir}/@{javacc}"
+               javacchome="${sun.javacc.lib}"
+               static="@{static}"
+               outputdirectory="${@{id}.output.path}"/>
+
+         </generatedsource>
+
+         <!-- IDL compilation -->         
+         <generatedsource when="@{idl}">
+
+            <!-- Task to compile idl files required by jacorb -->
+            <taskdef name="jacidl"
+               classname="org.jacorb.idl.JacIDL"
+               classpathref="jacorb.idl.classpath"
+            />             
+            
+            <property name="@{id}.output.path" value="@{output}/@{id}"/>
+
+            <mkdir dir="${@{id}.output.path}"/>
+
+            <jacidl
+               srcdir ="src/@{idl}"
+               destdir="${@{id}.output.path}"
+               includes="*.idl"
+               includepath="${jacorb.root}/resources/"
+             />
+         
+         </generatedsource> 
+         
+ 
+         <!-- Compile the source
+              Runs depend on the source output then compiles the source
+         -->
+         <source if="@{compileable}">
+             
+            <mkdir dir="@{output}"/>
+            <depend srcdir="@{sourcePath}"
+                    destdir="@{output}"
+            >
+               <classpath>
+                  <buildpathelements/>
+               </classpath>
+            </depend>
+            <javac srcdir="@{sourcePath}" 
+                   destdir="@{output}"
+                   debug="true"
+                   deprecation="true"
+                   excludes="@{excludes}"
+                   target="@{jvmTarget}"
+                   source="@{jvmSource}"
+                   fork="true"
+                   memoryMaximumSize="512M"
+            >
+               <classpath>
+                  <buildpathelements/>
+               </classpath>
+               <src path="@{sourcePath}"/>
+               <!-- allow multiple sources to be compiled at once to handle circular references -->
+               <srcelements/>
+            </javac>
+
+           <copy toDir="@{output}">
+               <fileset dir="@{sourcePath}">
+                <include name="**/*.properties"/>
+              </fileset>
+           </copy>
+         </source>
+         
+        <source when="@{stubversion}">
+	    <property name="jb.stubversion" value="@{stubversion}"/>
+        </source>         
+         
+
+         <!-- Remote method call compilation.   -->
+         <source when="@{rmic}">
+            <rmic-helper
+                  base="@{output}"
+                  includes="@{rmic}"
+                  verify="true"
+                  debug="false"
+                  iiop="@{iiop}"
+                  idl="false"
+                  external="@{external}"
+                  stubversion="${jb.stubversion}"
+                  
+            >
+               <classpath>
+                  <buildpathelements/>
+               </classpath>
+               </rmic-helper>
+         </source>
+
+         <!-- Create a jar archive
+              Jars the inputs of the jar artifact
+         -->
+         <jar null="@{manifest}" if="@{buildable}">
+            <mkdir dir="@{parentDir}"/>
+            <jar destfile="@{output}">
+               <manifest>
+                  <attribute name="Created-by"               value="@{component.VMVersion} @{component.VMVendor}"/>
+                  <attribute name="Specification-Title"      value="@{component.specTitle}"/>
+                  <attribute name="Specification-Version"    value="@{component.specVersion}"/>
+                  <attribute name="Specification-Vendor"     value="@{component.specVendor}"/>
+                  <attribute name="Implementation-Title"     value="@{component.implTitle}"/>
+                  <attribute name="Implementation-URL"       value="@{component.implURL}"/>
+                  <attribute name="Implementation-Version"   value="@{component.implVersion}"/>
+                  <attribute name="Implementation-Vendor"    value="@{component.implVendor}"/>
+                  <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
+                  <attribute name="Class-Path"               value="@{classpath}"/>
+               </manifest>
+               <filesets/>
+            </jar>
+         </jar>
+
+         <!-- Create an aop archive
+              Jars the inputs of the aop artifact
+         -->
+         <aop  if="@{buildable}">
+            <mkdir dir="@{parentDir}"/>
+            <jar destfile="@{output}">
+                <filesets/>
+            </jar>
+         </aop>         
+
+         <jar when="@{manifest}" if="@{buildable}">
+            <mkdir dir="@{parentDir}"/>
+            <jar destfile="@{output}"
+                 manifest="@{component.output}/etc/manifest/@{manifest}">
+               <filesets/>
+            </jar>
+         </jar>
+         
+         
+
+         <!-- Create a sar archive
+              Jars the inputs of the sar artifact
+         -->
+         <sar null="@{manifest}">
+            <mkdir dir="@{parentDir}"/>
+            <jar destfile="@{output}">
+               <manifest>
+                  <attribute name="Created-by"               value="@{component.VMVersion} @{component.VMVendor}"/>
+                  <attribute name="Specification-Title"      value="@{component.specTitle}"/>
+                  <attribute name="Specification-Version"    value="@{component.specVersion}"/>
+                  <attribute name="Specification-Vendor"     value="@{component.specVendor}"/>
+                  <attribute name="Implementation-Title"     value="@{component.implTitle}"/>
+                  <attribute name="Implementation-URL"       value="@{component.implURL}"/>
+                  <attribute name="Implementation-Version"   value="@{component.implVersion}"/>
+                  <attribute name="Implementation-Vendor"    value="@{component.implVendor}"/>
+                  <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
+                  <attribute name="Class-Path"               value="@{classpath}"/>
+               </manifest>
+               <filesets/>
+            </jar>
+         </sar>
+
+
+         <!-- Create a rar archive
+              Jars the inputs of the rar artifact
+         -->
+         <rar null="@{manifest}">
+            <mkdir dir="@{parentDir}"/>
+            <jar destfile="@{output}">
+               <manifest>
+                  <attribute name="Created-by"               value="@{component.VMVersion} @{component.VMVendor}"/>
+                  <attribute name="Specification-Title"      value="@{component.specTitle}"/>
+                  <attribute name="Specification-Version"    value="@{component.specVersion}"/>
+                  <attribute name="Specification-Vendor"     value="@{component.specVendor}"/>
+                  <attribute name="Implementation-Title"     value="@{component.implTitle}"/>
+                  <attribute name="Implementation-URL"       value="@{component.implURL}"/>
+                  <attribute name="Implementation-Version"   value="@{component.implVersion}"/>
+                  <attribute name="Implementation-Vendor"    value="@{component.implVendor}"/>
+                  <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
+                  <attribute name="Class-Path"               value="@{classpath}"/>
+               </manifest>
+               <filesets/>
+            </jar>
+         </rar>
+
+         <!-- Create a war archive
+              Jars the inputs of the war artifact
+         -->
+         <war null="@{manifest}">
+            <mkdir dir="@{parentDir}"/>
+            <jar destfile="@{output}">
+               <manifest>
+                  <attribute name="Created-by"               value="@{component.VMVersion} @{component.VMVendor}"/>
+                  <attribute name="Specification-Title"      value="@{component.specTitle}"/>
+                  <attribute name="Specification-Version"    value="@{component.specVersion}"/>
+                  <attribute name="Specification-Vendor"     value="@{component.specVendor}"/>
+                  <attribute name="Implementation-Title"     value="@{component.implTitle}"/>
+                  <attribute name="Implementation-URL"       value="@{component.implURL}"/>
+                  <attribute name="Implementation-Version"   value="@{component.implVersion}"/>
+                  <attribute name="Implementation-Vendor"    value="@{component.implVendor}"/>
+                  <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
+                  <attribute name="Class-Path"               value="@{classpath}"/>
+               </manifest>
+               <filesets/>
+            </jar>
+         </war>
+         
+         <!-- Create a deployer archive
+              Jars the inputs of the war artifact
+         -->
+         <deployer null="@{manifest}" if="@{buildable}">
+            <mkdir dir="@{parentDir}"/>
+            <jar destfile="@{output}">
+               <manifest>
+                  <attribute name="Created-by" value="@{component.VMVersion} @{component.VMVendor}"/>
+                  <attribute name="Specification-Title" value="@{component.specTitle}"/>
+                  <attribute name="Specification-Version" value="@{component.specVersion}"/>
+                  <attribute name="Specification-Vendor" value="@{component.specVendor}"/>
+                  <attribute name="Implementation-Title" value="@{component.implTitle}"/>
+                  <attribute name="Implementation-URL" value="@{component.implURL}"/>
+                  <attribute name="Implementation-Version" value="@{component.implVersion}"/>
+                  <attribute name="Implementation-Vendor" value="@{component.implVendor}"/>
+                  <attribute name="Implementation-Vendor-Id" value="@{component.implURL}"/>
+                  <attribute name="Class-Path" value="@{classpath}"/>
+               </manifest>
+               <filesets/>
+            </jar>
+         </deployer>       
+         
+         <!-- Create a md5 checksumarchive  -->
+         <md5 null="@{manifest}">
+            <mkdir dir="@{parentDir}"/>
+            <checksum>
+              <filesets/>
+            </checksum>
+         </md5>         
+         
+         <!-- create a directory and copy into it all of the filesets or zipfilesets -->
+         <dir if="@{buildable}">
+            <mkdir dir="@{output}"/>
+            <copy-zfs todir="@{output}">
+               <filesets/>
+            </copy-zfs>
+         </dir>
+         
+         
+         <!-- this is a hack.  jbbuild will not allow artifacts with same id
+            varia requires a dir to be created called kernel, but cannot be created
+            because kernel already exists as a component.  Only option is to create the dir
+            and rename it to kernel -->
+         <dir if="@{buildable}" when="@{rename}">
+            <mkdir dir="@{parentDir}/@{rename}"/>
+            <copy-zfs todir="@{parentDir}/@{rename}">
+               <filesets/>
+            </copy-zfs>
+         </dir>     
+      
+         <!-- copying of artifacts to new name -->         
+         <artifactdef when="@{toname}">
+            <mkdir dir="@{parentDir}"/>
+            <copy toFile="@{parentDir}/@{toname}">
+               <filesets/>
+            </copy>
+         </artifactdef>
+         
+         <sh depends="build.bin"/>
+         <bat depends="build.bin"/>
+      </targetdef>
+
+      <!-- Copy the etc -->
+      <targetdef target="build.etc">
+
+         <component>
+              
+            <mkdir dir="@{output}/etc"/>
+            <mkdir dir="@{component.dir}/src/etc/"/>
+            <copy todir="@{output}/etc" filtering="yes">
+               
+               <fileset dir="@{component.dir}/src/etc/" includes="**"/>
+               <filterset>
+                  <filter token="java.vm.version"           value="@{component.VMVersion}"/>
+                  <filter token="java.vm.vendor"            value="@{component.VMVendor}"/>
+                  <filter token="specification.title"       value="@{component.specTitle}"/>
+                  <filter token="specification.version"     value="@{component.specVersion}"/>
+                  <filter token="specification.vendor"      value="@{component.specVendor}"/>
+                  <filter token="implementation.title"      value="@{component.implTitle}"/>
+                  <filter token="implementation.url"        value="@{component.implURL}"/>
+                  <filter token="implementation.version"    value="@{component.implVersion}"/>
+                  <filter token="implementation.vendor"     value="@{component.implVendor}"/>
+                  <filter token="implementation.vendor.id"  value="@{component.implURL}"/>
+               </filterset>
+            </copy>
+         </component>
+
+      </targetdef>
+
+      <targetdef target="build.resources">
+     
+         <component>
+            <mkdir dir="@{output}/resources"/>
+            <copy todir="@{output}" filtering="yes">
+               <fileset dir="@{component.dir}/src" includes="resources/**"/>
+            </copy>
+         </component>
+      </targetdef>
+      
+
+
+      <targetdef target="build.bin">
+         <component>
+            <mkdir dir="@{output}/bin"/>
+            <copy todir="@{output}/bin" filtering="yes">
+              <fileset dir="@{component.dir}/src/bin">
+                <include name="**/*"/>
+              </fileset>
+            </copy>
+
+            <fixcrlf srcdir="@{output}/bin"
+              eol="lf" eof="remove"
+              includes="**/*.sh"/>
+
+            <fixcrlf srcdir="@{output}/bin"
+              eol="crlf" eof="remove"
+              includes="**/*.bat, **/*.cmd"/>
+
+            <chmod perm="+x">
+              <fileset dir="@{output}/bin">
+                <include name="**/*.sh"/>
+              </fileset>
+            </chmod>
+
+         </component>
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!-- Release                                                      -->
+      <!-- Create the release by copying all artifacts that have a      -->
+      <!-- release tag to that specified location.                      -->
+      <!-- ============================================================ -->
+
+      <targetdef target="release">
+      
+
+          <!-- Copy the artifact into the release -->
+         <artifact when="@{tofile}">
+             <copy-release release="@{release}" tofile="@{tofile}" requiredJDK="@{requiredJDK}"
+             exploded="@{exploded}" overwrite="@{overwrite}">
+                <output/>
+             </copy-release>
+         </artifact>
+         
+       <artifact null="@{tofile}" when="@{release}" >
+            <copy-release release="@{release}"
+              exploded="@{exploded}"
+              requiredJDK="@{requiredJDK}"
+              overwrite="@{overwrite}"
+              >
+               <output/>
+            </copy-release>
+         </artifact>         
+
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!-- Publish                                                      -->
+      <!-- Copy an artifact to the location specified by                -->
+      <!-- ${jbossbuild.repository.root}                                -->
+      <!-- Used by the continous build to publish to the repository.    -->
+      <!-- ============================================================ -->
+
+      <targetdef target="publish" if="@{local}">
+
+         <!-- copy the component-info.xml into the repository -->
+         <componentmain if="@{local}">
+            <fail unless="repository.root">
+              The publish target requires repository.root to be set.
+            </fail>
+            <mkdir dir="${repository.root}/@{relativePath}"/>
+            <copy failonerror="false" file="@{dir}/${jbossbuild.component.info}"
+                  todir="${repository.root}/@{relativePath}"
+            />
+
+         </componentmain>
+
+         <!-- Copy the artifact into the release -->
+         <artifact if="@{component.local}">
+            <fail unless="repository.root">
+              The publish target requires repository.root to be set.
+            </fail>
+            <mkdir dir="${repository.root}/@{relativePath}"/>
+            <copy todir="${repository.root}/@{relativePath}">
+               <output/>
+            </copy>
+         </artifact>
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!-- Archives                                                     -->
+      <!-- Builds the release archive(s)                                -->
+      <!-- ============================================================ -->
+
+      <!-- Build the release archives -->
+      <targetdef target="archives" description="Build the release archives">
+
+         <!-- Make the archives -->
+         <main>
+         
+            <!-- Create the zip file -->
+            <zip destfile="@{output}/@{releaseName}.zip"
+                 basedir="@{releaseDir}"
+            />
+         </main>
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!-- Doc                                                          -->
+      <!-- Creates the documentation.                                   -->
+      <!-- ============================================================ -->
+
+      <targetdef target="doc" description="Documentation">
+
+         <!-- Generate the documentation -->
+         <component depends="api"/>
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!-- API                                                          -->
+      <!-- Creates the javadoc                                          -->
+      <!-- ============================================================ -->
+
+      <targetdef target="api" description="Javadoc">
+
+         <!-- Generate the javadoc -->
+         <component/>
+         <api>
+            <mkdir dir="@{output}"/>
+            <javadoc packagenames="*"
+                     destdir="@{output}"
+            >
+               <doctitle>
+                  <![CDATA[<h1>@{description} API Documentation</h1>]]>
+               </doctitle>
+               <bottom>
+                  <![CDATA[
+                     <i>
+                        <div align="center">
+                           <font size="-1">
+                              Copyright &#169; 2005 JBoss Inc. All Rights Reservered.
+                           </font>
+                        </div>
+                     </i>
+                  ]]>
+               </bottom>
+               <link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
+               <sourcepath>
+                  <sourcepaths/>
+               </sourcepath>
+               <classpath>
+                  <sourcepathelements/>
+               </classpath>
+            </javadoc>
+         </api>
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!-- Clean                                                        -->
+      <!-- Deletes the output folder                                    -->
+      <!-- ============================================================ -->
+
+      <targetdef target="clean" description="Clean">
+         <common>
+            <delete dir="@{output}" failonerror="false"/>
+         </common>
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!-- Clobber                                                      -->
+      <!-- Deletes the output folder and removes thirdparty             -->
+      <!-- ============================================================ -->
+
+      <targetdef target="clobber" description="Clobber">
+         <main depends="clean">
+            <delete dir="@{thirdparty}"/>
+         </main>
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!-- Synchronize                                                  -->
+      <!-- Resynchronizes the project with cvs                          -->
+      <!-- ============================================================ -->
+
+      <targetdef target="synchronize" description="Synchronize">
+
+         <!-- Update the main build folder and tools from cvs
+              then do the same for the components before running
+              the after synchronization processing
+              NOTE: Does not automatically invoke component builds
+              as the list of components maybe out-of-date at this point
+              and we need to conditionally do cvs co/update
+         -->
+         <main components="none">
+            <!-- cvs command="update -dP" failonerror="true"/-->
+            <!--invoke target="synchronize" dir="../tools"/-->
+            <execute-target target="synchronize.components" />
+            <!-- execant target="synchronize.after.main"/-->
+         </main>
+
+         <componentmain unless="@{local}">
+            <mkdir dir="@{thirdpartyDir}"/>
+            <get src="@{location}/${jbossbuild.component.info}"
+                 dest="@{thirdpartyDir}/${jbossbuild.component.info}"
+                 useTimestamp="false"
+                 verbose="true"
+            />
+         </componentmain>
+
+         <!-- If the component exists we just do a cvs update -->
+         <componentmain if="@{exists}">
+           <cvs dest="@{dir}" command="update"/>
+            <!-- NOTE: unable to delegate to component until JBBUILD-62 is resolved -->
+            <!--invoke target="synchronize" dir="@{dir}"/--> 
+            <!--execant target="synchronize.after" dir="@{dir}"/--> 
+         </componentmain>
+
+         <!-- If the component doesn't exist and we want to
+              get the source build check it out from cvs
+         -->
+         <componentmain unless="@{exists}" if="@{local}">
+            <cvs dest="@{dir.parent}">
+               <commandline>
+                  <argument value="-d"/>
+                  <argument value="@{build.cvsroot}"/>
+                  <argument value="co"/>
+                  <argument value="-d"/>
+                  <argument value="@{id}"/>
+                  <argument value="@{module}"/>
+               </commandline>
+            </cvs>
+            <!-- execant target="synchronize.after" dir="@{dir}"/--> 
+         </componentmain>
+
+         <!-- The component already exists do a cvs update
+              and run the after synchronization
+         -->
+         <component nomain="true">
+            <cvs command="update -dP" failonerror="true"/>
+            <!--execant target="synchronize.after"/-->
+         </component>
+
+         <!-- If we are not doing a source checkout of this
+              component, download the artifacts to thirdparty
+         -->
+         <artifact unless="@{component.local}">
+            <mkdir dir="@{parentDir}"/>
+            <get src="@{location}" 
+                 dest="@{output}" 
+                 useTimestamp="false"
+                 verbose="true"
+            />
+         </artifact>
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!-- Commit                                                       -->
+      <!-- Commits the changes to cvs                                   -->
+      <!-- ============================================================ -->
+
+      <targetdef target="commit" description="Commit">
+         <!-- Commit the main build and tools -->
+         <main>
+            <fail message="Use -Dm=&quot;xxx&quot; to specify the commit message" unless="m"/>
+            <cvs failonerror="true">
+               <commandline>
+                  <argument value="commit"/>
+                  <argument value="-m"/>
+                  <argument value="${m}"/>
+               </commandline>
+            </cvs>
+            <invoke target="commit" dir="../tools"/>
+         </main>
+         <!-- Commit the component -->
+         <component>
+            <fail message="Use -Dm=&quot;xxx&quot; to specify the commit message" unless="m"/>
+            <cvs failonerror="true">
+               <commandline>
+                  <argument value="commit"/>
+                  <argument value="-m"/>
+                  <argument value="${m}"/>
+               </commandline>
+            </cvs>
+         </component>
+      </targetdef>
+      
+      <!-- ============================================================ -->
+      <!-- Test                                                         -->
+      <!-- Builds and runs the tests                                    -->
+      <!-- ============================================================ -->
+
+      <targetdef target="test" description="Build and run the tests">
+         <component depends="build, runtest"/>
+      </targetdef>
+      
+      <!-- ============================================================ -->
+      <!-- RunTest                                                      -->
+      <!-- Runs the tests for sources marked with a test attribute      -->
+      <!-- ============================================================ -->
+      
+      <!-- Run the Test -->
+      <targetdef target="runtest" description="Run tests">
+         <component/>
+         <source when="@{test}">
+            <mkdir dir="@{testDir}"/>
+            <delete file="@{testDir}/test.log"/>
+            <junit fork="true"
+                   printSummary="true">
+               <sysproperty key="org.jboss.test.logfile" value="@{testDir}/test.log"/>
+               <formatter type="plain"/>
+               <classpath>
+                  <pathElements/>
+               </classpath>
+               <batchtest todir="@{testDir}">
+                  <fileset dir="@{sourceDir}" includes="@{test}"/>
+               </batchtest>
+            </junit>
+         </source>
+      </targetdef>
+      
+      <!-- ============================================================ -->
+      <!-- Rebuild                                                      -->
+      <!-- Synchronizes then builds                                     -->
+      <!-- ============================================================ -->
+      
+      <!-- Rebuild -->
+      <targetdef target="rebuild" description="Synchronize then build">
+         <common depends="synchronize">
+            <execant target="build"/>
+         </common>
+      </targetdef>
+      
+      <!-- ============================================================ -->
+      <!-- RebuildAll                                                   -->
+      <!-- Synchronizes then builds all                                 -->
+      <!-- ============================================================ -->
+      
+      <!-- Rebuild all -->
+      <targetdef target="rebuildall" description="Synchronize then build all">
+         <common depends="synchronize">
+            <execant target="all"/>
+         </common>
+      </targetdef>
+
+      <!-- ============================================================ -->
+      <!-- Synchronize.After                                            -->
+      <!-- After synchronization processing                             -->
+      <!-- ============================================================ -->
+
+      <!-- After synchronization processing -->
+      <targetdef target="synchronize.after" description="After synchronization processing">
+              <main>
+                 <idemain/>
+              </main>
+              <component>
+                 <idecomponent/>
+              </component>
+      </targetdef>
+      
+
+      
+ </targets>   
+
+<!-- ================================================================== -->
+<!-- Macro Definitions                                                  -->
+<!-- ================================================================== -->
+
+   <condition property="execant-executable" value="cmd.exe">
+     <os family="windows"/>
+   </condition>
+   <property name="execant-executable" value="ant"/>
+   <condition property="execant-prefix" value="/c ant">
+     <os family="windows"/>
+   </condition>
+   <property name="execant-prefix" value=""/>
+   <!-- Set the execant.args to empty unless it already exists -->
+   <condition property="execant.args" value="">
+      <not><isset property="execant.args"/></not>
+   </condition>
+
+   <!-- The execant macro -->
+   <macrodef name="execant">
+      <attribute name="dir"
+                 default="${basedir}"
+                 description="The directory"
+      />
+      <attribute name="target"
+                 description="The target"
+      />
+      <attribute name="filename"
+                 default="jbossbuild.xml"
+                 description="The ant file to execute"
+      />
+      <sequential>
+         <!-- Invoke using a new ant -->
+         <exec dir="@{dir}" 
+               executable="${execant-executable}"
+         >
+            <arg line="${execant-prefix} ${execant.args} -f @{filename} @{target}"/>
+         </exec>
+      </sequential>
+   </macrodef>
+
+   <!-- The invoke macro -->
+   <macrodef name="invoke">
+      <attribute name="dir"
+                 default="${basedir}"
+                 description="The directory"
+      />
+      <attribute name="target"
+                 description="The target"
+      />
+      <sequential>
+         <!-- Invoke using a new ant -->
+         <ant antfile="jbossbuild.xml" dir="@{dir}" target="@{target}"/>
+      </sequential>
+   </macrodef>
+
+<!-- ================================================================== -->
+<!-- Targets                                                            -->
+<!-- ================================================================== -->
+
+   <target name="help-fragment">
+      <fail message="Do not execute this build fragment directly!"/>
+   </target>
+   
+</project>
+




More information about the jboss-cvs-commits mailing list