[jboss-cvs] JBoss Messaging SVN: r7464 - in trunk: examples/javaee/jca-config and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 25 05:57:58 EDT 2009


Author: ataylor
Date: 2009-06-25 05:57:58 -0400 (Thu, 25 Jun 2009)
New Revision: 7464

Added:
   trunk/src/main/org/jboss/messaging/ra/ConnectionFactoryProperties.java
Modified:
   trunk/docs/user-manual/en/appserver-integration.xml
   trunk/examples/javaee/jca-config/build.xml
   trunk/src/main/org/jboss/messaging/ra/JBMMCFProperties.java
   trunk/src/main/org/jboss/messaging/ra/JBMManagedConnectionFactory.java
   trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java
   trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java
   trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivation.java
   trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivationSpec.java
   trunk/src/main/org/jboss/messaging/ra/inflow/JBMMessageHandler.java
   trunk/tests/src/org/jboss/messaging/tests/unit/ra/ResourceAdapterTest.java
Log:
https://jira.jboss.org/jira/browse/JBMESSAGING-1612 - added overrides for all ra global properties + some refactoring

Modified: trunk/docs/user-manual/en/appserver-integration.xml
===================================================================
--- trunk/docs/user-manual/en/appserver-integration.xml	2009-06-25 08:51:59 UTC (rev 7463)
+++ trunk/docs/user-manual/en/appserver-integration.xml	2009-06-25 09:57:58 UTC (rev 7464)
@@ -347,15 +347,16 @@
             <programlisting>@Resource(mappedName="java:RemoteJmsXA")
 private ConnectionFactory connectionFactory;</programlisting>
             <para>The <literal>config-property</literal> elements are what over rides those in the
-                    <literal>ra.xml</literal> config.</para>
+                    <literal>ra.xml</literal> config. Any of the elements pertaining to the
+                connection factory can be over ridden here.</para>
         </section>
         <section>
             <title>Adapter Inbound configuration</title>
             <para>The inbound configuration should again remain unchanged. This controls what
                 forwards messages onto MDB's. It is possible to override properties on the MDB by
-                adding an activation configuration to the MDB itself. This could be used to configure the
-                MDB to consume from a different server. The next section demonstrates over riding
-                the configuration.</para>
+                adding an activation configuration to the MDB itself. This could be used to
+                configure the MDB to consume from a different server. The next section demonstrates
+                over riding the configuration.</para>
         </section>
     </section>
     <section>
@@ -403,7 +404,8 @@
         <para>In this example we have configured the MDB to consume from the queue named <literal
                 >queue/testQueue</literal>. It is also possible to override properties for the
             inbound resource adapter here is well. Here the MDB is configured to connect to a
-            different server.</para>
+            different server. Any of the global properties defined on the adapter can be over ridden
+            via an <literal>ActivationConfigProperty</literal>.</para>
         <para>It is also possible to define these properties in the <literal>web.xml</literal>
             deployment descriptor. Refer to the JBoss AS documentation on how to do this.</para>
     </section>
@@ -442,10 +444,10 @@
         <para>The bridge can also be used to bridge messages from other non JBoss Messaging JMS
             servers, as long as they are JMS 1.1 compliant.<note>
                 <para>Don't confuse a JMS bridge with a core bridge. A JMS bridge can be used to
-                    bridge any two JMS 1.1 compliant JMS providers and uses the JMS API. A core bridge
-                    (described in <xref linkend="core-bridges" />) is used to bridge any two JBoss
-                    Messaging instances and uses the core API. Always use a core bridge if you can
-                    in preference to a JMS bridge. The core bridge will typically provide better
+                    bridge any two JMS 1.1 compliant JMS providers and uses the JMS API. A core
+                    bridge (described in <xref linkend="core-bridges"/>) is used to bridge any two
+                    JBoss Messaging instances and uses the core API. Always use a core bridge if you
+                    can in preference to a JMS bridge. The core bridge will typically provide better
                     performance than a JMS bridge. Also the core bridge can provide <emphasis>once
                         and only once</emphasis> delivery guarantees without using XA.</para>
             </note></para>
@@ -459,7 +461,7 @@
             it can be configured to consume using a non durable or durable subscription</para>
         <para>The bridge is deployed by the JBoss Micro Container via a beans configuration file.
             This would typically be deployed inside the JBoss Application Server and the following
-            example shows an example of a beans file that bridges 2 destinations which are actually 
+            example shows an example of a beans file that bridges 2 destinations which are actually
             on the same server. </para>
         <programlisting>&lt;?xml version="1.0" encoding="UTF-8"?>
 
@@ -586,147 +588,170 @@
       &lt;/bean>
 
 &lt;/deployment></programlisting>
-
         <section>
-           <title>JMS Bridge Parameters</title>        
-           <para>The main bean deployed is the <literal>JMSBridge</literal> bean. The bean is configurable
-               by the parameters passed to its constructor.</para>
-           <note>
-              <para>To let a parameter be unspecified (for example, if the authentication is anonymous or no message selector
-                 is provided), use <literal>&lt;null /&gt;</literal> for the unspecified parameter value.</para>
-           </note>
-           <itemizedlist>
-               <listitem>
-                  <para>Source Connection Factory Factory</para>
-                  <para>This injects the <literal>SourceCFF</literal> bean (also defined in the beans
-                     file). This bean is used to create the <emphasis>source</emphasis> <literal>ConnectionFactory</literal>
-                  </para>
-               </listitem>
-               <listitem>
-                  <para>Target Connection Factory Factory</para>
-                  <para>This injects the <literal>TargetCFF</literal> bean (also defined in the beans
-                      file). This bean is used to create the <emphasis>target</emphasis> <literal>ConnectionFactory</literal>
-                  </para>
-               </listitem>
-               <listitem>
-                  <para>Source Destination Factory Factory</para>
-                  <para>This injects the <literal>SourceDestinationFactory</literal> bean (also defined in the beans
-                       file). This bean is used to create the <emphasis>source</emphasis> <literal>Destination</literal>
-                  </para>
-               </listitem>
-               <listitem>
-                  <para>Target Destination Factory Factory</para>
-                  <para>This injects the <literal>TargetDestinationFactory</literal> bean (also defined in the beans
-                     file). This bean is used to create the <emphasis>target</emphasis> <literal>Destination</literal>
-                  </para>
-               </listitem>
-               <listitem>
-                   <para>Source User Name</para>
-                   <para>this parameter is the username for creating the <emphasis>source</emphasis> connection</para>
-               </listitem>
-               <listitem>
-                  <para>Source Password</para>
-                  <para>this parameter is the parameter for creating the <emphasis>source</emphasis> connection</para>
-               </listitem>
-               <listitem>
-                   <para>Target User Name</para>
-                   <para>this parameter is the username for creating the <emphasis>target</emphasis> connection</para>
-               </listitem>
-               <listitem>
-                  <para>Target Password</para>
-                  <para>this parameter is the password for creating the <emphasis>target</emphasis> connection</para>
-               </listitem>
-               <listitem>
-                  <para>Selector</para>
-                  <para>This represents a JMS selector expression used for consuming messages 
-                     from the source destination. Only messages that match the selector expression will be
-                     bridged from the source to the target destination</para>
-                  <para>
-                     <note>Ut is always more efficient to apply selectors on source topic subscriptions to source
-                         queue consumers</note>
-                  </para>
-                  <para>The selector expression must follow the 
-                     <ulink url="http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html">JMS selector syntax</ulink></para>
-               </listitem>
-               <listitem>
-                  <para>Failure Retry Interval</para>
-                  <para>This represents the amount of time in ms to wait between trying to recreate connections 
-                     to the source or target servers when the bridge has detected they have failed</para>
-               </listitem>
-               <listitem>
-                  <para>Max Retries</para>
-                  <para>This represents the number of times to attempt to recreate connections to the source
-                     or target servers when the bridge has detected they have failed. The bridge will give up
-                     after trying this number of times. <literal>-1</literal> represents 'try forever'</para>
-               </listitem>
-               <listitem>
-                  <para>Quality Of Service</para>
-                  <para>This parameter represents the desired quality of service mode</para>
-                  <para>Possible values are:</para>
-                  <itemizedlist>
-                     <listitem><para><literal>AT_MOST_ONCE</literal></para></listitem>
-                     <listitem><para><literal>DUPLICATES_OK</literal></para></listitem>
-                     <listitem><para><literal>ONCE_AND_ONLY_ONCE</literal></para></listitem>
-                  </itemizedlist>
-                  <para>See <xref linkend="quality-of-service" /> for a explanation of these modes.</para>
-               </listitem>
-               <listitem>
-                  <para>Max Batch Size</para>
-                  <para>This represents the maximum number of messages to consume from the source 
-                     destination before sending them in a batch to the target destination. 
-                     Its value must <literal>>= 1</literal>
-                  </para>
-               </listitem>
-               <listitem>
-                  <para>Max Batch Time</para>
-                  <para>This represents the maximum number of milliseconds to wait before sending
-                      a batch to target, even if the number of messages consumed has not reached 
-                      <literal>MaxBatchSize</literal>. Its value must be <literal>-1</literal> to represent 
-                      'wait forever', or <literal>>= 1</literal> to specify an actual time
-                  </para>
-               </listitem>              
-               <listitem>
-                  <para>Subscription Name</para>
-                  <para>If the source destination represents a topic, and you want to consume from the topic
-                      using a durable subscription then this parameter represents the durable subscription name</para>
-               </listitem>              
-               <listitem>
-                  <para>Client ID</para>
-                  <para>If the source destination represents a topic, and you want to consume from the topic 
-                     using a durable subscription then this attribute represents the the JMS client ID to use 
-                     when creating/looking up the durable subscription</para>
-               </listitem>              
-               <listitem>
-                  <para>Add MessageID In Header</para>
-                  <para>If <literal>true</literal>, then the original message's message ID will be appended in the message sent
-                      to the destination in the header <literal>JBM_BRIDGE_MSG_ID_LIST</literal>. If the message is bridged more
-                      than once, each message ID will be  appended. This enables a distributed request-response pattern to be used</para>
-                   <note>
-                       <para>when you receive the message you can send back a response using the
-                           correlation id of the first message id, so when the original sender gets it
-                           back it will be able to correlate it. </para>
-                   </note>
-               </listitem>
-           </itemizedlist>
+            <title>JMS Bridge Parameters</title>
+            <para>The main bean deployed is the <literal>JMSBridge</literal> bean. The bean is
+                configurable by the parameters passed to its constructor.</para>
+            <note>
+                <para>To let a parameter be unspecified (for example, if the authentication is
+                    anonymous or no message selector is provided), use <literal>&lt;null
+                        /&gt;</literal> for the unspecified parameter value.</para>
+            </note>
+            <itemizedlist>
+                <listitem>
+                    <para>Source Connection Factory Factory</para>
+                    <para>This injects the <literal>SourceCFF</literal> bean (also defined in the
+                        beans file). This bean is used to create the <emphasis>source</emphasis>
+                        <literal>ConnectionFactory</literal>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>Target Connection Factory Factory</para>
+                    <para>This injects the <literal>TargetCFF</literal> bean (also defined in the
+                        beans file). This bean is used to create the <emphasis>target</emphasis>
+                        <literal>ConnectionFactory</literal>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>Source Destination Factory Factory</para>
+                    <para>This injects the <literal>SourceDestinationFactory</literal> bean (also
+                        defined in the beans file). This bean is used to create the
+                            <emphasis>source</emphasis>
+                        <literal>Destination</literal>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>Target Destination Factory Factory</para>
+                    <para>This injects the <literal>TargetDestinationFactory</literal> bean (also
+                        defined in the beans file). This bean is used to create the
+                            <emphasis>target</emphasis>
+                        <literal>Destination</literal>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>Source User Name</para>
+                    <para>this parameter is the username for creating the
+                            <emphasis>source</emphasis> connection</para>
+                </listitem>
+                <listitem>
+                    <para>Source Password</para>
+                    <para>this parameter is the parameter for creating the
+                            <emphasis>source</emphasis> connection</para>
+                </listitem>
+                <listitem>
+                    <para>Target User Name</para>
+                    <para>this parameter is the username for creating the
+                            <emphasis>target</emphasis> connection</para>
+                </listitem>
+                <listitem>
+                    <para>Target Password</para>
+                    <para>this parameter is the password for creating the
+                            <emphasis>target</emphasis> connection</para>
+                </listitem>
+                <listitem>
+                    <para>Selector</para>
+                    <para>This represents a JMS selector expression used for consuming messages from
+                        the source destination. Only messages that match the selector expression
+                        will be bridged from the source to the target destination</para>
+                    <para>
+                        <note>Ut is always more efficient to apply selectors on source topic
+                            subscriptions to source queue consumers</note>
+                    </para>
+                    <para>The selector expression must follow the <ulink
+                            url="http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html">JMS
+                            selector syntax</ulink></para>
+                </listitem>
+                <listitem>
+                    <para>Failure Retry Interval</para>
+                    <para>This represents the amount of time in ms to wait between trying to
+                        recreate connections to the source or target servers when the bridge has
+                        detected they have failed</para>
+                </listitem>
+                <listitem>
+                    <para>Max Retries</para>
+                    <para>This represents the number of times to attempt to recreate connections to
+                        the source or target servers when the bridge has detected they have failed.
+                        The bridge will give up after trying this number of times. <literal
+                            >-1</literal> represents 'try forever'</para>
+                </listitem>
+                <listitem>
+                    <para>Quality Of Service</para>
+                    <para>This parameter represents the desired quality of service mode</para>
+                    <para>Possible values are:</para>
+                    <itemizedlist>
+                        <listitem>
+                            <para><literal>AT_MOST_ONCE</literal></para>
+                        </listitem>
+                        <listitem>
+                            <para><literal>DUPLICATES_OK</literal></para>
+                        </listitem>
+                        <listitem>
+                            <para><literal>ONCE_AND_ONLY_ONCE</literal></para>
+                        </listitem>
+                    </itemizedlist>
+                    <para>See <xref linkend="quality-of-service"/> for a explanation of these
+                        modes.</para>
+                </listitem>
+                <listitem>
+                    <para>Max Batch Size</para>
+                    <para>This represents the maximum number of messages to consume from the source
+                        destination before sending them in a batch to the target destination. Its
+                        value must <literal>>= 1</literal>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>Max Batch Time</para>
+                    <para>This represents the maximum number of milliseconds to wait before sending
+                        a batch to target, even if the number of messages consumed has not reached
+                            <literal>MaxBatchSize</literal>. Its value must be <literal>-1</literal>
+                        to represent 'wait forever', or <literal>>= 1</literal> to specify an actual
+                        time </para>
+                </listitem>
+                <listitem>
+                    <para>Subscription Name</para>
+                    <para>If the source destination represents a topic, and you want to consume from
+                        the topic using a durable subscription then this parameter represents the
+                        durable subscription name</para>
+                </listitem>
+                <listitem>
+                    <para>Client ID</para>
+                    <para>If the source destination represents a topic, and you want to consume from
+                        the topic using a durable subscription then this attribute represents the
+                        the JMS client ID to use when creating/looking up the durable
+                        subscription</para>
+                </listitem>
+                <listitem>
+                    <para>Add MessageID In Header</para>
+                    <para>If <literal>true</literal>, then the original message's message ID will be
+                        appended in the message sent to the destination in the header <literal
+                            >JBM_BRIDGE_MSG_ID_LIST</literal>. If the message is bridged more than
+                        once, each message ID will be appended. This enables a distributed
+                        request-response pattern to be used</para>
+                    <note>
+                        <para>when you receive the message you can send back a response using the
+                            correlation id of the first message id, so when the original sender gets
+                            it back it will be able to correlate it. </para>
+                    </note>
+                </listitem>
+            </itemizedlist>
         </section>
         <section>
             <title>Source and Target Connection Factories</title>
             <para>The source and target connection factory factories are used to create the
                 connection factory used to create the connection for the source or target
                 server.</para>
-            <para>The configuration example above uses the default implementation provided by JBoss Messaging 
-                that looks up the connection factory using JNDI. For other Application Servers or JMS providers a new
-                implementation may have to be provided. This can easily be done by implementing the
-                interface <literal
-                >org.jboss.messaging.jms.bridge.ConnectionFactoryFactory</literal>.</para>
+            <para>The configuration example above uses the default implementation provided by JBoss
+                Messaging that looks up the connection factory using JNDI. For other Application
+                Servers or JMS providers a new implementation may have to be provided. This can
+                easily be done by implementing the interface <literal
+                    >org.jboss.messaging.jms.bridge.ConnectionFactoryFactory</literal>.</para>
         </section>
         <section>
             <title>Source and Target Destination Factories</title>
             <para>Again, similarly, these are used to create or lookup up the destinations.</para>
-            <para>In the configuration example above, we have used the default provided by JBoss Messaging that looks up the
-                destination using JNDI.</para>
-            <para>A new
-                implementation can be provided by implementing <literal
+            <para>In the configuration example above, we have used the default provided by JBoss
+                Messaging that looks up the destination using JNDI.</para>
+            <para>A new implementation can be provided by implementing <literal
                     >org.jboss.messaging.jms.bridge.DestinationFactory</literal> interface.</para>
         </section>
         <section id="quality-of-service">
@@ -740,8 +765,7 @@
                     to the destination. Therefore there is a possibility that if failure occurs
                     between removing them from the source and them arriving at the destination they
                     could be lost. Hence delivery will occur at most once.</para>
-                <para>This mode is available
-                    for both persistent and non persistent messages.</para>
+                <para>This mode is available for both persistent and non persistent messages.</para>
             </section>
             <section>
                 <title>DUPLICATES_OK</title>
@@ -749,7 +773,8 @@
                     acknowledged after they have been successfully sent to the destination.
                     Therefore there is a possibility that if failure occurs after sending to the
                     destination but before acknowledging them, they could be sent again when the
-                    system recovers. I.e. the destination might receive duplicates after a failure.</para>
+                    system recovers. I.e. the destination might receive duplicates after a
+                    failure.</para>
                 <para>This mode is available for both persistent and non persistent messages.</para>
             </section>
             <section>
@@ -768,22 +793,22 @@
                 <para>This mode is only available for persistent messages.</para>
                 <note>
                     <para>For a specific application it may possible to provide once and only once
-                        semantics without using the ONCE_AND_ONLY_ONCE QoS level. This can be
-                        done by using the DUPLICATES_OK mode and then checking for duplicates at
-                        the destination and discarding them. Some JMS servers provide automatic
+                        semantics without using the ONCE_AND_ONLY_ONCE QoS level. This can be done
+                        by using the DUPLICATES_OK mode and then checking for duplicates at the
+                        destination and discarding them. Some JMS servers provide automatic
                         duplicate message detection functionality, or this may be possible to
                         implement on the application level by maintaining a cache of received
                         message ids on disk and comparing received messages to them. The cache would
                         only be valid for a certain period of time so this approach is not as
-                        watertight as using ONCE_AND_ONLY_ONCE but may be a good choice
-                        depending on your specific application.</para>
+                        watertight as using ONCE_AND_ONLY_ONCE but may be a good choice depending on
+                        your specific application.</para>
                 </note>
             </section>
             <section>
                 <title>Example</title>
-                <para>Please see <xref linkend="jms-bridge-example" /> which shows how to
-                    configure and use a JMS Bridge to send messages to the source destination and
-                    consume them from the target destination.</para>
+                <para>Please see <xref linkend="jms-bridge-example"/> which shows how to configure
+                    and use a JMS Bridge to send messages to the source destination and consume them
+                    from the target destination.</para>
             </section>
         </section>
     </section>
@@ -821,8 +846,8 @@
         </section>
         <section>
             <title>Example</title>
-            <para>See <xref linkend="xa-recovery-example"/> which shows how to
-                configure XA Recovery and recover messages after a server crash.</para>
+            <para>See <xref linkend="xa-recovery-example"/> which shows how to configure XA Recovery
+                and recover messages after a server crash.</para>
         </section>
     </section>
 </chapter>

Modified: trunk/examples/javaee/jca-config/build.xml
===================================================================
--- trunk/examples/javaee/jca-config/build.xml	2009-06-25 08:51:59 UTC (rev 7463)
+++ trunk/examples/javaee/jca-config/build.xml	2009-06-25 09:57:58 UTC (rev 7464)
@@ -72,7 +72,7 @@
       </copy>
 
       <exec dir="${jboss.home}/bin" executable="sh" osfamily="unix">
-         <arg line="run.sh -c jca-config-example-profile2 -Djboss.service.binding.set=ports-01"/>
+         <arg line="debug.sh -c jca-config-example-profile2 -Djboss.service.binding.set=ports-01"/>
       </exec>
       <exec dir="${jboss.home}/bin" executable="cmd" osfamily="windows">
          <arg line="/c run.bat -c jca-config-example-profile2 -Djboss.service.binding.set=ports-01"/>

Added: trunk/src/main/org/jboss/messaging/ra/ConnectionFactoryProperties.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/ConnectionFactoryProperties.java	                        (rev 0)
+++ trunk/src/main/org/jboss/messaging/ra/ConnectionFactoryProperties.java	2009-06-25 09:57:58 UTC (rev 7464)
@@ -0,0 +1,751 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, 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.messaging.ra;
+
+import org.jboss.messaging.core.logging.Logger;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ */
+public class ConnectionFactoryProperties
+{
+   /**
+    * The logger
+    */
+   private static final Logger log = Logger.getLogger(JBMMCFProperties.class);
+
+   /**
+    * Trace enabled
+    */
+   private static boolean trace = log.isTraceEnabled();
+
+   private boolean hasBeenUpdated = false;
+
+   /**
+    * The transport type, changing the default configured from the RA
+    */
+   private String connectorClassName;
+
+   /**
+    * The transport config, changing the default configured from the RA
+    */
+   private Map<String, Object> connectionParameters;
+   /**
+    * The transport config, changing the default configured from the RA
+    */
+   private Map<String, Object> backupConnectionParameters;
+
+   private String backupConnectorClassName;
+
+   private String connectionLoadBalancingPolicyClassName;
+
+   private String discoveryAddress;
+
+   private Integer discoveryPort;
+
+   private Long discoveryRefreshTimeout;
+
+   private Long discoveryInitialWaitTimeout;
+
+   private String clientID;
+
+   private Integer dupsOKBatchSize;
+
+   private Integer transactionBatchSize;
+
+   private Long clientFailureCheckPeriod;
+
+   private Long connectionTTL;
+
+   private Long callTimeout;
+
+   private Integer consumerWindowSize;
+
+   private Integer consumerMaxRate;
+
+   private Integer producerWindowSize;
+
+   private Integer producerMaxRate;
+
+   private Integer minLargeMessageSize;
+
+   private Boolean blockOnAcknowledge;
+
+   private Boolean blockOnNonPersistentSend;
+
+   private Boolean blockOnPersistentSend;
+
+   private Boolean autoGroup;
+
+   private Integer maxConnections;
+
+   private Boolean preAcknowledge;
+
+   private Long retryInterval;
+
+   private Double retryIntervalMultiplier;
+
+   private Integer reconnectAttempts;
+
+   private Boolean failoverOnServerShutdown;
+
+   private Boolean useGlobalPools;
+
+   private Integer scheduledThreadPoolMaxSize;
+
+   private Integer threadPoolMaxSize;
+
+   /**
+    * @return the transportType
+    */
+   public String getConnectorClassName()
+   {
+      return connectorClassName;
+   }
+
+   public Map<String, Object> getParsedConnectionParameters()
+   {
+      return connectionParameters;
+   }
+
+   public void setParsedConnectionParameters(Map<String, Object> connectionParameters)
+   {
+      this.connectionParameters = connectionParameters;
+      hasBeenUpdated = true;
+   }
+
+   public void setConnectorClassName(final String value)
+   {
+      connectorClassName = value;
+      hasBeenUpdated = true;
+   }
+
+   public String getBackupConnectorClassName()
+   {
+      return backupConnectorClassName;
+   }
+
+
+   public Map<String, Object> getParsedBackupConnectionParameters()
+   {
+      return backupConnectionParameters;
+   }
+
+   public void setParsedBackupConnectionParameters(Map<String, Object> backupConnectionParameters)
+   {
+      this.backupConnectionParameters = backupConnectionParameters;
+      hasBeenUpdated = true;
+   }
+
+   public void setBackupConnectorClassName(String backupConnectorClassName)
+   {
+      this.backupConnectorClassName = backupConnectorClassName;
+      hasBeenUpdated = true;
+   }
+
+   public String getConnectionLoadBalancingPolicyClassName()
+   {
+      if (trace)
+      {
+         log.trace("getConnectionLoadBalancingPolicyClassName()");
+      }
+      hasBeenUpdated = true;
+      return connectionLoadBalancingPolicyClassName;
+   }
+
+   public void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName)
+   {
+      if (trace)
+      {
+         log.trace("setSessionDefaultType(" + connectionLoadBalancingPolicyClassName + ")");
+      }
+      hasBeenUpdated = true;
+      this.connectionLoadBalancingPolicyClassName = connectionLoadBalancingPolicyClassName;
+   }
+
+   public String getDiscoveryAddress()
+   {
+      if (trace)
+      {
+         log.trace("getDiscoveryAddress()");
+      }
+      hasBeenUpdated = true;
+      return discoveryAddress;
+   }
+
+   public void setDiscoveryAddress(String discoveryAddress)
+   {
+      if (trace)
+      {
+         log.trace("setDiscoveryAddress(" + discoveryAddress + ")");
+      }
+      hasBeenUpdated = true;
+      this.discoveryAddress = discoveryAddress;
+   }
+
+   public Integer getDiscoveryPort()
+   {
+      if (trace)
+      {
+         log.trace("getDiscoveryPort()");
+      }
+      hasBeenUpdated = true;
+      return discoveryPort;
+   }
+
+   public void setDiscoveryPort(Integer discoveryPort)
+   {
+      if (trace)
+      {
+         log.trace("setDiscoveryPort(" + discoveryPort + ")");
+      }
+      hasBeenUpdated = true;
+      this.discoveryPort = discoveryPort;
+   }
+
+   public Long getDiscoveryRefreshTimeout()
+   {
+      if (trace)
+      {
+         log.trace("getDiscoveryRefreshTimeout()");
+      }
+      hasBeenUpdated = true;
+      return discoveryRefreshTimeout;
+   }
+
+   public void setDiscoveryRefreshTimeout(Long discoveryRefreshTimeout)
+   {
+      if (trace)
+      {
+         log.trace("setDiscoveryRefreshTimeout(" + discoveryRefreshTimeout + ")");
+      }
+      hasBeenUpdated = true;
+      this.discoveryRefreshTimeout = discoveryRefreshTimeout;
+   }
+
+   public Long getDiscoveryInitialWaitTimeout()
+   {
+      if (trace)
+      {
+         log.trace("getDiscoveryInitialWaitTimeout()");
+      }
+      hasBeenUpdated = true;
+      return discoveryInitialWaitTimeout;
+   }
+
+   public void setDiscoveryInitialWaitTimeout(Long discoveryInitialWaitTimeout)
+   {
+      if (trace)
+      {
+         log.trace("setDiscoveryInitialWaitTimeout(" + discoveryInitialWaitTimeout + ")");
+      }
+      hasBeenUpdated = true;
+      this.discoveryInitialWaitTimeout = discoveryInitialWaitTimeout;
+   }
+
+   public String getClientID()
+   {
+      if (trace)
+      {
+         log.trace("getClientID()");
+      }
+      hasBeenUpdated = true;
+      return clientID;
+   }
+
+   public void setClientID(String clientID)
+   {
+      if (trace)
+      {
+         log.trace("setClientID(" + clientID + ")");
+      }
+      hasBeenUpdated = true;
+      this.clientID = clientID;
+   }
+
+   public Integer getDupsOKBatchSize()
+   {
+      if (trace)
+      {
+         log.trace("getDupsOKBatchSize()");
+      }
+      hasBeenUpdated = true;
+      return dupsOKBatchSize;
+   }
+
+   public void setDupsOKBatchSize(Integer dupsOKBatchSize)
+   {
+      if (trace)
+      {
+         log.trace("setDupsOKBatchSize(" + dupsOKBatchSize + ")");
+      }
+      hasBeenUpdated = true;
+      this.dupsOKBatchSize = dupsOKBatchSize;
+   }
+
+   public Integer getTransactionBatchSize()
+   {
+      if (trace)
+      {
+         log.trace("getTransactionBatchSize()");
+      }
+      hasBeenUpdated = true;
+      return transactionBatchSize;
+   }
+
+   public void setTransactionBatchSize(Integer transactionBatchSize)
+   {
+      if (trace)
+      {
+         log.trace("setTransactionBatchSize(" + transactionBatchSize + ")");
+      }
+      hasBeenUpdated = true;
+      this.transactionBatchSize = transactionBatchSize;
+   }
+
+   public Long getClientFailureCheckPeriod()
+   {
+      if (trace)
+      {
+         log.trace("getClientFailureCheckPeriod()");
+      }
+      hasBeenUpdated = true;
+      return clientFailureCheckPeriod;
+   }
+
+   public void setClientFailureCheckPeriod(Long clientFailureCheckPeriod)
+   {
+      if (trace)
+      {
+         log.trace("setClientFailureCheckPeriod(" + clientFailureCheckPeriod + ")");
+      }
+      hasBeenUpdated = true;
+      this.clientFailureCheckPeriod = clientFailureCheckPeriod;
+   }
+
+   public Long getConnectionTTL()
+   {
+      if (trace)
+      {
+         log.trace("getConnectionTTL()");
+      }
+      hasBeenUpdated = true;
+      return connectionTTL;
+   }
+
+   public void setConnectionTTL(Long connectionTTL)
+   {
+      if (trace)
+      {
+         log.trace("setConnectionTTL(" + connectionTTL + ")");
+      }
+      hasBeenUpdated = true;
+      this.connectionTTL = connectionTTL;
+   }
+
+   public Long getCallTimeout()
+   {
+      if (trace)
+      {
+         log.trace("getCallTimeout()");
+      }
+      hasBeenUpdated = true;
+      return callTimeout;
+   }
+
+   public void setCallTimeout(Long callTimeout)
+   {
+      if (trace)
+      {
+         log.trace("setCallTimeout(" + callTimeout + ")");
+      }
+      hasBeenUpdated = true;
+      this.callTimeout = callTimeout;
+   }
+
+   public Integer getConsumerWindowSize()
+   {
+      if (trace)
+      {
+         log.trace("getConsumerWindowSize()");
+      }
+      hasBeenUpdated = true;
+      return consumerWindowSize;
+   }
+
+   public void setConsumerWindowSize(Integer consumerWindowSize)
+   {
+      if (trace)
+      {
+         log.trace("setConsumerWindowSize(" + consumerWindowSize + ")");
+      }
+      hasBeenUpdated = true;
+      this.consumerWindowSize = consumerWindowSize;
+   }
+
+   public Integer getConsumerMaxRate()
+   {
+      if (trace)
+      {
+         log.trace("getConsumerMaxRate()");
+      }
+      hasBeenUpdated = true;
+      return consumerMaxRate;
+   }
+
+   public void setConsumerMaxRate(Integer consumerMaxRate)
+   {
+      if (trace)
+      {
+         log.trace("setConsumerMaxRate(" + consumerMaxRate + ")");
+      }
+      hasBeenUpdated = true;
+      this.consumerMaxRate = consumerMaxRate;
+   }
+
+   public Integer getProducerWindowSize()
+   {
+      if (trace)
+      {
+         log.trace("getProducerWindowSize()");
+      }
+      hasBeenUpdated = true;
+      return producerWindowSize;
+   }
+
+   public void setProducerWindowSize(Integer producerWindowSize)
+   {
+      if (trace)
+      {
+         log.trace("setProducerWindowSize(" + producerWindowSize + ")");
+      }
+      hasBeenUpdated = true;
+      this.producerWindowSize = producerWindowSize;
+   }
+
+   public Integer getProducerMaxRate()
+   {
+      if (trace)
+      {
+         log.trace("getProducerMaxRate()");
+      }
+      hasBeenUpdated = true;
+      return producerMaxRate;
+   }
+
+   public void setProducerMaxRate(Integer producerMaxRate)
+   {
+      if (trace)
+      {
+         log.trace("setProducerMaxRate(" + producerMaxRate + ")");
+      }
+      hasBeenUpdated = true;
+      this.producerMaxRate = producerMaxRate;
+   }
+
+   public Integer getMinLargeMessageSize()
+   {
+      if (trace)
+      {
+         log.trace("getMinLargeMessageSize()");
+      }
+      hasBeenUpdated = true;
+      return minLargeMessageSize;
+   }
+
+   public void setMinLargeMessageSize(Integer minLargeMessageSize)
+   {
+      if (trace)
+      {
+         log.trace("setMinLargeMessageSize(" + minLargeMessageSize + ")");
+      }
+      hasBeenUpdated = true;
+      this.minLargeMessageSize = minLargeMessageSize;
+   }
+
+   public Boolean isBlockOnAcknowledge()
+   {
+      if (trace)
+      {
+         log.trace("isBlockOnAcknowledge()");
+      }
+      hasBeenUpdated = true;
+      return blockOnAcknowledge;
+   }
+
+   public void setBlockOnAcknowledge(Boolean blockOnAcknowledge)
+   {
+      if (trace)
+      {
+         log.trace("setBlockOnAcknowledge(" + blockOnAcknowledge + ")");
+      }
+      hasBeenUpdated = true;
+      this.blockOnAcknowledge = blockOnAcknowledge;
+   }
+
+   public Boolean isBlockOnNonPersistentSend()
+   {
+      if (trace)
+      {
+         log.trace("isBlockOnNonPersistentSend()");
+      }
+      hasBeenUpdated = true;
+      return blockOnNonPersistentSend;
+   }
+
+   public void setBlockOnNonPersistentSend(Boolean blockOnNonPersistentSend)
+   {
+      if (trace)
+      {
+         log.trace("setBlockOnNonPersistentSend(" + blockOnNonPersistentSend + ")");
+      }
+      hasBeenUpdated = true;
+      this.blockOnNonPersistentSend = blockOnNonPersistentSend;
+   }
+
+   public Boolean isBlockOnPersistentSend()
+   {
+      if (trace)
+      {
+         log.trace("isBlockOnPersistentSend()");
+      }
+      hasBeenUpdated = true;
+      return blockOnPersistentSend;
+   }
+
+   public void setBlockOnPersistentSend(Boolean blockOnPersistentSend)
+   {
+      if (trace)
+      {
+         log.trace("setBlockOnPersistentSend(" + blockOnPersistentSend + ")");
+      }
+      hasBeenUpdated = true;
+      this.blockOnPersistentSend = blockOnPersistentSend;
+   }
+
+   public Boolean isAutoGroup()
+   {
+      if (trace)
+      {
+         log.trace("isAutoGroup()");
+      }
+      hasBeenUpdated = true;
+      return autoGroup;
+   }
+
+   public void setAutoGroup(Boolean autoGroup)
+   {
+      if (trace)
+      {
+         log.trace("setAutoGroup(" + autoGroup + ")");
+      }
+      hasBeenUpdated = true;
+      this.autoGroup = autoGroup;
+   }
+
+   public Integer getMaxConnections()
+   {
+      if (trace)
+      {
+         log.trace("getMaxConnections()");
+      }
+      hasBeenUpdated = true;
+      return maxConnections;
+   }
+
+   public void setMaxConnections(Integer maxConnections)
+   {
+      if (trace)
+      {
+         log.trace("setMaxConnections(" + maxConnections + ")");
+      }
+      hasBeenUpdated = true;
+      this.maxConnections = maxConnections;
+   }
+
+   public Boolean isPreAcknowledge()
+   {
+      if (trace)
+      {
+         log.trace("isPreAcknowledge()");
+      }
+      hasBeenUpdated = true;
+      return preAcknowledge;
+   }
+
+   public void setPreAcknowledge(Boolean preAcknowledge)
+   {
+      if (trace)
+      {
+         log.trace("setPreAcknowledge(" + preAcknowledge + ")");
+      }
+      hasBeenUpdated = true;
+      this.preAcknowledge = preAcknowledge;
+   }
+
+   public Long getRetryInterval()
+   {
+      if (trace)
+      {
+         log.trace("getRetryInterval()");
+      }
+      hasBeenUpdated = true;
+      return retryInterval;
+   }
+
+   public void setRetryInterval(Long retryInterval)
+   {
+      if (trace)
+      {
+         log.trace("setRetryInterval(" + retryInterval + ")");
+      }
+      hasBeenUpdated = true;
+      this.retryInterval = retryInterval;
+   }
+
+   public Double getRetryIntervalMultiplier()
+   {
+      if (trace)
+      {
+         log.trace("getRetryIntervalMultiplier()");
+      }
+      hasBeenUpdated = true;
+      return retryIntervalMultiplier;
+   }
+
+   public void setRetryIntervalMultiplier(Double retryIntervalMultiplier)
+   {
+      if (trace)
+      {
+         log.trace("setRetryIntervalMultiplier(" + retryIntervalMultiplier + ")");
+      }
+      hasBeenUpdated = true;
+      this.retryIntervalMultiplier = retryIntervalMultiplier;
+   }
+
+   public Integer getReconnectAttempts()
+   {
+      if (trace)
+      {
+         log.trace("getReconnectAttempts()");
+      }
+      hasBeenUpdated = true;
+      return reconnectAttempts;
+   }
+
+   public void setReconnectAttempts(Integer reconnectAttempts)
+   {
+      if (trace)
+      {
+         log.trace("setReconnectAttempts(" + reconnectAttempts + ")");
+      }
+      hasBeenUpdated = true;
+      this.reconnectAttempts = reconnectAttempts;
+   }
+
+   public Boolean isFailoverOnServerShutdown()
+   {
+      if (trace)
+      {
+         log.trace("isFailoverOnServerShutdown()");
+      }
+      hasBeenUpdated = true;
+      return failoverOnServerShutdown;
+   }
+
+   public void setFailoverOnServerShutdown(Boolean failoverOnServerShutdown)
+   {
+      if (trace)
+      {
+         log.trace("setFailoverOnServerShutdown(" + failoverOnServerShutdown + ")");
+      }
+      hasBeenUpdated = true;
+      this.failoverOnServerShutdown = failoverOnServerShutdown;
+   }
+
+   public Boolean isUseGlobalPools()
+   {
+      if (trace)
+      {
+         log.trace("isUseGlobalPools()");
+      }
+      hasBeenUpdated = true;
+      return useGlobalPools;
+   }
+
+   public void setUseGlobalPools(Boolean useGlobalPools)
+   {
+      if (trace)
+      {
+         log.trace("setUseGlobalPools(" + useGlobalPools + ")");
+      }
+      hasBeenUpdated = true;
+      this.useGlobalPools = useGlobalPools;
+   }
+
+   public Integer getScheduledThreadPoolMaxSize()
+   {
+      if (trace)
+      {
+         log.trace("getScheduledThreadPoolMaxSize()");
+      }
+      hasBeenUpdated = true;
+      return scheduledThreadPoolMaxSize;
+   }
+
+   public void setScheduledThreadPoolMaxSize(Integer scheduledThreadPoolMaxSize)
+   {
+      if (trace)
+      {
+         log.trace("setScheduledThreadPoolMaxSize(" + scheduledThreadPoolMaxSize + ")");
+      }
+      hasBeenUpdated = true;
+      this.scheduledThreadPoolMaxSize = scheduledThreadPoolMaxSize;
+   }
+
+   public Integer getThreadPoolMaxSize()
+   {
+      if (trace)
+      {
+         log.trace("getThreadPoolMaxSize()");
+      }
+      hasBeenUpdated = true;
+      return threadPoolMaxSize;
+   }
+
+   public void setThreadPoolMaxSize(Integer threadPoolMaxSize)
+   {
+      if (trace)
+      {
+         log.trace("setThreadPoolMaxSize(" + threadPoolMaxSize + ")");
+      }
+      hasBeenUpdated = true;
+      this.threadPoolMaxSize = threadPoolMaxSize;
+   }
+
+   public boolean isHasBeenUpdated()
+   {
+      return hasBeenUpdated;
+   }
+}

Modified: trunk/src/main/org/jboss/messaging/ra/JBMMCFProperties.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/JBMMCFProperties.java	2009-06-25 08:51:59 UTC (rev 7463)
+++ trunk/src/main/org/jboss/messaging/ra/JBMMCFProperties.java	2009-06-25 09:57:58 UTC (rev 7464)
@@ -21,51 +21,62 @@
  */
 package org.jboss.messaging.ra;
 
-import java.io.Serializable;
-import java.util.Map;
+import org.jboss.messaging.core.logging.Logger;
 
 import javax.jms.Queue;
 import javax.jms.Topic;
+import java.io.Serializable;
 
-import org.jboss.messaging.core.logging.Logger;
-
 /**
  * The MCF default properties - these are set in the <tx-connection-factory> at the jms-ds.xml
  *
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
  * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
  * @version $Revision: $
  */
-public class JBMMCFProperties implements Serializable
+public class JBMMCFProperties extends ConnectionFactoryProperties implements Serializable
 {
-   /** Serial version UID */
+   /**
+    * Serial version UID
+    */
    static final long serialVersionUID = -5951352236582886862L;
 
-   /** The logger */
+   /**
+    * The logger
+    */
    private static final Logger log = Logger.getLogger(JBMMCFProperties.class);
 
-   /** Trace enabled */
+   /**
+    * Trace enabled
+    */
    private static boolean trace = log.isTraceEnabled();
 
-   /** The queue type */
+   /**
+    * The queue type
+    */
    private static final String QUEUE_TYPE = Queue.class.getName();
 
-   /** The topic type */
+   /**
+    * The topic type
+    */
    private static final String TOPIC_TYPE = Topic.class.getName();
 
-   /** The transport config, changing the default configured from the RA */
-   private Map<String, Object> connectionParameters;
 
+
    public String strConnectionParameters;
 
-   /** The transport type, changing the default configured from the RA */
-   private String connectorClassName;
+   public String strBackupConnectionParameters;
 
-   /** The connection type */
+   /**
+    * The connection type
+    */
    private int type = JBMConnectionFactory.CONNECTION;
 
-   /** Use tryLock */
+   /**
+    * Use tryLock
+    */
    private Integer useTryLock;
 
    /**
@@ -83,6 +94,7 @@
 
    /**
     * Get the connection type
+    *
     * @return The type
     */
    public int getType()
@@ -98,37 +110,35 @@
    /**
     * @return the connectionParameters
     */
-   public String getConnectionParameters()
+   public String getStrConnectionParameters()
    {
       return strConnectionParameters;
    }
 
-   public Map<String, Object> getParsedConnectionParameters()
-   {
-      return connectionParameters;
-   }
 
    public void setConnectionParameters(final String configuration)
    {
       strConnectionParameters = configuration;
-      connectionParameters = Util.parseConfig(configuration);
+      setParsedConnectionParameters(Util.parseConfig(configuration));
    }
 
    /**
-    * @return the transportType
+    * @return the connectionParameters
     */
-   public String getConnectorClassName()
+   public String getBackupConnectionParameters()
    {
-      return connectorClassName;
+      return strBackupConnectionParameters;
    }
 
-   public void setConnectorClassName(final String value)
+   public void setBackupConnectionParameters(final String configuration)
    {
-      connectorClassName = value;
+      strBackupConnectionParameters = configuration;
+      setParsedBackupConnectionParameters(Util.parseConfig(configuration));
    }
-
+   
    /**
     * Set the default session type.
+    *
     * @param defaultType either javax.jms.Topic or javax.jms.Queue
     */
    public void setSessionDefaultType(final String defaultType)
@@ -154,6 +164,7 @@
 
    /**
     * Get the default session type.
+    *
     * @return The default session type
     */
    public String getSessionDefaultType()
@@ -179,6 +190,7 @@
 
    /**
     * Get the useTryLock.
+    *
     * @return the useTryLock.
     */
    public Integer getUseTryLock()
@@ -193,6 +205,7 @@
 
    /**
     * Set the useTryLock.
+    *
     * @param useTryLock the useTryLock.
     */
    public void setUseTryLock(final Integer useTryLock)
@@ -204,51 +217,4 @@
 
       this.useTryLock = useTryLock;
    }
-
-   /**
-    * Indicates whether some other object is "equal to" this one.
-    * @param obj Object with which to compare
-    * @return True if this object is the same as the obj argument; false otherwise.
-    */
-   @Override
-   public boolean equals(final Object obj)
-   {
-      if (trace)
-      {
-         log.trace("equals(" + obj + ")");
-      }
-
-      if (obj == null)
-      {
-         return false;
-      }
-
-      if (obj instanceof JBMMCFProperties)
-      {
-         JBMMCFProperties you = (JBMMCFProperties)obj;
-         return type == you.getType() && Util.compare(useTryLock, you.getUseTryLock());
-      }
-
-      return false;
-   }
-
-   /**
-    * Return the hash code for the object
-    * @return The hash code
-    */
-   @Override
-   public int hashCode()
-   {
-      if (trace)
-      {
-         log.trace("hashCode()");
-      }
-
-      int hash = 7;
-
-      hash += 31 * hash + Integer.valueOf(type).hashCode();
-      hash += 31 * hash + (useTryLock != null ? useTryLock.hashCode() : 0);
-
-      return hash;
-   }
 }

Modified: trunk/src/main/org/jboss/messaging/ra/JBMManagedConnectionFactory.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/JBMManagedConnectionFactory.java	2009-06-25 08:51:59 UTC (rev 7463)
+++ trunk/src/main/org/jboss/messaging/ra/JBMManagedConnectionFactory.java	2009-06-25 09:57:58 UTC (rev 7464)
@@ -21,9 +21,8 @@
  */
 package org.jboss.messaging.ra;
 
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.Set;
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.jms.client.JBossConnectionFactory;
 
 import javax.jms.ConnectionMetaData;
 import javax.resource.ResourceException;
@@ -34,38 +33,53 @@
 import javax.resource.spi.ResourceAdapter;
 import javax.resource.spi.ResourceAdapterAssociation;
 import javax.security.auth.Subject;
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.Set;
 
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.jms.client.JBossConnectionFactory;
-
 /**
  * JBM ManagedConectionFactory
- * 
+ *
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
  * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>.
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
  * @version $Revision: $
  */
 public class JBMManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation
 {
-   /** Serial version UID */
+   /**
+    * Serial version UID
+    */
    static final long serialVersionUID = -1452379518562456741L;
 
-   /** The logger */
+   /**
+    * The logger
+    */
    private static final Logger log = Logger.getLogger(JBMManagedConnectionFactory.class);
 
-   /** Trace enabled */
+   /**
+    * Trace enabled
+    */
    private static boolean trace = log.isTraceEnabled();
 
-   /** The resource adapter */
+   /**
+    * The resource adapter
+    */
    private JBMResourceAdapter ra;
 
-   /** Connection manager */
+   /**
+    * Connection manager
+    */
    private ConnectionManager cm;
 
-   /** The managed connection factory properties */
+   /**
+    * The managed connection factory properties
+    */
    private final JBMMCFProperties mcfProperties;
 
-   /** Connection Factory used if properties are set */
+   /**
+    * Connection Factory used if properties are set
+    */
    private JBossConnectionFactory connectionFactory;
 
    /**
@@ -85,8 +99,9 @@
 
    /**
     * Creates a Connection Factory instance
+    *
     * @return javax.resource.cci.ConnectionFactory instance
-    * @exception ResourceException Thrown if a connection factory cant be created
+    * @throws ResourceException Thrown if a connection factory cant be created
     */
    public Object createConnectionFactory() throws ResourceException
    {
@@ -100,9 +115,10 @@
 
    /**
     * Creates a Connection Factory instance
+    *
     * @param cxManager The connection manager
     * @return javax.resource.cci.ConnectionFactory instance
-    * @exception ResourceException Thrown if a connection factory cant be created
+    * @throws ResourceException Thrown if a connection factory cant be created
     */
    public Object createConnectionFactory(final ConnectionManager cxManager) throws ResourceException
    {
@@ -125,10 +141,11 @@
 
    /**
     * Creates a new physical connection to the underlying EIS resource manager.
-    * @param subject Caller's security information
+    *
+    * @param subject       Caller's security information
     * @param cxRequestInfo Additional resource adapter specific connection request information
     * @return The managed connection
-    * @exception ResourceException Thrown if a managed connection cant be created
+    * @throws ResourceException Thrown if a managed connection cant be created
     */
    public ManagedConnection createManagedConnection(final Subject subject, final ConnectionRequestInfo cxRequestInfo) throws ResourceException
    {
@@ -137,7 +154,7 @@
          log.trace("createManagedConnection(" + subject + ", " + cxRequestInfo + ")");
       }
 
-      JBMConnectionRequestInfo cri = getCRI((JBMConnectionRequestInfo)cxRequestInfo);
+      JBMConnectionRequestInfo cri = getCRI((JBMConnectionRequestInfo) cxRequestInfo);
 
       JBMCredential credential = JBMCredential.getCredential(this, subject, cri);
 
@@ -158,11 +175,12 @@
 
    /**
     * Returns a matched connection from the candidate set of connections.
+    *
     * @param connectionSet The candidate connection set
-    * @param subject Caller's security information
+    * @param subject       Caller's security information
     * @param cxRequestInfo Additional resource adapter specific connection request information
     * @return The managed connection
-    * @exception ResourceException Thrown if no managed connection cant be found
+    * @throws ResourceException Thrown if no managed connection cant be found
     */
    public ManagedConnection matchManagedConnections(final Set connectionSet,
                                                     final Subject subject,
@@ -173,7 +191,7 @@
          log.trace("matchManagedConnections(" + connectionSet + ", " + subject + ", " + cxRequestInfo + ")");
       }
 
-      JBMConnectionRequestInfo cri = getCRI((JBMConnectionRequestInfo)cxRequestInfo);
+      JBMConnectionRequestInfo cri = getCRI((JBMConnectionRequestInfo) cxRequestInfo);
       JBMCredential credential = JBMCredential.getCredential(this, subject, cri);
 
       if (trace)
@@ -189,11 +207,11 @@
 
          if (obj instanceof JBMManagedConnection)
          {
-            JBMManagedConnection mc = (JBMManagedConnection)obj;
+            JBMManagedConnection mc = (JBMManagedConnection) obj;
             ManagedConnectionFactory mcf = mc.getManagedConnectionFactory();
 
             if ((mc.getUserName() == null || mc.getUserName() != null && mc.getUserName()
-                                                                           .equals(credential.getUserName())) && mcf.equals(this))
+                  .equals(credential.getUserName())) && mcf.equals(this))
             {
                if (cri.equals(mc.getCRI()))
                {
@@ -218,8 +236,9 @@
 
    /**
     * Set the log writer -- NOT SUPPORTED
+    *
     * @param out The writer
-    * @exception ResourceException Thrown if the writer cant be set
+    * @throws ResourceException Thrown if the writer cant be set
     */
    public void setLogWriter(final PrintWriter out) throws ResourceException
    {
@@ -231,8 +250,9 @@
 
    /**
     * Get the log writer -- NOT SUPPORTED
+    *
     * @return The writer
-    * @exception ResourceException Thrown if the writer cant be retrieved
+    * @throws ResourceException Thrown if the writer cant be retrieved
     */
    public PrintWriter getLogWriter() throws ResourceException
    {
@@ -246,6 +266,7 @@
 
    /**
     * Get the resource adapter
+    *
     * @return The resource adapter
     */
    public ResourceAdapter getResourceAdapter()
@@ -260,8 +281,9 @@
 
    /**
     * Set the resource adapter
+    *
     * @param ra The resource adapter
-    * @exception ResourceException Thrown if incorrect resource adapter
+    * @throws ResourceException Thrown if incorrect resource adapter
     */
    public void setResourceAdapter(final ResourceAdapter ra) throws ResourceException
    {
@@ -275,11 +297,12 @@
          throw new ResourceException("Resource adapter is " + ra);
       }
 
-      this.ra = (JBMResourceAdapter)ra;
+      this.ra = (JBMResourceAdapter) ra;
    }
 
    /**
     * Indicates whether some other object is "equal to" this one.
+    *
     * @param obj Object with which to compare
     * @return True if this object is the same as the obj argument; false otherwise.
     */
@@ -298,7 +321,7 @@
 
       if (obj instanceof JBMManagedConnectionFactory)
       {
-         JBMManagedConnectionFactory other = (JBMManagedConnectionFactory)obj;
+         JBMManagedConnectionFactory other = (JBMManagedConnectionFactory) obj;
 
          return mcfProperties.equals(other.getProperties()) && ra.equals(other.getResourceAdapter());
       }
@@ -310,6 +333,7 @@
 
    /**
     * Return the hash code for the object
+    *
     * @return The hash code
     */
    @Override
@@ -328,6 +352,7 @@
 
    /**
     * Get the default session type
+    *
     * @return The value
     */
    public String getSessionDefaultType()
@@ -342,6 +367,7 @@
 
    /**
     * Set the default session type
+    *
     * @param type either javax.jms.Topic or javax.jms.Queue
     */
    public void setSessionDefaultType(final String type)
@@ -359,7 +385,7 @@
     */
    public String getConnectionParameters()
    {
-      return mcfProperties.getConnectionParameters();
+      return mcfProperties.getStrConnectionParameters();
    }
 
    public void setConnectionParameters(final String configuration)
@@ -367,6 +393,20 @@
       mcfProperties.setConnectionParameters(configuration);
    }
 
+   public String getBackupConnectorClassName() {return mcfProperties.getBackupConnectorClassName();}
+
+   public void setBackupConnectorClassName(String backupConnectorClassName)
+   {
+      mcfProperties.setBackupConnectorClassName(backupConnectorClassName);
+   }
+
+   public String getBackupConnectionParameters() {return mcfProperties.getBackupConnectionParameters();}
+
+   public void setBackupConnectionParameters(String configuration)
+   {
+      mcfProperties.setBackupConnectionParameters(configuration);
+   }
+
    /**
     * @return the transportType
     */
@@ -380,8 +420,292 @@
       mcfProperties.setConnectorClassName(value);
    }
 
+   public String getConnectionLoadBalancingPolicyClassName()
+   {
+      return mcfProperties.getConnectionLoadBalancingPolicyClassName();
+   }
+
+   public void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName)
+   {
+      mcfProperties.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
+   }
+
+   public String getDiscoveryAddress() {return mcfProperties.getDiscoveryAddress();}
+
+   public void setDiscoveryAddress(String discoveryAddress)
+   {
+      mcfProperties.setDiscoveryAddress(discoveryAddress);
+   }
+
+   public Integer getDiscoveryPort()
+   {
+      return mcfProperties.getDiscoveryPort();
+   }
+
+   public void setDiscoveryPort(Integer discoveryPort)
+   {
+      mcfProperties.setDiscoveryPort(discoveryPort);
+   }
+
+   public Long getDiscoveryRefreshTimeout()
+   {
+      return mcfProperties.getDiscoveryRefreshTimeout();
+   }
+
+   public void setDiscoveryRefreshTimeout(
+         Long discoveryRefreshTimeout)
+   {
+      mcfProperties.setDiscoveryRefreshTimeout(
+            discoveryRefreshTimeout);
+   }
+
+   public Long getDiscoveryInitialWaitTimeout()
+   {
+      return mcfProperties.getDiscoveryInitialWaitTimeout();
+   }
+
+   public void setDiscoveryInitialWaitTimeout(Long discoveryInitialWaitTimeout)
+   {
+      mcfProperties.setDiscoveryInitialWaitTimeout(discoveryInitialWaitTimeout);
+   }
+
+   public String getClientID()
+   {
+      return mcfProperties.getClientID();
+   }
+
+   public void setClientID(String clientID)
+   {
+      mcfProperties.setClientID(clientID);
+   }
+
+   public Integer getDupsOKBatchSize()
+   {
+      return mcfProperties.getDupsOKBatchSize();
+   }
+
+   public void setDupsOKBatchSize(Integer dupsOKBatchSize)
+   {
+      mcfProperties.setDupsOKBatchSize(dupsOKBatchSize);
+   }
+
+   public Integer getTransactionBatchSize()
+   {
+      return mcfProperties.getTransactionBatchSize();
+   }
+
+   public void setTransactionBatchSize(Integer transactionBatchSize)
+   {
+      mcfProperties.setTransactionBatchSize(transactionBatchSize);
+   }
+
+   public Long getClientFailureCheckPeriod()
+   {
+      return mcfProperties.getClientFailureCheckPeriod();
+   }
+
+   public void setClientFailureCheckPeriod(Long clientFailureCheckPeriod)
+   {
+      mcfProperties.setClientFailureCheckPeriod(clientFailureCheckPeriod);
+   }
+
+   public Long getConnectionTTL()
+   {
+      return mcfProperties.getConnectionTTL();
+   }
+
+   public void setConnectionTTL(Long connectionTTL)
+   {
+      mcfProperties.setConnectionTTL(connectionTTL);
+   }
+
+   public Long getCallTimeout()
+   {
+      return mcfProperties.getCallTimeout();
+   }
+
+   public void setCallTimeout(Long callTimeout)
+   {
+      mcfProperties.setCallTimeout(callTimeout);
+   }
+
+   public Integer getConsumerWindowSize()
+   {
+      return mcfProperties.getConsumerWindowSize();
+   }
+
+   public void setConsumerWindowSize(Integer consumerWindowSize)
+   {
+      mcfProperties.setConsumerWindowSize(consumerWindowSize);
+   }
+
+   public Integer getConsumerMaxRate()
+   {
+      return mcfProperties.getConsumerMaxRate();
+   }
+
+   public void setConsumerMaxRate(Integer consumerMaxRate)
+   {
+      mcfProperties.setConsumerMaxRate(consumerMaxRate);
+   }
+
+   public Integer getProducerWindowSize()
+   {
+      return mcfProperties.getProducerWindowSize();
+   }
+
+   public void setProducerWindowSize(Integer producerWindowSize)
+   {
+      mcfProperties.setProducerWindowSize(producerWindowSize);
+   }
+
+   public Integer getProducerMaxRate()
+   {
+      return mcfProperties.getProducerMaxRate();
+   }
+
+   public void setProducerMaxRate(Integer producerMaxRate)
+   {
+      mcfProperties.setProducerMaxRate(producerMaxRate);
+   }
+
+   public Integer getMinLargeMessageSize()
+   {
+      return mcfProperties.getMinLargeMessageSize();
+   }
+
+   public void setMinLargeMessageSize(Integer minLargeMessageSize)
+   {
+      mcfProperties.setMinLargeMessageSize(minLargeMessageSize);
+   }
+
+   public Boolean isBlockOnAcknowledge()
+   {
+      return mcfProperties.isBlockOnAcknowledge();
+   }
+
+   public void setBlockOnAcknowledge(Boolean blockOnAcknowledge)
+   {
+      mcfProperties.setBlockOnAcknowledge(blockOnAcknowledge);
+   }
+
+   public Boolean isBlockOnNonPersistentSend() {return mcfProperties.isBlockOnNonPersistentSend();}
+
+   public void setBlockOnNonPersistentSend(Boolean blockOnNonPersistentSend)
+   {
+      mcfProperties.setBlockOnNonPersistentSend(blockOnNonPersistentSend);
+   }
+
+   public Boolean isBlockOnPersistentSend() {return mcfProperties.isBlockOnPersistentSend();}
+
+   public void setBlockOnPersistentSend(Boolean blockOnPersistentSend)
+   {
+      mcfProperties.setBlockOnPersistentSend(blockOnPersistentSend);
+   }
+
+   public Boolean isAutoGroup()
+   {
+      return mcfProperties.isAutoGroup();
+   }
+
+   public void setAutoGroup(Boolean autoGroup)
+   {
+      mcfProperties.setAutoGroup(autoGroup);
+   }
+
+   public Integer getMaxConnections()
+   {
+      return mcfProperties.getMaxConnections();
+   }
+
+   public void setMaxConnections(Integer maxConnections)
+   {
+      mcfProperties.setMaxConnections(maxConnections);
+   }
+
+   public Boolean isPreAcknowledge()
+   {
+      return mcfProperties.isPreAcknowledge();
+   }
+
+   public void setPreAcknowledge(Boolean preAcknowledge)
+   {
+      mcfProperties.setPreAcknowledge(preAcknowledge);
+   }
+
+   public Long getRetryInterval()
+   {
+      return mcfProperties.getRetryInterval();
+   }
+
+   public void setRetryInterval(Long retryInterval)
+   {
+      mcfProperties.setRetryInterval(retryInterval);
+   }
+
+   public Double getRetryIntervalMultiplier()
+   {
+      return mcfProperties.getRetryIntervalMultiplier();
+   }
+
+   public void setRetryIntervalMultiplier(Double retryIntervalMultiplier)
+   {
+      mcfProperties.setRetryIntervalMultiplier(retryIntervalMultiplier);
+   }
+
+   public Integer getReconnectAttempts()
+   {
+      return mcfProperties.getReconnectAttempts();
+   }
+
+   public void setReconnectAttempts(Integer reconnectAttempts)
+   {
+      mcfProperties.setReconnectAttempts(reconnectAttempts);
+   }
+
+   public Boolean isFailoverOnServerShutdown()
+   {
+      return mcfProperties.isFailoverOnServerShutdown();
+   }
+
+   public void setFailoverOnServerShutdown(Boolean failoverOnServerShutdown)
+   {
+      mcfProperties.setFailoverOnServerShutdown(failoverOnServerShutdown);
+   }
+
+   public Boolean isUseGlobalPools()
+   {
+      return mcfProperties.isUseGlobalPools();
+   }
+
+   public void setUseGlobalPools(Boolean useGlobalPools)
+   {
+      mcfProperties.setUseGlobalPools(useGlobalPools);
+   }
+
+   public Integer getScheduledThreadPoolMaxSize()
+   {
+      return mcfProperties.getScheduledThreadPoolMaxSize();
+   }
+
+   public void setScheduledThreadPoolMaxSize(Integer scheduledThreadPoolMaxSize)
+   {
+      mcfProperties.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
+   }
+
+   public Integer getThreadPoolMaxSize()
+   {
+      return mcfProperties.getThreadPoolMaxSize();
+   }
+
+   public void setThreadPoolMaxSize(Integer threadPoolMaxSize)
+   {
+      mcfProperties.setThreadPoolMaxSize(threadPoolMaxSize);
+   }
+
    /**
     * Get the useTryLock.
+    *
     * @return the useTryLock.
     */
    public Integer getUseTryLock()
@@ -396,6 +720,7 @@
 
    /**
     * Set the useTryLock.
+    *
     * @param useTryLock the useTryLock.
     */
    public void setUseTryLock(final Integer useTryLock)
@@ -410,6 +735,7 @@
 
    /**
     * Get the connection metadata
+    *
     * @return The metadata
     */
    public ConnectionMetaData getMetaData()
@@ -424,11 +750,12 @@
 
    /**
     * Get the JBoss connection factory
+    *
     * @return The factory
     */
    protected synchronized JBossConnectionFactory getJBossConnectionFactory() throws ResourceException
    {
-      if (mcfProperties.getConnectorClassName() != null)
+      /*if (mcfProperties.getConnectorClassName() != null)
       {
          if (connectionFactory == null)
          {
@@ -440,12 +767,18 @@
       }
       else
       {
-         return ra.getJBossConnectionFactory();
+         return ra.getDefaultJBossConnectionFactory();
+      }*/
+      if(connectionFactory == null)
+      {
+         connectionFactory = ra.createJBossConnectionFactory(mcfProperties);
       }
+      return connectionFactory;
    }
 
    /**
     * Get the managed connection factory properties
+    *
     * @return The properties
     */
    protected JBMMCFProperties getProperties()
@@ -460,6 +793,7 @@
 
    /**
     * Get a connection request info instance
+    *
     * @param info The instance that should be updated; may be <code>null</code>
     * @return The instance
     */

Modified: trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java	2009-06-25 08:51:59 UTC (rev 7463)
+++ trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java	2009-06-25 09:57:58 UTC (rev 7464)
@@ -21,12 +21,10 @@
  */
 package org.jboss.messaging.ra;
 
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
 import org.jboss.messaging.core.logging.Logger;
 
+import java.io.Serializable;
+
 /**
  * The RA default properties - these are set in the ra.xml file
  *
@@ -35,7 +33,7 @@
  * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
  * @version $Revision: $
  */
-public class JBMRAProperties implements Serializable
+public class JBMRAProperties extends ConnectionFactoryProperties implements Serializable
 {
    /** Serial version UID */
    static final long serialVersionUID = -2772367477755473248L;
@@ -46,102 +44,15 @@
    /** Trace enabled */
    private static boolean trace = log.isTraceEnabled();
 
-   /** The discovery group name */
-   private String discoveryGroupAddress;
-
-   /** The discovery group port */
-   private Integer discoveryGroupPort;
-
-   /** */
-   private Long discoveryRefreshTimeout;
-
-   /** */
-   private Long discoveryInitialWaitTimeout;
-
-   /** */
-   private String connectionLoadBalancingPolicyClassName;
-
-   /** */
-   private Long clientFailureCheckPeriod;
-
-   /** */
-   private Long connectionTTL;
-
-   /** */
-   private Long callTimeout;
-
-   /** */
-   private Integer dupsOKBatchSize;
-
-   /** */
-   private Integer transactionBatchSize;
-
-   /** */
-   private Integer consumerWindowSize;
-
-   /** */
-   private Integer consumerMaxRate;
-
-   /** */
-   private Integer producerWindowSize;
-
-   /** */
-   private Integer producerMaxRate;
-
-   /** */
-   private Integer minLargeMessageSize;
-
-   /** */
-   private Boolean blockOnAcknowledge;
-
-   /** */
-   private Boolean blockOnNonPersistentSend;
-
-   /** */
-   private Boolean blockOnPersistentSend;
-
-   /** */
-   private Boolean autoGroup;
-
-   /** */
-   private Integer maxConnections;
-
-   /** */
-   private Boolean preAcknowledge;
-
-   /** */
-   private Long retryInterval;
-
-   /** */
-   private Double retryIntervalMultiplier;
-
-   /** */
-   private Integer reconnectAttempts;
-
-   /** */
-   private Boolean failoverOnServerShutdown;
-
    /** The user name */
    private String userName;
 
    /** The password */
    private String password;
 
-   /** The client ID */
-   private String clientID;
-
    /** Use XA */
    private Boolean useXA;
 
-   /* the transport type*/
-   private String connectorClassName;
-
-   private Map<String, Object> connectionParameters = new HashMap<String, Object>();
-
-   private Map<String, Object> backupConnectionParameters = new HashMap<String, Object>();
-
-   private String backupConnectorClassName;
-
    /**
     * Constructor
     */
@@ -153,707 +64,9 @@
       }
    }
 
-   /**
-    * Get the discovery group name
-    * @return The value
-    */
-   public String getDiscoveryGroupAddress()
-   {
-      if (trace)
-      {
-         log.trace("getDiscoveryGroupAddress()");
-      }
 
-      return discoveryGroupAddress;
-   }
 
    /**
-    * Set the discovery group name
-    * @param dgn The value
-    */
-   public void setDiscoveryGroupAddress(final String dgn)
-   {
-      if (trace)
-      {
-         log.trace("setDiscoveryGroupAddress(" + dgn + ")");
-      }
-
-      discoveryGroupAddress = dgn;
-   }
-
-   /**
-    * Get the discovery group port
-    * @return The value
-    */
-   public Integer getDiscoveryGroupPort()
-   {
-      if (trace)
-      {
-         log.trace("getDiscoveryGroupPort()");
-      }
-
-      return discoveryGroupPort;
-   }
-
-   /**
-    * Set the discovery group port
-    * @param dgp The value
-    */
-   public void setDiscoveryGroupPort(final Integer dgp)
-   {
-      if (trace)
-      {
-         log.trace("setDiscoveryGroupPort(" + dgp + ")");
-      }
-
-      discoveryGroupPort = dgp;
-   }
-
-   /**
-    * Get discovery refresh timeout
-    * @return The value
-    */
-   public Long getDiscoveryRefreshTimeout()
-   {
-      if (trace)
-      {
-         log.trace("getDiscoveryRefreshTimeout()");
-      }
-
-      return discoveryRefreshTimeout;
-   }
-
-   /**
-    * Set discovery refresh timeout
-    * @param discoveryRefreshTimeout The value
-    */
-   public void setDiscoveryRefreshTimeout(final Long discoveryRefreshTimeout)
-   {
-      if (trace)
-      {
-         log.trace("setDiscoveryRefreshTimeout(" + discoveryRefreshTimeout + ")");
-      }
-
-      this.discoveryRefreshTimeout = discoveryRefreshTimeout;
-   }
-
-   /**
-    * Get discovery initial wait timeout
-    * @return The value
-    */
-   public Long getDiscoveryInitialWaitTimeout()
-   {
-      if (trace)
-      {
-         log.trace("getDiscoveryInitialWaitTimeout()");
-      }
-
-      return discoveryInitialWaitTimeout;
-   }
-
-   /**
-    * Set discovery initial wait timeout
-    * @param discoveryInitialWaitTimeout The value
-    */
-   public void setDiscoveryInitialWaitTimeout(final Long discoveryInitialWaitTimeout)
-   {
-      if (trace)
-      {
-         log.trace("setDiscoveryInitialWaitTimeout(" + discoveryInitialWaitTimeout + ")");
-      }
-
-      this.discoveryInitialWaitTimeout = discoveryInitialWaitTimeout;
-   }
-
-   /**
-    * Get load balancing policy class name
-    * @return The value
-    */
-   public String getConnectionLoadBalancingPolicyClassName()
-   {
-      if (trace)
-      {
-         log.trace("getLoadBalancingPolicyClassName()");
-      }
-
-      return connectionLoadBalancingPolicyClassName;
-   }
-
-   /**
-    * Set load balancing policy class name
-    * @param connectionLoadBalancingPolicyClassName The value
-    */
-   public void setConnectionLoadBalancingPolicyClassName(final String loadBalancingPolicyClassName)
-   {
-      if (trace)
-      {
-         log.trace("setLoadBalancingPolicyClassName(" + loadBalancingPolicyClassName + ")");
-      }
-
-      this.connectionLoadBalancingPolicyClassName = loadBalancingPolicyClassName;
-   }
-
-   /**
-    * Get client failure check period
-    * @return The value
-    */
-   public Long getClientFailureCheckPeriod()
-   {
-      if (trace)
-      {
-         log.trace("getClientFailureCheckPeriod()");
-      }
-
-      return clientFailureCheckPeriod;
-   }
-
-   /**
-    * Set client failure check period
-    * @param clientFailureCheckPeriod The value
-    */
-   public void setClientFailureCheckPeriod(final Long clientFailureCheckPeriod)
-   {
-      if (trace)
-      {
-         log.trace("setClientFailureCheckPeriod(" + clientFailureCheckPeriod + ")");
-      }
-
-      this.clientFailureCheckPeriod = clientFailureCheckPeriod;
-   }
-
-   /**
-    * Get connection TTL
-    * @return The value
-    */
-   public Long getConnectionTTL()
-   {
-      if (trace)
-      {
-         log.trace("getConnectionTTL()");
-      }
-
-      return connectionTTL;
-   }
-
-   /**
-    * Set connection TTL
-    * @param connectionTTL The value
-    */
-   public void setConnectionTTL(final Long connectionTTL)
-   {
-      if (trace)
-      {
-         log.trace("setConnectionTTL(" + connectionTTL + ")");
-      }
-
-      this.connectionTTL = connectionTTL;
-   }
-
-   /**
-    * Get call timeout
-    * @return The value
-    */
-   public Long getCallTimeout()
-   {
-      if (trace)
-      {
-         log.trace("getCallTimeout()");
-      }
-
-      return callTimeout;
-   }
-
-   /**
-    * Set call timeout
-    * @param callTimeout The value
-    */
-   public void setCallTimeout(final Long callTimeout)
-   {
-      if (trace)
-      {
-         log.trace("setCallTimeout(" + callTimeout + ")");
-      }
-
-      this.callTimeout = callTimeout;
-   }
-
-   /**
-    * Get dups ok batch size
-    * @return The value
-    */
-   public Integer getDupsOKBatchSize()
-   {
-      if (trace)
-      {
-         log.trace("getDupsOKBatchSize()");
-      }
-
-      return dupsOKBatchSize;
-   }
-
-   /**
-    * Set dups ok batch size
-    * @param dupsOKBatchSize The value
-    */
-   public void setDupsOKBatchSize(final Integer dupsOKBatchSize)
-   {
-      if (trace)
-      {
-         log.trace("setDupsOKBatchSize(" + dupsOKBatchSize + ")");
-      }
-
-      this.dupsOKBatchSize = dupsOKBatchSize;
-   }
-
-   /**
-    * Get transaction batch size
-    * @return The value
-    */
-   public Integer getTransactionBatchSize()
-   {
-      if (trace)
-      {
-         log.trace("getTransactionBatchSize()");
-      }
-
-      return transactionBatchSize;
-   }
-
-   /**
-    * Set transaction batch size
-    * @param transactionBatchSize The value
-    */
-   public void setTransactionBatchSize(final Integer transactionBatchSize)
-   {
-      if (trace)
-      {
-         log.trace("setTransactionBatchSize(" + transactionBatchSize + ")");
-      }
-
-      this.transactionBatchSize = transactionBatchSize;
-   }
-
-   /**
-    * Get consumer window size
-    * @return The value
-    */
-   public Integer getConsumerWindowSize()
-   {
-      if (trace)
-      {
-         log.trace("getConsumerWindowSize()");
-      }
-
-      return consumerWindowSize;
-   }
-
-   /**
-    * Set consumer window size
-    * @param consumerWindowSize The value
-    */
-   public void setConsumerWindowSize(final Integer consumerWindowSize)
-   {
-      if (trace)
-      {
-         log.trace("setConsumerWindowSize(" + consumerWindowSize + ")");
-      }
-
-      this.consumerWindowSize = consumerWindowSize;
-   }
-
-   /**
-    * Get consumer max rate
-    * @return The value
-    */
-   public Integer getConsumerMaxRate()
-   {
-      if (trace)
-      {
-         log.trace("getConsumerMaxRate()");
-      }
-
-      return consumerMaxRate;
-   }
-
-   /**
-    * Set consumer max rate
-    * @param consumerMaxRate The value
-    */
-   public void setConsumerMaxRate(final Integer consumerMaxRate)
-   {
-      if (trace)
-      {
-         log.trace("setConsumerMaxRate(" + consumerMaxRate + ")");
-      }
-
-      this.consumerMaxRate = consumerMaxRate;
-   }
-
-   /**
-    * Get producer window size
-    * @return The value
-    */
-   public Integer getProducerWindowSize()
-   {
-      if (trace)
-      {
-         log.trace("getProducerWindowSize()");
-      }
-
-      return producerWindowSize;
-   }
-
-   /**
-    * Set producer window size
-    * @param producerWindowSize The value
-    */
-   public void setProducerWindowSize(final Integer producerWindowSize)
-   {
-      if (trace)
-      {
-         log.trace("setProducerWindowSize(" + producerWindowSize + ")");
-      }
-
-      this.producerWindowSize = producerWindowSize;
-   }
-
-   /**
-    * Get producer max rate
-    * @return The value
-    */
-   public Integer getProducerMaxRate()
-   {
-      if (trace)
-      {
-         log.trace("getProducerMaxRate()");
-      }
-
-      return producerMaxRate;
-   }
-
-   /**
-    * Set producer max rate
-    * @param producerMaxRate The value
-    */
-   public void setProducerMaxRate(final Integer producerMaxRate)
-   {
-      if (trace)
-      {
-         log.trace("setProducerMaxRate(" + producerMaxRate + ")");
-      }
-
-      this.producerMaxRate = producerMaxRate;
-   }
-
-   /**
-    * Get min large message size
-    * @return The value
-    */
-   public Integer getMinLargeMessageSize()
-   {
-      if (trace)
-      {
-         log.trace("getMinLargeMessageSize()");
-      }
-
-      return minLargeMessageSize;
-   }
-
-   /**
-    * Set min large message size
-    * @param minLargeMessageSize The value
-    */
-   public void setMinLargeMessageSize(final Integer minLargeMessageSize)
-   {
-      if (trace)
-      {
-         log.trace("setMinLargeMessageSize(" + minLargeMessageSize + ")");
-      }
-
-      this.minLargeMessageSize = minLargeMessageSize;
-   }
-
-   /**
-    * Get block on acknowledge
-    * @return The value
-    */
-   public Boolean getBlockOnAcknowledge()
-   {
-      if (trace)
-      {
-         log.trace("getBlockOnAcknowledge()");
-      }
-
-      return blockOnAcknowledge;
-   }
-
-   /**
-    * Set block on acknowledge
-    * @param blockOnAcknowledge The value
-    */
-   public void setBlockOnAcknowledge(final Boolean blockOnAcknowledge)
-   {
-      if (trace)
-      {
-         log.trace("setBlockOnAcknowledge(" + blockOnAcknowledge + ")");
-      }
-
-      this.blockOnAcknowledge = blockOnAcknowledge;
-   }
-
-   /**
-    * Get block on non persistent send
-    * @return The value
-    */
-   public Boolean getBlockOnNonPersistentSend()
-   {
-      if (trace)
-      {
-         log.trace("getBlockOnNonPersistentSend()");
-      }
-
-      return blockOnNonPersistentSend;
-   }
-
-   /**
-    * Set block on non persistent send
-    * @param blockOnNonPersistentSend The value
-    */
-   public void setBlockOnNonPersistentSend(final Boolean blockOnNonPersistentSend)
-   {
-      if (trace)
-      {
-         log.trace("setBlockOnNonPersistentSend(" + blockOnNonPersistentSend + ")");
-      }
-
-      this.blockOnNonPersistentSend = blockOnNonPersistentSend;
-   }
-
-   /**
-    * Get block on persistent send
-    * @return The value
-    */
-   public Boolean getBlockOnPersistentSend()
-   {
-      if (trace)
-      {
-         log.trace("getBlockOnPersistentSend()");
-      }
-
-      return blockOnPersistentSend;
-   }
-
-   /**
-    * Set block on persistent send
-    * @param blockOnPersistentSend The value
-    */
-   public void setBlockOnPersistentSend(final Boolean blockOnPersistentSend)
-   {
-      if (trace)
-      {
-         log.trace("setBlockOnPersistentSend(" + blockOnPersistentSend + ")");
-      }
-
-      this.blockOnPersistentSend = blockOnPersistentSend;
-   }
-
-   /**
-    * Get auto group
-    * @return The value
-    */
-   public Boolean getAutoGroup()
-   {
-      if (trace)
-      {
-         log.trace("getAutoGroup()");
-      }
-
-      return autoGroup;
-   }
-
-   /**
-    * Set auto group
-    * @param autoGroup The value
-    */
-   public void setAutoGroup(final Boolean autoGroup)
-   {
-      if (trace)
-      {
-         log.trace("setAutoGroup(" + autoGroup + ")");
-      }
-
-      this.autoGroup = autoGroup;
-   }
-
-   /**
-    * Get max connections
-    * @return The value
-    */
-   public Integer getMaxConnections()
-   {
-      if (trace)
-      {
-         log.trace("getMaxConnections()");
-      }
-
-      return maxConnections;
-   }
-
-   /**
-    * Set max connections
-    * @param maxConnections The value
-    */
-   public void setMaxConnections(final Integer maxConnections)
-   {
-      if (trace)
-      {
-         log.trace("setMaxConnections(" + maxConnections + ")");
-      }
-
-      this.maxConnections = maxConnections;
-   }
-
-   /**
-    * Get pre acknowledge
-    * @return The value
-    */
-   public Boolean getPreAcknowledge()
-   {
-      if (trace)
-      {
-         log.trace("getPreAcknowledge()");
-      }
-
-      return preAcknowledge;
-   }
-
-   /**
-    * Set pre acknowledge
-    * @param preAcknowledge The value
-    */
-   public void setPreAcknowledge(final Boolean preAcknowledge)
-   {
-      if (trace)
-      {
-         log.trace("setPreAcknowledge(" + preAcknowledge + ")");
-      }
-
-      this.preAcknowledge = preAcknowledge;
-   }
-
-   /**
-    * Get retry interval
-    * @return The value
-    */
-   public Long getRetryInterval()
-   {
-      if (trace)
-      {
-         log.trace("getRetryInterval()");
-      }
-
-      return retryInterval;
-   }
-
-   /**
-    * Set retry interval
-    * @param retryInterval The value
-    */
-   public void setRetryInterval(final Long retryInterval)
-   {
-      if (trace)
-      {
-         log.trace("setRetryInterval(" + retryInterval + ")");
-      }
-
-      this.retryInterval = retryInterval;
-   }
-
-   /**
-    * Get retry interval multiplier
-    * @return The value
-    */
-   public Double getRetryIntervalMultiplier()
-   {
-      if (trace)
-      {
-         log.trace("getRetryIntervalMultiplier()");
-      }
-
-      return retryIntervalMultiplier;
-   }
-
-   /**
-    * Set retry interval multiplier
-    * @param retryIntervalMultiplier The value
-    */
-   public void setRetryIntervalMultiplier(final Double retryIntervalMultiplier)
-   {
-      if (trace)
-      {
-         log.trace("setRetryIntervalMultiplier(" + retryIntervalMultiplier + ")");
-      }
-
-      this.retryIntervalMultiplier = retryIntervalMultiplier;
-   }
-
-   /**
-    * Get reconnect attempts
-    * @return The value
-    */
-   public Integer getReconnectAttempts()
-   {
-      if (trace)
-      {
-         log.trace("getReconnectAttempts()");
-      }
-
-      return reconnectAttempts;
-   }
-
-   /**
-    * Set reconnect attempts
-    * @param reconnectAttempts The value
-    */
-   public void setReconnectAttempts(final Integer reconnectAttempts)
-   {
-      if (trace)
-      {
-         log.trace("setReconnectAttempts(" + reconnectAttempts + ")");
-      }
-
-      this.reconnectAttempts = reconnectAttempts;
-   }
-
-   /**
-    * Get failover on server shutdowns
-    * @return The value
-    */
-   public Boolean isFailoverOnServerShutdown()
-   {
-      if (trace)
-      {
-         log.trace("isFailoverOnServerShutdown()");
-      }
-
-      return failoverOnServerShutdown;
-   }
-
-   /**
-    * Set failover on server shutdown
-    * @param failoverOnServerShutdown The value
-    */
-   public void setFailoverOnServerShutdown(final Boolean failoverOnServerShutdown)
-   {
-      if (trace)
-      {
-         log.trace("setFailoverOnServerShutdown(" + failoverOnServerShutdown + ")");
-      }
-
-      this.failoverOnServerShutdown = failoverOnServerShutdown;
-   }
-
-   /**
     * Get the user name
     * @return The value
     */
@@ -909,35 +122,8 @@
       this.password = password;
    }
 
-   /**
-    * Get the client id
-    * @return The value
-    */
-   public String getClientID()
-   {
-      if (trace)
-      {
-         log.trace("getClientID()");
-      }
 
-      return clientID;
-   }
-
    /**
-    * Set the client id
-    * @param clientID The value
-    */
-   public void setClientID(final String clientID)
-   {
-      if (trace)
-      {
-         log.trace("setClientID(" + clientID + ")");
-      }
-
-      this.clientID = clientID;
-   }
-
-   /**
     * Get the use XA flag
     * @return The value
     */
@@ -983,146 +169,5 @@
 
       return useXA.booleanValue();
    }
-
-   /**
-    * Indicates whether some other object is "equal to" this one.
-    * @param obj Object with which to compare
-    * @return True if this object is the same as the obj argument; false otherwise.
-    */
-   @Override
-   public boolean equals(final Object obj)
-   {
-      if (trace)
-      {
-         log.trace("equals(" + obj + ")");
-      }
-
-      if (obj == null)
-      {
-         return false;
-      }
-
-      if (obj instanceof JBMRAProperties)
-      {
-         JBMRAProperties you = (JBMRAProperties)obj;
-         return Util.compare(discoveryGroupAddress, you.getDiscoveryGroupAddress()) && Util.compare(discoveryGroupPort,
-                                                                                                    you.getDiscoveryGroupPort()) &&
-                Util.compare(discoveryRefreshTimeout, you.getDiscoveryRefreshTimeout()) &&
-                Util.compare(discoveryInitialWaitTimeout, you.getDiscoveryInitialWaitTimeout()) &&
-                Util.compare(connectionLoadBalancingPolicyClassName, you.getConnectionLoadBalancingPolicyClassName()) &&
-                Util.compare(clientFailureCheckPeriod, you.getClientFailureCheckPeriod()) &&
-                Util.compare(connectionTTL, you.getConnectionTTL()) &&
-                Util.compare(callTimeout, you.getCallTimeout()) &&
-                Util.compare(dupsOKBatchSize, you.getDupsOKBatchSize()) &&
-                Util.compare(transactionBatchSize, you.getTransactionBatchSize()) &&
-                Util.compare(consumerWindowSize, you.getConsumerWindowSize()) &&
-                Util.compare(consumerMaxRate, you.getConsumerMaxRate()) &&
-                Util.compare(producerWindowSize, you.getProducerWindowSize()) &&
-                Util.compare(producerMaxRate, you.getProducerMaxRate()) &&
-                Util.compare(minLargeMessageSize, you.getMinLargeMessageSize()) &&
-                Util.compare(blockOnAcknowledge, you.getBlockOnAcknowledge()) &&
-                Util.compare(blockOnNonPersistentSend, you.getBlockOnNonPersistentSend()) &&
-                Util.compare(blockOnPersistentSend, you.getBlockOnPersistentSend()) &&
-                Util.compare(autoGroup, you.getAutoGroup()) &&
-                Util.compare(maxConnections, you.getMaxConnections()) &&
-                Util.compare(preAcknowledge, you.getPreAcknowledge()) &&
-                Util.compare(retryInterval, you.getRetryInterval()) &&
-                Util.compare(retryIntervalMultiplier, you.getRetryIntervalMultiplier()) &&
-                Util.compare(reconnectAttempts, you.getReconnectAttempts()) &&
-                Util.compare(failoverOnServerShutdown, you.isFailoverOnServerShutdown()) &&
-                Util.compare(userName, you.getUserName()) &&
-                Util.compare(password, you.getPassword()) &&
-                Util.compare(clientID, you.getClientID()) &&
-                Util.compare(useXA, you.getUseXA());
-      }
-
-      return false;
-   }
-
-   /**
-    * Return the hash code for the object
-    * @return The hash code
-    */
-   @Override
-   public int hashCode()
-   {
-      if (trace)
-      {
-         log.trace("hashCode()");
-      }
-
-      int hash = 7;
-
-      hash += 31 * hash + (discoveryGroupAddress != null ? discoveryGroupAddress.hashCode() : 0);
-      hash += 31 * hash + (discoveryGroupPort != null ? discoveryGroupPort.hashCode() : 0);
-      hash += 31 * hash + (discoveryRefreshTimeout != null ? discoveryRefreshTimeout.hashCode() : 0);
-      hash += 31 * hash + (discoveryInitialWaitTimeout != null ? discoveryInitialWaitTimeout.hashCode() : 0);
-      hash += 31 * hash + (connectionLoadBalancingPolicyClassName != null ? connectionLoadBalancingPolicyClassName.hashCode() : 0);
-      hash += 31 * hash + (clientFailureCheckPeriod != null ? clientFailureCheckPeriod.hashCode() : 0);
-      hash += 31 * hash + (connectionTTL != null ? connectionTTL.hashCode() : 0);
-      hash += 31 * hash + (callTimeout != null ? callTimeout.hashCode() : 0);
-      hash += 31 * hash + (dupsOKBatchSize != null ? dupsOKBatchSize.hashCode() : 0);
-      hash += 31 * hash + (transactionBatchSize != null ? transactionBatchSize.hashCode() : 0);
-      hash += 31 * hash + (consumerWindowSize != null ? consumerWindowSize.hashCode() : 0);
-      hash += 31 * hash + (consumerMaxRate != null ? consumerMaxRate.hashCode() : 0);
-      hash += 31 * hash + (producerWindowSize != null ? producerWindowSize.hashCode() : 0);
-      hash += 31 * hash + (producerMaxRate != null ? producerMaxRate.hashCode() : 0);
-      hash += 31 * hash + (minLargeMessageSize != null ? minLargeMessageSize.hashCode() : 0);
-      hash += 31 * hash + (blockOnAcknowledge != null ? blockOnAcknowledge.hashCode() : 0);
-      hash += 31 * hash + (blockOnNonPersistentSend != null ? blockOnNonPersistentSend.hashCode() : 0);
-      hash += 31 * hash + (blockOnPersistentSend != null ? blockOnPersistentSend.hashCode() : 0);
-      hash += 31 * hash + (autoGroup != null ? autoGroup.hashCode() : 0);
-      hash += 31 * hash + (maxConnections != null ? maxConnections.hashCode() : 0);
-      hash += 31 * hash + (preAcknowledge != null ? preAcknowledge.hashCode() : 0);
-      hash += 31 * hash + (retryInterval != null ? retryInterval.hashCode() : 0);
-      hash += 31 * hash + (retryIntervalMultiplier != null ? retryIntervalMultiplier.hashCode() : 0);
-      hash += 31 * hash + (reconnectAttempts != null ? reconnectAttempts.hashCode() : 0);
-      hash += 31 * hash + (failoverOnServerShutdown != null ? failoverOnServerShutdown.hashCode() : 0);
-      hash += 31 * hash + (userName != null ? userName.hashCode() : 0);
-      hash += 31 * hash + (password != null ? password.hashCode() : 0);
-      hash += 31 * hash + (clientID != null ? clientID.hashCode() : 0);
-      hash += 31 * hash + (useXA != null ? useXA.hashCode() : 0);
-      hash += 31 * hash + (connectorClassName != null ? connectorClassName.hashCode() : 0);
-      return hash;
-   }
-
-   public void setConnectorClassName(final String connectorClassName)
-   {
-      this.connectorClassName = connectorClassName;
-   }
-
-   public String getConnectorClassName()
-   {
-      return connectorClassName;
-   }
-
-   public void setConnectionParameters(final Map<String, Object> config)
-   {
-      connectionParameters = config;
-   }
-
-   public Map<String, Object> getConnectionParameters()
-   {
-      return connectionParameters;
-   }
-
-   public Map<String, Object> getBackupConnectionParameters()
-   {
-      return backupConnectionParameters;
-   }
-
-   public void setBackupConnectionParameters(final Map<String, Object> config)
-   {
-      backupConnectionParameters = config;
-   }
-
-   public String getBackupConnectorClassName()
-   {
-      return backupConnectorClassName;
-   }
-
-   public void setBackupConnectorClassName(final String connectorClassName)
-   {
-      backupConnectorClassName = connectorClassName;
-   }
+   
 }

Modified: trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java	2009-06-25 08:51:59 UTC (rev 7463)
+++ trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java	2009-06-25 09:57:58 UTC (rev 7464)
@@ -21,9 +21,16 @@
  */
 package org.jboss.messaging.ra;
 
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
+import org.jboss.messaging.core.client.ClientSession;
+import org.jboss.messaging.core.client.ClientSessionFactory;
+import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
+import org.jboss.messaging.core.config.TransportConfiguration;
+import org.jboss.messaging.core.exception.MessagingException;
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.jms.client.JBossConnectionFactory;
+import org.jboss.messaging.jms.client.JBossSession;
+import org.jboss.messaging.ra.inflow.JBMActivation;
+import org.jboss.messaging.ra.inflow.JBMActivationSpec;
 
 import javax.jms.Session;
 import javax.resource.ResourceException;
@@ -34,18 +41,10 @@
 import javax.resource.spi.endpoint.MessageEndpointFactory;
 import javax.resource.spi.work.WorkManager;
 import javax.transaction.xa.XAResource;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.jboss.messaging.core.client.ClientSession;
-import org.jboss.messaging.core.client.ClientSessionFactory;
-import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
-import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.exception.MessagingException;
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.jms.client.JBossConnectionFactory;
-import org.jboss.messaging.jms.client.JBossSession;
-import org.jboss.messaging.ra.inflow.JBMActivation;
-import org.jboss.messaging.ra.inflow.JBMActivationSpec;
-
 /**
  * The resource adapter for JBoss Messaging
  *
@@ -91,7 +90,7 @@
     */
    private final Map<ActivationSpec, JBMActivation> activations;
 
-   private JBossConnectionFactory jBossConnectionFactory;
+   private JBossConnectionFactory defaultJBossConnectionFactory;
 
    /**
     * Constructor
@@ -134,7 +133,7 @@
          log.trace("endpointActivation(" + endpointFactory + ", " + spec + ")");
       }
 
-      JBMActivation activation = new JBMActivation(this, endpointFactory, (JBMActivationSpec)spec);
+      JBMActivation activation = new JBMActivation(this, endpointFactory, (JBMActivationSpec) spec);
       activations.put(spec, activation);
       activation.start();
    }
@@ -239,14 +238,14 @@
 
    public Map<String, Object> getConnectionParameters()
    {
-      return raProperties.getConnectionParameters();
+      return raProperties.getParsedConnectionParameters();
    }
 
    public void setConnectionParameters(final String config)
    {
       if (config != null)
       {
-         raProperties.setConnectionParameters(Util.parseConfig(config));
+         raProperties.setParsedConnectionParameters(Util.parseConfig(config));
       }
    }
 
@@ -266,14 +265,14 @@
 
    public Map<String, Object> getBackupConnectionParameters()
    {
-      return raProperties.getBackupConnectionParameters();
+      return raProperties.getParsedBackupConnectionParameters();
    }
 
    public void setBackupTransportConfiguration(final String config)
    {
       if (config != null)
       {
-         raProperties.setBackupConnectionParameters(Util.parseConfig(config));
+         raProperties.setParsedBackupConnectionParameters(Util.parseConfig(config));
       }
    }
 
@@ -282,14 +281,14 @@
     *
     * @return The value
     */
-   public String getDiscoveryGroupAddress()
+   public String getDiscoveryAddress()
    {
       if (trace)
       {
          log.trace("getDiscoveryGroupAddress()");
       }
 
-      return raProperties.getDiscoveryGroupAddress();
+      return raProperties.getDiscoveryAddress();
    }
 
    /**
@@ -297,14 +296,14 @@
     *
     * @param dgn The value
     */
-   public void setDiscoveryGroupAddress(final String dgn)
+   public void setDiscoveryAddress(final String dgn)
    {
       if (trace)
       {
          log.trace("setDiscoveryGroupAddress(" + dgn + ")");
       }
 
-      raProperties.setDiscoveryGroupAddress(dgn);
+      raProperties.setDiscoveryAddress(dgn);
    }
 
    /**
@@ -312,14 +311,14 @@
     *
     * @return The value
     */
-   public Integer getDiscoveryGroupPort()
+   public Integer getDiscoveryPort()
    {
       if (trace)
       {
          log.trace("getDiscoveryGroupPort()");
       }
 
-      return raProperties.getDiscoveryGroupPort();
+      return raProperties.getDiscoveryPort();
    }
 
    /**
@@ -327,14 +326,14 @@
     *
     * @param dgp The value
     */
-   public void setDiscoveryGroupPort(final Integer dgp)
+   public void setDiscoveryPort(final Integer dgp)
    {
       if (trace)
       {
          log.trace("setDiscoveryGroupPort(" + dgp + ")");
       }
 
-      raProperties.setDiscoveryGroupPort(dgp);
+      raProperties.setDiscoveryPort(dgp);
    }
 
    /**
@@ -739,7 +738,7 @@
          log.trace("getBlockOnAcknowledge()");
       }
 
-      return raProperties.getBlockOnAcknowledge();
+      return raProperties.isBlockOnAcknowledge();
    }
 
    /**
@@ -769,7 +768,7 @@
          log.trace("getBlockOnNonPersistentSend()");
       }
 
-      return raProperties.getBlockOnNonPersistentSend();
+      return raProperties.isBlockOnNonPersistentSend();
    }
 
    /**
@@ -799,7 +798,7 @@
          log.trace("getBlockOnPersistentSend()");
       }
 
-      return raProperties.getBlockOnPersistentSend();
+      return raProperties.isBlockOnPersistentSend();
    }
 
    /**
@@ -829,7 +828,7 @@
          log.trace("getAutoGroup()");
       }
 
-      return raProperties.getAutoGroup();
+      return raProperties.isAutoGroup();
    }
 
    /**
@@ -889,7 +888,7 @@
          log.trace("getPreAcknowledge()");
       }
 
-      return raProperties.getPreAcknowledge();
+      return raProperties.isPreAcknowledge();
    }
 
    /**
@@ -1037,6 +1036,61 @@
       raProperties.setFailoverOnServerShutdown(failoverOnServerShutdown);
    }
 
+   public String getConnectionLoadBalancingPolicyClassName()
+   {
+      return raProperties.getConnectionLoadBalancingPolicyClassName();
+   }
+
+   public void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName)
+   {
+      if (trace)
+      {
+         log.trace("setFailoverOnServerShutdown(" + connectionLoadBalancingPolicyClassName + ")");
+      }
+      raProperties.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
+   }
+
+   public Integer getScheduledThreadPoolMaxSize()
+   {
+      return raProperties.getScheduledThreadPoolMaxSize();
+   }
+   public void setScheduledThreadPoolMaxSize(Integer scheduledThreadPoolMaxSize)
+   {
+      if (trace)
+      {
+         log.trace("setFailoverOnServerShutdown(" + scheduledThreadPoolMaxSize + ")");
+      }
+      raProperties.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
+   }
+
+   public Integer getThreadPoolMaxSize()
+   {
+      return raProperties.getThreadPoolMaxSize();
+   }
+
+   public void setThreadPoolMaxSize(Integer threadPoolMaxSize)
+   {
+      if (trace)
+      {
+         log.trace("setFailoverOnServerShutdown(" + threadPoolMaxSize + ")");
+      }
+      raProperties.setThreadPoolMaxSize(threadPoolMaxSize);
+   }
+
+    public Boolean getUseGlobalPools()
+    {
+       return raProperties.isUseGlobalPools();
+    }
+   
+   public void setUseGlobalPools(Boolean useGlobalPools)
+   {
+      if (trace)
+      {
+         log.trace("setFailoverOnServerShutdown(" + useGlobalPools + ")");
+      }
+      raProperties.setUseGlobalPools(useGlobalPools);
+   }
+
    /**
     * Get the user name
     *
@@ -1177,7 +1231,7 @@
 
       if (obj instanceof JBMResourceAdapter)
       {
-         return raProperties.equals(((JBMResourceAdapter)obj).getProperties());
+         return raProperties.equals(((JBMResourceAdapter) obj).getProperties());
       }
       else
       {
@@ -1252,9 +1306,9 @@
 
       boolean actPreAck = preAck != null ? preAck : ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE;
       int actDupsOkBatchSize = dupsOkBatchSize != null ? dupsOkBatchSize
-                                                      : ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
+                                                       : ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
       int actTxBatchSize = transactionBatchSize != null ? transactionBatchSize
-                                                       : ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
+                                                        : ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
       switch (ackMode)
       {
          case Session.SESSION_TRANSACTED:
@@ -1312,202 +1366,215 @@
 
    }
 
-   private void setParams(final JBossConnectionFactory cf)
+
+   /**
+    * Get the resource adapter properties
+    *
+    * @return The properties
+    */
+   protected JBMRAProperties getProperties()
    {
-      if (getLoadBalancingPolicyClassName() != null)
+      if (trace)
       {
-         cf.setConnectionLoadBalancingPolicyClassName(getLoadBalancingPolicyClassName());
+         log.trace("getProperties()");
       }
 
-      if (getClientFailureCheckPeriod() != null)
+      return raProperties;
+   }
+
+   /**
+    * Setup the factory
+    */
+   protected void setup() throws MessagingException
+   {
+      defaultJBossConnectionFactory = createJBossConnectionFactory(raProperties);
+      sessionFactory = defaultJBossConnectionFactory.getCoreFactory();
+   }
+
+   public JBossConnectionFactory getDefaultJBossConnectionFactory() throws ResourceException
+   {
+      if (!configured.getAndSet(true))
       {
-         cf.setClientFailureCheckPeriod(getClientFailureCheckPeriod());
+         try
+         {
+            setup();
+         }
+         catch (MessagingException e)
+         {
+            throw new ResourceException("Unable to create activation", e);
+         }
       }
+      return defaultJBossConnectionFactory;
+   }
 
-      if (getConnectionTTL() != null)
+   public JBossConnectionFactory createJBossConnectionFactory(ConnectionFactoryProperties overrideProperties)
+   {
+      JBossConnectionFactory cf;
+      String connectorClassName = overrideProperties.getConnectorClassName() != null ? overrideProperties.getConnectorClassName() : getConnectorClassName();
+      String discoveryAddress = overrideProperties.getDiscoveryAddress() != null ? overrideProperties.getDiscoveryAddress() : getDiscoveryAddress();
+      if (connectorClassName != null)
       {
-         cf.setConnectionTTL(getConnectionTTL());
+         Map<String, Object> connectionParams = overrideProperties.getParsedConnectionParameters() != null ? overrideProperties.getParsedConnectionParameters() : getConnectionParameters();
+         TransportConfiguration transportConf = new TransportConfiguration(connectorClassName, connectionParams);
+
+         String backUpCOnnectorClassname = overrideProperties.getBackupConnectorClassName() != null ? overrideProperties.getBackupConnectorClassName() : getBackupConnectorClassName();
+         Map<String, Object> backupConnectionParams = overrideProperties.getParsedBackupConnectionParameters() != null ? overrideProperties.getParsedBackupConnectionParameters() : getBackupConnectionParameters();
+         TransportConfiguration backup = backUpCOnnectorClassname == null ? null
+                                                                          : new TransportConfiguration(backUpCOnnectorClassname,
+                                                                                                       backupConnectionParams);
+
+         cf = new JBossConnectionFactory(transportConf, backup);
       }
-
-      if (getCallTimeout() != null)
+      else if (discoveryAddress != null)
       {
-         cf.setCallTimeout(getCallTimeout());
+         Integer discoveryPort = overrideProperties.getDiscoveryPort() != null ? overrideProperties.getDiscoveryPort() : getDiscoveryPort();
+         cf = new JBossConnectionFactory(discoveryAddress, discoveryPort);
       }
-
-      if (getClientID() != null)
+      else
       {
-         cf.setClientID(getClientID());
+         throw new IllegalArgumentException("must provide either TransportType or DiscoveryGroupAddress and DiscoveryGroupPort for JBM ResourceAdapter Connection Factory");
       }
+      setParams(cf, overrideProperties);
+      return cf;
+   }
 
-      if (getDupsOKBatchSize() != null)
+   private void setParams(final JBossConnectionFactory cf, ConnectionFactoryProperties overrideProperties)
+   {
+      Boolean val = overrideProperties.isAutoGroup() != null ? overrideProperties.isAutoGroup() : raProperties.isAutoGroup();
+      if (val != null)
       {
-         cf.setDupsOKBatchSize(getDupsOKBatchSize());
+         cf.setAutoGroup(val);
       }
-
-      if (getTransactionBatchSize() != null)
+      val = overrideProperties.isBlockOnAcknowledge() != null ? overrideProperties.isBlockOnAcknowledge() : raProperties.isBlockOnAcknowledge();
+      if (val != null)
       {
-         cf.setTransactionBatchSize(getTransactionBatchSize());
+         cf.setBlockOnAcknowledge(val);
       }
-
-      if (getConsumerWindowSize() != null)
+      val = overrideProperties.isBlockOnNonPersistentSend() != null ? overrideProperties.isBlockOnNonPersistentSend() : raProperties.isBlockOnNonPersistentSend();
+      if (val != null)
       {
-         cf.setConsumerWindowSize(getConsumerWindowSize());
+         cf.setBlockOnNonPersistentSend(val);
       }
-
-      if (getConsumerMaxRate() != null)
+      val = overrideProperties.isBlockOnPersistentSend() != null ? overrideProperties.isBlockOnPersistentSend() : raProperties.isBlockOnPersistentSend();
+      if (val != null)
       {
-         cf.setConsumerMaxRate(getConsumerMaxRate());
+         cf.setBlockOnPersistentSend(val);
       }
-
-      if (getProducerWindowSize() != null)
+      val = overrideProperties.isFailoverOnServerShutdown() != null?overrideProperties.isFailoverOnServerShutdown():raProperties.isFailoverOnServerShutdown();
+      if(val != null)
       {
-         cf.setProducerWindowSize(getProducerWindowSize());
+         cf.setFailoverOnServerShutdown(val);
       }
-
-      if (getProducerMaxRate() != null)
+      val = overrideProperties.isPreAcknowledge() != null?overrideProperties.isPreAcknowledge():raProperties.isPreAcknowledge();
+      if(val != null)
       {
-         cf.setProducerMaxRate(getProducerMaxRate());
+         cf.setPreAcknowledge(val);
       }
-
-      if (getMinLargeMessageSize() != null)
+      val = overrideProperties.isUseGlobalPools() != null?overrideProperties.isUseGlobalPools():raProperties.isUseGlobalPools();
+      if(val != null)
       {
-         cf.setMinLargeMessageSize(getMinLargeMessageSize());
+         cf.setUseGlobalPools(val);
       }
-
-      if (getBlockOnAcknowledge() != null)
+      Integer val2 = overrideProperties.getConsumerMaxRate() != null?overrideProperties.getConsumerMaxRate():raProperties.getConsumerMaxRate();
+      if(val2 != null)
       {
-         cf.setBlockOnAcknowledge(getBlockOnAcknowledge());
+         cf.setConsumerMaxRate(val2);
       }
-
-      if (getBlockOnNonPersistentSend() != null)
+      val2 = overrideProperties.getConsumerWindowSize() != null?overrideProperties.getConsumerWindowSize():raProperties.getConsumerWindowSize();
+      if(val2 != null)
       {
-         cf.setBlockOnNonPersistentSend(getBlockOnNonPersistentSend());
+         cf.setConsumerWindowSize(val2);
       }
-
-      if (getBlockOnPersistentSend() != null)
+      val2 = overrideProperties.getDupsOKBatchSize() != null?overrideProperties.getDupsOKBatchSize():raProperties.getDupsOKBatchSize();
+      if(val2 != null)
       {
-         cf.setBlockOnPersistentSend(getBlockOnPersistentSend());
+         cf.setDupsOKBatchSize(val2);
       }
-
-      if (getAutoGroup() != null)
+      val2 = overrideProperties.getMaxConnections() != null?overrideProperties.getMaxConnections():raProperties.getMaxConnections();
+      if(val2 != null)
       {
-         cf.setAutoGroup(getAutoGroup());
+         cf.setMaxConnections(val2);
       }
-
-      if (getMaxConnections() != null)
+      val2 = overrideProperties.getMinLargeMessageSize() != null?overrideProperties.getMinLargeMessageSize():raProperties.getMinLargeMessageSize();
+      if(val2 != null)
       {
-         cf.setMaxConnections(getMaxConnections());
+         cf.setMinLargeMessageSize(val2);
       }
-
-      if (getPreAcknowledge() != null)
+      val2 = overrideProperties.getProducerMaxRate() != null?overrideProperties.getProducerMaxRate():raProperties.getProducerMaxRate();
+      if(val2 != null)
       {
-         cf.setPreAcknowledge(getPreAcknowledge());
+         cf.setProducerMaxRate(val2);
       }
-
-      if (getRetryInterval() != null)
+      val2 = overrideProperties.getProducerWindowSize() != null?overrideProperties.getProducerWindowSize():raProperties.getProducerWindowSize();
+      if(val2 != null)
       {
-         cf.setRetryInterval(getRetryInterval());
+         cf.setProducerWindowSize(val2);
       }
-
-      if (getRetryIntervalMultiplier() != null)
+      val2 = overrideProperties.getReconnectAttempts() != null?overrideProperties.getReconnectAttempts():raProperties.getReconnectAttempts();
+      if(val2 != null)
       {
-         cf.setRetryIntervalMultiplier(getRetryIntervalMultiplier());
+         cf.setReconnectAttempts(val2);
       }
-
-      if (getReconnectAttempts() != null)
+      val2 = overrideProperties.getThreadPoolMaxSize() != null?overrideProperties.getThreadPoolMaxSize():raProperties.getThreadPoolMaxSize();
+      if(val2 != null)
       {
-         cf.setReconnectAttempts(getReconnectAttempts());
+         cf.setThreadPoolMaxSize(val2);
       }
-
-      if (getFailoverOnServerShutdown() != null)
+      val2 = overrideProperties.getScheduledThreadPoolMaxSize() != null?overrideProperties.getScheduledThreadPoolMaxSize():raProperties.getScheduledThreadPoolMaxSize();
+      if(val2 != null)
       {
-         cf.setFailoverOnServerShutdown(getFailoverOnServerShutdown());
+         cf.setScheduledThreadPoolMaxSize(val2);
       }
-   }
-
-   /**
-    * @param connectorClassName
-    * @param connectionParameters
-    */
-   public JBossConnectionFactory createRemoteFactory(final String connectorClassName,
-                                                     final Map<String, Object> connectionParameters)
-   {
-      TransportConfiguration transportConf = new TransportConfiguration(connectorClassName, connectionParameters);
-
-      TransportConfiguration backup = getBackupConnectorClassName() == null ? null
-                                                                           : new TransportConfiguration(getBackupConnectorClassName(),
-                                                                                                        getBackupConnectionParameters());
-
-      JBossConnectionFactory cf = new JBossConnectionFactory(transportConf, backup);
-
-      setParams(cf);
-
-      return cf;
-   }
-
-   /**
-    * @param discoveryGroup
-    * @param discoveryGroupPort
-    */
-   public JBossConnectionFactory createDiscoveryFactory(final String discoveryGroup, final Integer discoveryGroupPort)
-   {
-      JBossConnectionFactory cf = new JBossConnectionFactory(discoveryGroup, discoveryGroupPort);
-
-      setParams(cf);
-
-      return cf;
-   }
-
-   /**
-    * Get the resource adapter properties
-    *
-    * @return The properties
-    */
-   protected JBMRAProperties getProperties()
-   {
-      if (trace)
+      val2 = overrideProperties.getTransactionBatchSize() != null?overrideProperties.getTransactionBatchSize():raProperties.getTransactionBatchSize();
+      if(val2 != null)
       {
-         log.trace("getProperties()");
+         cf.setTransactionBatchSize(val2);
       }
-
-      return raProperties;
-   }
-
-   /**
-    * Setup the factory
-    */
-   protected void setup() throws MessagingException
-   {
-
-      if (getConnectorClassName() != null)
+      Long val3 = overrideProperties.getClientFailureCheckPeriod() != null?overrideProperties.getClientFailureCheckPeriod():raProperties.getClientFailureCheckPeriod();
+      if(val3 != null)
       {
-         jBossConnectionFactory = createRemoteFactory(getConnectorClassName(), getConnectionParameters());
+         cf.setClientFailureCheckPeriod(val3);
       }
-      else if (getDiscoveryGroupAddress() != null && getDiscoveryGroupPort() != null)
+      val3 = overrideProperties.getCallTimeout() != null?overrideProperties.getCallTimeout():raProperties.getCallTimeout();
+      if(val3 != null)
       {
-         jBossConnectionFactory = createDiscoveryFactory(getDiscoveryGroupAddress(), getDiscoveryGroupPort());
+         cf.setCallTimeout(val3);
       }
-      else
+      val3 = overrideProperties.getConnectionTTL() != null?overrideProperties.getConnectionTTL():raProperties.getConnectionTTL();
+      if(val3 != null)
       {
-         log.fatal("must provide either TransportTyoe or DiscoveryGroupAddress and DiscoveryGroupPort for JBM ResourceAdapter");
+         cf.setConnectionTTL(val3);
       }
-
-      sessionFactory = jBossConnectionFactory.getCoreFactory();
-   }
-
-   public JBossConnectionFactory getJBossConnectionFactory() throws ResourceException
-   {
-      if (!configured.getAndSet(true))
+      val3 = overrideProperties.getDiscoveryInitialWaitTimeout() != null?overrideProperties.getDiscoveryInitialWaitTimeout():raProperties.getDiscoveryInitialWaitTimeout();
+      if(val3 != null)
       {
-         try
-         {
-            setup();
-         }
-         catch (MessagingException e)
-         {
-            throw new ResourceException("Unable to create activation", e);
-         }
+         cf.setDiscoveryInitialWaitTimeout(val3);
       }
-      return jBossConnectionFactory;
+      val3 = overrideProperties.getDiscoveryRefreshTimeout() != null?overrideProperties.getDiscoveryRefreshTimeout():raProperties.getDiscoveryRefreshTimeout();
+      if(val3 != null)
+      {
+         cf.setDiscoveryRefreshTimeout(val3);
+      }
+      val3 = overrideProperties.getRetryInterval() != null?overrideProperties.getRetryInterval():raProperties.getRetryInterval();
+      if(val3 != null)
+      {
+         cf.setRetryInterval(val3);
+      }
+      Double val4 = overrideProperties.getRetryIntervalMultiplier() != null?overrideProperties.getRetryIntervalMultiplier():raProperties.getRetryIntervalMultiplier();
+      if(val4 != null)
+      {
+         cf.setRetryIntervalMultiplier(val4);
+      }
+      String val5 = overrideProperties.getClientID() != null?overrideProperties.getClientID():raProperties.getClientID();
+      if(val5 != null)
+      {
+         cf.setClientID(val5);
+      }
+      val5 = overrideProperties.getConnectionLoadBalancingPolicyClassName() != null?overrideProperties.getConnectionLoadBalancingPolicyClassName():raProperties.getConnectionLoadBalancingPolicyClassName();
+      if(val5 != null)
+      {
+         cf.setConnectionLoadBalancingPolicyClassName(val5);
+      }
    }
+
 }

Modified: trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivation.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivation.java	2009-06-25 08:51:59 UTC (rev 7463)
+++ trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivation.java	2009-06-25 09:57:58 UTC (rev 7464)
@@ -21,10 +21,16 @@
  */
 package org.jboss.messaging.ra.inflow;
 
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
+import org.jboss.messaging.core.client.ClientSession;
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.jms.JBossDestination;
+import org.jboss.messaging.jms.JBossQueue;
+import org.jboss.messaging.jms.JBossTopic;
+import org.jboss.messaging.jms.client.JBossConnectionFactory;
+import org.jboss.messaging.ra.JBMResourceAdapter;
+import org.jboss.messaging.ra.Util;
+import org.jboss.messaging.utils.SimpleString;
+import org.jboss.tm.TransactionManagerLocator;
 
 import javax.jms.Destination;
 import javax.jms.Message;
@@ -37,18 +43,11 @@
 import javax.resource.spi.endpoint.MessageEndpointFactory;
 import javax.resource.spi.work.WorkManager;
 import javax.transaction.TransactionManager;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.jboss.messaging.core.client.ClientSession;
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.jms.JBossDestination;
-import org.jboss.messaging.jms.JBossQueue;
-import org.jboss.messaging.jms.JBossTopic;
-import org.jboss.messaging.jms.client.JBossConnectionFactory;
-import org.jboss.messaging.ra.JBMResourceAdapter;
-import org.jboss.messaging.ra.Util;
-import org.jboss.messaging.utils.SimpleString;
-import org.jboss.tm.TransactionManagerLocator;
-
 /**
  * The activation.
  *
@@ -325,28 +324,28 @@
       {
          handler.teardown();
       }
-
+      if(spec.isHasBeenUpdated())
+      {
+         factory.close();
+         factory = null;
+      }
       log.debug("Tearing down complete " + this);
    }
 
    protected void setupCF() throws Exception
    {
-      if (spec.getConnectorClassName() == null)
+      if(spec.isHasBeenUpdated())
       {
-         factory = ra.getJBossConnectionFactory();
+         factory = ra.createJBossConnectionFactory(spec);
       }
       else
       {
-         factory = ra.createRemoteFactory(spec.getConnectorClassName(), spec.getParsedConnectionParameters());
+         factory = ra.getDefaultJBossConnectionFactory();
       }
    }
 
    /**
     * Setup a session
-    *
-    * @param user     The user
-    * @param pass     The password
-    * @param clientID The client id
     * @return The connection
     * @throws Exception Thrown if an error occurs
     */

Modified: trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivationSpec.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivationSpec.java	2009-06-25 08:51:59 UTC (rev 7463)
+++ trunk/src/main/org/jboss/messaging/ra/inflow/JBMActivationSpec.java	2009-06-25 09:57:58 UTC (rev 7464)
@@ -21,19 +21,19 @@
  */
 package org.jboss.messaging.ra.inflow;
 
-import java.util.HashMap;
-import java.util.Map;
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.ra.ConnectionFactoryProperties;
+import org.jboss.messaging.ra.JBMResourceAdapter;
+import org.jboss.messaging.ra.Util;
 
 import javax.jms.Session;
 import javax.resource.ResourceException;
 import javax.resource.spi.ActivationSpec;
 import javax.resource.spi.InvalidPropertyException;
 import javax.resource.spi.ResourceAdapter;
+import java.util.HashMap;
+import java.util.Map;
 
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.ra.JBMResourceAdapter;
-import org.jboss.messaging.ra.Util;
-
 /**
  * The activation spec
  * These properties are set on the MDB ActivactionProperties
@@ -44,7 +44,7 @@
  * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
  * @version $Revision: $
  */
-public class JBMActivationSpec implements ActivationSpec
+public class JBMActivationSpec extends ConnectionFactoryProperties implements ActivationSpec
 {
    /** The logger */
    private static final Logger log = Logger.getLogger(JBMActivationSpec.class);
@@ -57,9 +57,6 @@
 
    public String strConnectionParameters;
 
-   /** The transport type, changing the default configured from the RA */
-   private String connectorClassName;
-
    /** The resource adapter */
    private JBMResourceAdapter ra;
 
@@ -81,9 +78,6 @@
    /** The subscription name */
    private String subscriptionName;
 
-   /** The client id */
-   private String clientId;
-
    /** The user */
    private String user;
 
@@ -142,7 +136,6 @@
       acknowledgeMode = Session.SESSION_TRANSACTED;
       subscriptionDurability = false;
       subscriptionName = null;
-      clientId = null;
       user = null;
       password = null;
       maxMessages = Integer.valueOf(1);
@@ -181,7 +174,7 @@
    }
 
    /**
-    * @param useJNDI the useJNDI to set
+    * @param value the useJNDI to set
     */
    public void setUseJNDI(final boolean value)
    {
@@ -442,38 +435,6 @@
    }
 
    /**
-    * Get the client id
-    * @return The value
-    */
-   public String getClientId()
-   {
-      if (trace)
-      {
-         log.trace("getClientId()");
-      }
-
-      if (clientId == null)
-      {
-         return ra.getClientID();
-      }
-      return clientId;
-   }
-
-   /**
-    * Set the client id
-    * @param value The value
-    */
-   public void setClientId(final String value)
-   {
-      if (trace)
-      {
-         log.trace("setClientId(" + value + ")");
-      }
-
-      clientId = value;
-   }
-
-   /**
     * Get the user
     * @return The value
     */
@@ -1002,19 +963,6 @@
    }
 
    /**
-    * @return the connectorClassName
-    */
-   public String getConnectorClassName()
-   {
-      return connectorClassName;
-   }
-
-   public void setConnectorClassName(final String value)
-   {
-      connectorClassName = value;
-   }
-
-   /**
     * Get a string representation
     * @return The value
     */
@@ -1035,10 +983,6 @@
          buffer.append(" ack=").append(getAcknowledgeMode());
       }
       buffer.append(" durable=").append(subscriptionDurability);
-      if (clientId != null)
-      {
-         buffer.append(" clientID=").append(clientId);
-      }
       if (subscriptionName != null)
       {
          buffer.append(" subscription=").append(subscriptionName);

Modified: trunk/src/main/org/jboss/messaging/ra/inflow/JBMMessageHandler.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/inflow/JBMMessageHandler.java	2009-06-25 08:51:59 UTC (rev 7463)
+++ trunk/src/main/org/jboss/messaging/ra/inflow/JBMMessageHandler.java	2009-06-25 09:57:58 UTC (rev 7464)
@@ -21,18 +21,6 @@
  */
 package org.jboss.messaging.ra.inflow;
 
-import java.util.UUID;
-
-import javax.jms.InvalidClientIDException;
-import javax.jms.JMSException;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-import javax.resource.spi.endpoint.MessageEndpoint;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.transaction.Status;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
 import org.jboss.messaging.core.client.ClientConsumer;
 import org.jboss.messaging.core.client.ClientMessage;
 import org.jboss.messaging.core.client.ClientSession;
@@ -44,6 +32,17 @@
 import org.jboss.messaging.jms.client.JBossMessage;
 import org.jboss.messaging.utils.SimpleString;
 
+import javax.jms.InvalidClientIDException;
+import javax.jms.JMSException;
+import javax.jms.MessageListener;
+import javax.jms.Session;
+import javax.resource.spi.endpoint.MessageEndpoint;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.transaction.Status;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import java.util.UUID;
+
 /**
  * The message handler
  *
@@ -106,13 +105,13 @@
 
          // Durable sub
 
-         if (activation.getActivationSpec().getClientId() == null)
+         if (activation.getActivationSpec().getClientID() == null)
          {
             throw new InvalidClientIDException("Cannot create durable subscription - client ID has not been set");
          }
 
          SimpleString queueName = new SimpleString(JBossTopic.createQueueNameForDurableSubscription(activation.getActivationSpec()
-                                                                                                              .getClientId(),
+                                                                                                              .getClientID(),
                                                                                                     subscriptionName));
 
          SessionQueueQueryResponseMessage subResponse = session.queueQuery(queueName);

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/ra/ResourceAdapterTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/ra/ResourceAdapterTest.java	2009-06-25 08:51:59 UTC (rev 7463)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/ra/ResourceAdapterTest.java	2009-06-25 09:57:58 UTC (rev 7464)
@@ -22,30 +22,32 @@
 
 package org.jboss.messaging.tests.unit.ra;
 
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.Timer;
-
-import javax.jms.Connection;
-import javax.resource.spi.BootstrapContext;
-import javax.resource.spi.UnavailableException;
-import javax.resource.spi.XATerminator;
-import javax.resource.spi.endpoint.MessageEndpoint;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.resource.spi.work.WorkManager;
-import javax.transaction.xa.XAResource;
-
 import org.jboss.messaging.core.client.ClientSession;
 import org.jboss.messaging.core.client.ClientSessionFactory;
+import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
+import org.jboss.messaging.core.remoting.impl.invm.InVMConnector;
 import org.jboss.messaging.core.server.MessagingServer;
+import org.jboss.messaging.integration.transports.netty.NettyConnector;
 import org.jboss.messaging.jms.JBossQueue;
 import org.jboss.messaging.jms.client.JBossConnectionFactory;
+import org.jboss.messaging.ra.ConnectionFactoryProperties;
 import org.jboss.messaging.ra.JBMManagedConnectionFactory;
 import org.jboss.messaging.ra.JBMResourceAdapter;
 import org.jboss.messaging.ra.inflow.JBMActivation;
 import org.jboss.messaging.ra.inflow.JBMActivationSpec;
 import org.jboss.messaging.tests.util.ServiceTestBase;
 
+import javax.jms.Connection;
+import javax.resource.spi.BootstrapContext;
+import javax.resource.spi.UnavailableException;
+import javax.resource.spi.XATerminator;
+import javax.resource.spi.endpoint.MessageEndpoint;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.resource.spi.work.WorkManager;
+import javax.transaction.xa.XAResource;
+import java.lang.reflect.Method;
+import java.util.Timer;
+
 /**
  * A ResourceAdapterTest
  *
@@ -66,10 +68,256 @@
 
    // Public --------------------------------------------------------
 
+   public void testDefaultConnectionFactory() throws Exception
+   {
+      JBMResourceAdapter ra = new JBMResourceAdapter();
+      ra.setConnectorClassName(InVMConnector.class.getName());
+      JBossConnectionFactory factory = ra.getDefaultJBossConnectionFactory();
+      assertEquals(factory.getCallTimeout(), ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT);
+      assertEquals(factory.getClientFailureCheckPeriod(), ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD);
+      assertEquals(factory.getClientID(), null);
+      assertEquals(factory.getConnectionLoadBalancingPolicyClassName(), ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME);
+      assertEquals(factory.getConnectionTTL(), ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL);
+      assertEquals(factory.getConsumerMaxRate(), ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE);
+      assertEquals(factory.getConsumerWindowSize(), ClientSessionFactoryImpl.DEFAULT_CONSUMER_WINDOW_SIZE);
+      assertEquals(factory.getDiscoveryAddress(), null);
+      assertEquals(factory.getDiscoveryInitialWaitTimeout(), ClientSessionFactoryImpl.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT);
+      assertEquals(factory.getDiscoveryPort(), 0);
+      assertEquals(factory.getDiscoveryRefreshTimeout(), ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT);
+      assertEquals(factory.getDupsOKBatchSize(), ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE);
+      assertEquals(factory.getMaxConnections(), ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS);
+      assertEquals(factory.getMinLargeMessageSize(), ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE);
+      assertEquals(factory.getProducerMaxRate(), ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE);
+      assertEquals(factory.getProducerWindowSize(), ClientSessionFactoryImpl.DEFAULT_PRODUCER_WINDOW_SIZE);
+      assertEquals(factory.getReconnectAttempts(), ClientSessionFactoryImpl.DEFAULT_RECONNECT_ATTEMPTS);
+      assertEquals(factory.getRetryInterval(), ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL);
+      assertEquals(factory.getRetryIntervalMultiplier(), ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER);
+      assertEquals(factory.getScheduledThreadPoolMaxSize(), ClientSessionFactoryImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE);
+      assertEquals(factory.getThreadPoolMaxSize(), ClientSessionFactoryImpl.DEFAULT_THREAD_POOL_MAX_SIZE);
+      assertEquals(factory.getTransactionBatchSize(), ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE);
+      assertEquals(factory.isAutoGroup(), ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP);
+      assertEquals(factory.isBlockOnAcknowledge(), ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE);
+      assertEquals(factory.isBlockOnNonPersistentSend(), ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND);
+      assertEquals(factory.isBlockOnPersistentSend(), ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND);
+      assertEquals(factory.isFailoverOnServerShutdown(), ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN);
+      assertEquals(factory.isPreAcknowledge(), ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE);
+      assertEquals(factory.isUseGlobalPools(), ClientSessionFactoryImpl.DEFAULT_USE_GLOBAL_POOLS);
+   }
+
+   public void test2DefaultConnectionFactorySame() throws Exception
+   {
+      JBMResourceAdapter ra = new JBMResourceAdapter();
+      ra.setConnectorClassName(InVMConnector.class.getName());
+      JBossConnectionFactory factory = ra.getDefaultJBossConnectionFactory();
+      JBossConnectionFactory factory2 = ra.getDefaultJBossConnectionFactory();
+      assertEquals(factory, factory2);
+   }
+
+   public void testCreateConnectionFactoryNoOverrides() throws Exception
+   {
+      JBMResourceAdapter ra = new JBMResourceAdapter();
+      ra.setConnectorClassName(InVMConnector.class.getName());
+      JBossConnectionFactory factory = ra.createJBossConnectionFactory(new ConnectionFactoryProperties());
+      assertEquals(factory.getCallTimeout(), ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT);
+      assertEquals(factory.getClientFailureCheckPeriod(), ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD);
+      assertEquals(factory.getClientID(), null);
+      assertEquals(factory.getConnectionLoadBalancingPolicyClassName(), ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME);
+      assertEquals(factory.getConnectionTTL(), ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL);
+      assertEquals(factory.getConsumerMaxRate(), ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE);
+      assertEquals(factory.getConsumerWindowSize(), ClientSessionFactoryImpl.DEFAULT_CONSUMER_WINDOW_SIZE);
+      assertEquals(factory.getDiscoveryAddress(), null);
+      assertEquals(factory.getDiscoveryInitialWaitTimeout(), ClientSessionFactoryImpl.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT);
+      assertEquals(factory.getDiscoveryPort(), 0);
+      assertEquals(factory.getDiscoveryRefreshTimeout(), ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT);
+      assertEquals(factory.getDupsOKBatchSize(), ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE);
+      assertEquals(factory.getMaxConnections(), ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS);
+      assertEquals(factory.getMinLargeMessageSize(), ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE);
+      assertEquals(factory.getProducerMaxRate(), ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE);
+      assertEquals(factory.getProducerWindowSize(), ClientSessionFactoryImpl.DEFAULT_PRODUCER_WINDOW_SIZE);
+      assertEquals(factory.getReconnectAttempts(), ClientSessionFactoryImpl.DEFAULT_RECONNECT_ATTEMPTS);
+      assertEquals(factory.getRetryInterval(), ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL);
+      assertEquals(factory.getRetryIntervalMultiplier(), ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER);
+      assertEquals(factory.getScheduledThreadPoolMaxSize(), ClientSessionFactoryImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE);
+      assertEquals(factory.getThreadPoolMaxSize(), ClientSessionFactoryImpl.DEFAULT_THREAD_POOL_MAX_SIZE);
+      assertEquals(factory.getTransactionBatchSize(), ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE);
+      assertEquals(factory.isAutoGroup(), ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP);
+      assertEquals(factory.isBlockOnAcknowledge(), ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE);
+      assertEquals(factory.isBlockOnNonPersistentSend(), ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND);
+      assertEquals(factory.isBlockOnPersistentSend(), ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND);
+      assertEquals(factory.isFailoverOnServerShutdown(), ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN);
+      assertEquals(factory.isPreAcknowledge(), ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE);
+      assertEquals(factory.isUseGlobalPools(), ClientSessionFactoryImpl.DEFAULT_USE_GLOBAL_POOLS);
+   }
+
+   public void testDefaultConnectionFactoryOverrides() throws Exception
+   {
+      JBMResourceAdapter ra = new JBMResourceAdapter();
+      ra.setConnectorClassName(InVMConnector.class.getName());
+      ra.setAutoGroup(!ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP);
+      ra.setBlockOnAcknowledge(!ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE);
+      ra.setBlockOnNonPersistentSend(!ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND);
+      ra.setBlockOnPersistentSend(!ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND);
+      ra.setCallTimeout(1l);
+      ra.setClientFailureCheckPeriod(2l);
+      ra.setClientID("myid");
+      ra.setConnectionLoadBalancingPolicyClassName("mlbcn");
+      ra.setConnectionTTL(3l);
+      ra.setConsumerMaxRate(4);
+      ra.setConsumerWindowSize(5);
+      ra.setDiscoveryInitialWaitTimeout(6l);
+      ra.setDiscoveryRefreshTimeout(7l);
+      ra.setDupsOKBatchSize(8);
+      ra.setFailoverOnServerShutdown(!ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN);
+      ra.setMaxConnections(9);
+      ra.setMinLargeMessageSize(10);
+      ra.setPreAcknowledge(!ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE);
+      ra.setProducerMaxRate(11);
+      ra.setProducerWindowSize(12);
+      ra.setReconnectAttempts(13);
+      ra.setRetryInterval(14l);
+      ra.setRetryIntervalMultiplier(15d);
+      ra.setScheduledThreadPoolMaxSize(16);
+      ra.setThreadPoolMaxSize(17);
+      ra.setTransactionBatchSize(18);
+      ra.setUseGlobalPools(!ClientSessionFactoryImpl.DEFAULT_USE_GLOBAL_POOLS);
+      JBossConnectionFactory factory = ra.getDefaultJBossConnectionFactory();
+      assertEquals(factory.getCallTimeout(), 1);
+      assertEquals(factory.getClientFailureCheckPeriod(), 2);
+      assertEquals(factory.getClientID(), "myid");
+      assertEquals(factory.getConnectionLoadBalancingPolicyClassName(), "mlbcn");
+      assertEquals(factory.getConnectionTTL(), 3);
+      assertEquals(factory.getConsumerMaxRate(), 4);
+      assertEquals(factory.getConsumerWindowSize(), 5);
+      assertEquals(factory.getDiscoveryAddress(), null);
+      assertEquals(factory.getDiscoveryInitialWaitTimeout(), 6);
+      assertEquals(factory.getDiscoveryPort(), 0);
+      assertEquals(factory.getDiscoveryRefreshTimeout(), 7);
+      assertEquals(factory.getDupsOKBatchSize(), 8);
+      assertEquals(factory.getMaxConnections(), 9);
+      assertEquals(factory.getMinLargeMessageSize(), 10);
+      assertEquals(factory.getProducerMaxRate(), 11);
+      assertEquals(factory.getProducerWindowSize(), 12);
+      assertEquals(factory.getReconnectAttempts(), 13);
+      assertEquals(factory.getRetryInterval(), 14);
+      assertEquals(factory.getRetryIntervalMultiplier(), 15d);
+      assertEquals(factory.getScheduledThreadPoolMaxSize(), 16);
+      assertEquals(factory.getThreadPoolMaxSize(), 17);
+      assertEquals(factory.getTransactionBatchSize(), 18);
+      assertEquals(factory.isAutoGroup(), !ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP);
+      assertEquals(factory.isBlockOnAcknowledge(), !ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE);
+      assertEquals(factory.isBlockOnNonPersistentSend(), !ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND);
+      assertEquals(factory.isBlockOnPersistentSend(), !ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND);
+      assertEquals(factory.isFailoverOnServerShutdown(), !ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN);
+      assertEquals(factory.isPreAcknowledge(), !ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE);
+      assertEquals(factory.isUseGlobalPools(), !ClientSessionFactoryImpl.DEFAULT_USE_GLOBAL_POOLS);
+   }
+
+   public void testCreateConnectionFactoryOverrides() throws Exception
+   {
+      JBMResourceAdapter ra = new JBMResourceAdapter();
+      ra.setConnectorClassName(InVMConnector.class.getName());
+      ConnectionFactoryProperties connectionFactoryProperties = new ConnectionFactoryProperties();
+      connectionFactoryProperties.setAutoGroup(!ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP);
+      connectionFactoryProperties.setBlockOnAcknowledge(!ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE);
+      connectionFactoryProperties.setBlockOnNonPersistentSend(!ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND);
+      connectionFactoryProperties.setBlockOnPersistentSend(!ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND);
+      connectionFactoryProperties.setCallTimeout(1l);
+      connectionFactoryProperties.setClientFailureCheckPeriod(2l);
+      connectionFactoryProperties.setClientID("myid");
+      connectionFactoryProperties.setConnectionLoadBalancingPolicyClassName("mlbcn");
+      connectionFactoryProperties.setConnectionTTL(3l);
+      connectionFactoryProperties.setConsumerMaxRate(4);
+      connectionFactoryProperties.setConsumerWindowSize(5);
+      connectionFactoryProperties.setDiscoveryInitialWaitTimeout(6l);
+      connectionFactoryProperties.setDiscoveryRefreshTimeout(7l);
+      connectionFactoryProperties.setDupsOKBatchSize(8);
+      connectionFactoryProperties.setFailoverOnServerShutdown(!ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN);
+      connectionFactoryProperties.setMaxConnections(9);
+      connectionFactoryProperties.setMinLargeMessageSize(10);
+      connectionFactoryProperties.setPreAcknowledge(!ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE);
+      connectionFactoryProperties.setProducerMaxRate(11);
+      connectionFactoryProperties.setProducerWindowSize(12);
+      connectionFactoryProperties.setReconnectAttempts(13);
+      connectionFactoryProperties.setRetryInterval(14l);
+      connectionFactoryProperties.setRetryIntervalMultiplier(15d);
+      connectionFactoryProperties.setScheduledThreadPoolMaxSize(16);
+      connectionFactoryProperties.setThreadPoolMaxSize(17);
+      connectionFactoryProperties.setTransactionBatchSize(18);
+      connectionFactoryProperties.setUseGlobalPools(!ClientSessionFactoryImpl.DEFAULT_USE_GLOBAL_POOLS);
+      JBossConnectionFactory factory = ra.createJBossConnectionFactory(connectionFactoryProperties);
+      assertEquals(factory.getCallTimeout(), 1);
+      assertEquals(factory.getClientFailureCheckPeriod(), 2);
+      assertEquals(factory.getClientID(), "myid");
+      assertEquals(factory.getConnectionLoadBalancingPolicyClassName(), "mlbcn");
+      assertEquals(factory.getConnectionTTL(), 3);
+      assertEquals(factory.getConsumerMaxRate(), 4);
+      assertEquals(factory.getConsumerWindowSize(), 5);
+      assertEquals(factory.getDiscoveryAddress(), null);
+      assertEquals(factory.getDiscoveryInitialWaitTimeout(), 6);
+      assertEquals(factory.getDiscoveryPort(), 0);
+      assertEquals(factory.getDiscoveryRefreshTimeout(), 7);
+      assertEquals(factory.getDupsOKBatchSize(), 8);
+      assertEquals(factory.getMaxConnections(), 9);
+      assertEquals(factory.getMinLargeMessageSize(), 10);
+      assertEquals(factory.getProducerMaxRate(), 11);
+      assertEquals(factory.getProducerWindowSize(), 12);
+      assertEquals(factory.getReconnectAttempts(), 13);
+      assertEquals(factory.getRetryInterval(), 14);
+      assertEquals(factory.getRetryIntervalMultiplier(), 15d);
+      assertEquals(factory.getScheduledThreadPoolMaxSize(), 16);
+      assertEquals(factory.getThreadPoolMaxSize(), 17);
+      assertEquals(factory.getTransactionBatchSize(), 18);
+      assertEquals(factory.isAutoGroup(), !ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP);
+      assertEquals(factory.isBlockOnAcknowledge(), !ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE);
+      assertEquals(factory.isBlockOnNonPersistentSend(), !ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND);
+      assertEquals(factory.isBlockOnPersistentSend(), !ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND);
+      assertEquals(factory.isFailoverOnServerShutdown(), !ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN);
+      assertEquals(factory.isPreAcknowledge(), !ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE);
+      assertEquals(factory.isUseGlobalPools(), !ClientSessionFactoryImpl.DEFAULT_USE_GLOBAL_POOLS);
+   }
+
+   public void testCreateConnectionFactoryOverrideConnector() throws Exception
+   {
+      JBMResourceAdapter ra = new JBMResourceAdapter();
+      ra.setConnectorClassName(InVMConnector.class.getName());
+      ConnectionFactoryProperties connectionFactoryProperties = new ConnectionFactoryProperties();
+      connectionFactoryProperties.setConnectorClassName(NettyConnector.class.getName());
+      JBossConnectionFactory factory = ra.createJBossConnectionFactory(connectionFactoryProperties);
+      JBossConnectionFactory defaultFactory = ra.getDefaultJBossConnectionFactory();
+      assertNotSame(factory, defaultFactory);
+   }
+
+   public void testCreateConnectionFactoryOverrideDiscovery() throws Exception
+   {
+      JBMResourceAdapter ra = new JBMResourceAdapter();
+      ra.setConnectorClassName(InVMConnector.class.getName());
+      ConnectionFactoryProperties connectionFactoryProperties = new ConnectionFactoryProperties();
+      connectionFactoryProperties.setDiscoveryAddress("myhost");
+      connectionFactoryProperties.setDiscoveryPort(5678);
+      JBossConnectionFactory factory = ra.createJBossConnectionFactory(connectionFactoryProperties);
+      JBossConnectionFactory defaultFactory = ra.getDefaultJBossConnectionFactory();
+      assertNotSame(factory, defaultFactory);
+   }
+
+    public void testCreateConnectionFactoryThrowsException() throws Exception
+   {
+      JBMResourceAdapter ra = new JBMResourceAdapter();
+      ConnectionFactoryProperties connectionFactoryProperties = new ConnectionFactoryProperties();
+      try
+      {
+         JBossConnectionFactory factory = ra.createJBossConnectionFactory(connectionFactoryProperties);
+         fail("should throw exception");
+      }
+      catch (IllegalArgumentException e)
+      {
+         //pass
+      }
+   }
+
    public void testValidateProperties() throws Exception
    {
       validateGettersAndSetters(new JBMResourceAdapter(), "backupTransportConfiguration");
-      validateGettersAndSetters(new JBMManagedConnectionFactory(), "connectionParameters", "sessionDefaultType");
+      validateGettersAndSetters(new JBMManagedConnectionFactory(), "connectionParameters", "sessionDefaultType", "backupConnectionParameters");
       validateGettersAndSetters(new JBMActivationSpec(),
                                 "connectionParameters",
                                 "acknowledgeMode",
@@ -103,16 +351,15 @@
       
       assertEquals("us1", spec.getUser());
       assertEquals("ps1", spec.getPassword());
-      assertEquals("cl1", spec.getClientId());
       
       spec.setUser("us2");
       spec.setPassword("ps2");
-      spec.setClientId("cl2");
+      spec.setClientID("cl2");
 
       
       assertEquals("us2", spec.getUser());
       assertEquals("ps2", spec.getPassword());
-      assertEquals("cl2", spec.getClientId());
+      assertEquals("cl2", spec.getClientID());
       
       
    }
@@ -140,7 +387,7 @@
          ra.setPassword("passwordGlobal");
          ra.start(fakeCTX);
 
-         Connection conn = ra.getJBossConnectionFactory().createConnection();
+         Connection conn = ra.getDefaultJBossConnectionFactory().createConnection();
          
          conn.close();
          
@@ -181,13 +428,13 @@
 
    class MockJBMResourceAdapter extends JBMResourceAdapter
    {
-      public JBossConnectionFactory createRemoteFactory(String connectorClassName,
+      /*public JBossConnectionFactory createRemoteFactory(String connectorClassName,
                                                         Map<String, Object> connectionParameters)
       {
-         JBossConnectionFactory factory = super.createRemoteFactory(connectorClassName, connectionParameters);
+         JBossConnectionFactory factory = super.createJBossConnectionFactory(connectionParameters);
 
          return factory;
-      }
+      }*/
    }
 
    BootstrapContext fakeCTX = new BootstrapContext()




More information about the jboss-cvs-commits mailing list