[jboss-cvs] JBoss Messaging SVN: r3332 - in branches/Branch_Stable: docs/examples and 14 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Nov 15 04:32:43 EST 2007


Author: timfox
Date: 2007-11-15 04:32:43 -0500 (Thu, 15 Nov 2007)
New Revision: 3332

Removed:
   branches/Branch_Stable/docs/examples/singleton/
   branches/Branch_Stable/tests/src/org/jboss/test/messaging/jms/clustering/SingletonCFTest.java
Modified:
   branches/Branch_Stable/.classpath
   branches/Branch_Stable/docs/userguide/en/modules/c_configuration.xml
   branches/Branch_Stable/docs/userguide/en/modules/configuration.xml
   branches/Branch_Stable/src/etc/server/default/deploy/connection-factories-service.xml
   branches/Branch_Stable/src/etc/xmdesc/ConnectionFactory-xmbean.xml
   branches/Branch_Stable/src/etc/xmdesc/Queue-xmbean.xml
   branches/Branch_Stable/src/etc/xmdesc/Topic-xmbean.xml
   branches/Branch_Stable/src/main/org/jboss/jms/server/ConnectionFactoryManager.java
   branches/Branch_Stable/src/main/org/jboss/jms/server/ServerPeer.java
   branches/Branch_Stable/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java
   branches/Branch_Stable/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java
   branches/Branch_Stable/src/main/org/jboss/jms/server/destination/DestinationMBean.java
   branches/Branch_Stable/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
   branches/Branch_Stable/src/main/org/jboss/jms/server/destination/ManagedDestination.java
   branches/Branch_Stable/src/main/org/jboss/jms/server/destination/QueueService.java
   branches/Branch_Stable/src/main/org/jboss/jms/server/destination/TopicService.java
   branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
   branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
   branches/Branch_Stable/src/main/org/jboss/messaging/core/contract/PostOffice.java
   branches/Branch_Stable/src/main/org/jboss/messaging/core/contract/Queue.java
   branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/MessagingQueue.java
   branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/clusterconnection/ClusterConnectionManager.java
   branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java
   branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
   branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
   branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/InVMInitialContextFactory.java
   branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java
   branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/RMINamingDelegate.java
   branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java
   branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/Server.java
Log:
Reverted http://jira.jboss.org/jira/browse/JBMESSAGING-1149


Modified: branches/Branch_Stable/.classpath
===================================================================
--- branches/Branch_Stable/.classpath	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/.classpath	2007-11-15 09:32:43 UTC (rev 3332)
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="docs/examples/queue-failover/src"/>
-	<classpathentry kind="src" path="docs/examples/singleton/src"/>
 	<classpathentry kind="src" path="docs/examples/bridge/src"/>
 	<classpathentry kind="src" path="docs/examples/stateless-clustered/src"/>
 	<classpathentry kind="src" path="docs/examples/web-service/src-client"/>

Modified: branches/Branch_Stable/docs/userguide/en/modules/c_configuration.xml
===================================================================
--- branches/Branch_Stable/docs/userguide/en/modules/c_configuration.xml	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/docs/userguide/en/modules/c_configuration.xml	2007-11-15 09:32:43 UTC (rev 3332)
@@ -1,111 +1,53 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <chapter id="c_configuration">
    <title>JBoss Messaging Clustering Notes</title>
-   
-   <section id="c_conf.serverpeerid">   
-	<title>Unique server peer id</title>
-	<para>JBoss Messaging clustering should work out of the box in most cases
-	with no configuration changes. It is however crucial that every node is
-	assigned a unique server id, as specified in the installation guide.</para>
-	<para>Every node deployed must have a unique id, including those in a
-	particular LAN cluster, and also those only linked by mesage
-	bridges.</para>
-   </section>
-   
-   <section id="c_conf.clustereddests">   
-	<title>Clustered destinations</title>
-	<para>JBoss Messaging clusters JMS queues and topics transparently across
-	the cluster. Messages sent to a distributed queue or topic on one node are
-	consumable on other nodes. To designate that a particular destination is
-	clustered simply set the clustered attribute in the destination deployment
-	descriptor to true.</para>
-	<para>JBoss Messaging balances messages between nodes, catering for faster
-	or slower consumers to efficiently balance processing load across the
-	cluster.</para>
-   </section>
-
-   <section id="c_conf.clustereddursubs">
-	<title>Clustered durable subs</title>
-	<para>JBoss Messaging durable subscriptions can also be clustered. This
-	means multiple subscribers can consume from the same durable subscription
-	from different nodes of the cluster. A durable subscription will be
-	clustered if it's topic is clustered</para>
-   </section>
-   
-   <section id="c_conf.clusteredtempdest">
-	<title>Clustered temporary destinations</title>
-	<para>JBoss Messaging also supports clustered temporary topics and queues.
-	All temporary topics and queues will be clustered if the post office is
-	clustered</para>
-   </section>
-
-   <section id="c_conf.nonclusteredserver">  
-	<title>Non clustered servers</title>
-	<para>If you don't want your nodes to participate in a cluster, or only
-	have one non clustered server you can set the clustered attribute on the
-	postoffice to false</para>
-   </section>
-   
-   
-   <section id="c_conf.orderingincluster">
-	<title>Message ordering in the cluster</title>
-	<para>If you wish to apply strict JMS ordering to messages, such that a
-	particular JMS consumer consumes messages in the same order as they were
-	produced by a particular producer, you can set the DefaultPreserveOrdering
-	attribute in the server peer to true. By default this is false. The
-	side-effect of setting this to true is that messages cannot be distributed
-	as freely around the cluster</para>
-   </section>
-
-   <section id ="c_conf.messagepull">
-	<title>Transactional message pull</title>
-	<para>When pulling reliable messages from one node to another, JBoss
-	Messaging can use client acnowledgement or an XA transaction. The default
-	is client acknowledgement. Using XA transactions is a fairly heavyweight
-	operation but ensures absolute once and only once delivery.</para>
-	<para>It's a good idea to design your application to avoid message pull. A very common deployment scenario is
-        a bank of the same MDBS deployed on each node of the cluster with a well distributed set of producers sending messages
-	to different nodes of the cluster. In such a case message redistribution is probably unnecessary so you can turn
-	it off by setting the DisableRedistribution attribute of the destination to false.
-        </para>
-   </section>
-	   
-   <section id="c_conf.idempotentops">	
-	<title>Idempotent operations</title>
-	<para>If the call to send a persistent message to a persistent destination
-	returns successfully with no exception, then you can be sure that the
-	message was persisted. However if the call doesn't return successfully e.g.
-	if an exception is thrown, then you *can't be sure the message wasn't
-	persisted*. Since the failure might have occurred after persisting the
-	message but before writing the response to the caller. This is a common
-	attribute of any RPC type call: You can't tell by the call not returning
-	that the call didn't actually succeed. Whether it's a web services call, an
-	HTTP get request, an ejb invocation the same applies. The trick is to code
-	your application so your operations are *idempotent* - i.e. they can be
-	repeated without getting the system into an inconsistent state. With a
-	message system you can do this on the application level, by checking for
-	duplicate messages, and discarding them if they arrive. Duplicate checking
-	is a very powerful technique that can remove the need for XA transactions
-	in many cases.</para>
-   </section>
-   
-   <section id="c_conf.singletonconsumer">
-	<title>Singleton consumer</title>
-        <para>Sometimes you may want to guarantee that all messages from a specific queue are consumed sequentially by a single consumer. This can be accomplished by deploying a connection factory with attribute "Singleton" set to true on all nodes of the cluster.
-	JBoss Messaging will then ensure that the connection factory is only bound into JNDI on a single node at any one time.
-	You can then use HA JNDI from the client to look up the connection factory so you don't have to worry about what actual node it is deployed on. You then deploy the queue as a standard clustered queue on all nodes of the cluster with the attribute "DisableRedistribution" set to true to prevent messages being redistributed between queue instances.
-	</para>
-   </section>
-   
-   <section id="c_conf.clusteredcfs">
-	<title>Clustered connection factories</title>
-	<para>If the supportsLoadBalancing attribute of the connection factory is set to true then consecutive create connection attempts will round robin between available servers. The first node to try is chosen randomly</para>
-	<para>If the supportsFailover attribute of the connection factory is set to true then automatic failover is enabled.
-	This will automatically failover from one server to another, transparently to the user, in case of failure.</para>
-        <para>If automatic failover is not required or you wish to do manual failover (JBoss MQ style) this can be set to false, and you can supply a standard JMS ExceptionListener on the connection which will be called in case of
-	connection failure. You would then need to manually close the connection, lookup a new connection factory from
-	HA JNDI and recreate the connection.</para>
-	
-   </section>
-   
+   <para>JBoss Messaging clustering should work out of the box in most cases
+   with no configuration changes. It is however crucial that every node is
+   assigned a unique server id, as specified in the installation guide.</para>
+   <para>Every node deployed must have a unique id, including those in a
+   particular LAN cluster, and also those only linked by mesage
+   bridges.</para>
+   <para>JBoss Messaging clusters JMS queues and topics transparently across
+   the cluster. Messages sent to a distributed queue or topic on one node are
+   consumable on other nodes. To designate that a particular destination is
+   clustered simply set the clustered attribute in the destination deployment
+   descriptor to true.</para>
+   <para>JBoss Messaging balances messages between nodes, catering for faster
+   or slower consumers to efficiently balance processing load across the
+   cluster.</para>
+   <para>JBoss Messaging durable subscrtiptions can also be clustered. This
+   means multiple subscribers can consume from the same durable subscription
+   from different nodes of the cluster. A durable subscription will be
+   clustered if it's topic is clustered</para>
+   <para>JBoss Messaging also supports clustered temporary topics and queues.
+   All temporary topics and queues will be clustered if the post office is
+   clustered</para>
+   <para>If you don't want your nodes to participate in a cluster, or only
+   have one non clustered server you can set the clustered attribute on the
+   postoffice to false</para>
+   <para>If you wish to apply strict JMS ordering to messages, such that a
+   particular JMS consumer consumes messages in the same order as they were
+   produced by a particular producer, you can set the DefaultPreserveOrdering
+   attribute in the server peer to true. By default this is false. The
+   side-effect of setting this to true is that messages cannot be distributed
+   as freely around the cluster</para>
+   <para>When pulling reliable messages from one node to another, JBoss
+   Messaging can use client acnowledgement or an XA transaction. The default
+   is client acknowledgement. Using XA transactions is a fairly heavyweight
+   operation but ensures absolute once and only once delivery.</para>
+   <para>If the call to send a persistent message to a persistent destination
+   returns successfully with no exception, then you can be sure that the
+   message was persisted. However if the call doesn't return successfully e.g.
+   if an exception is thrown, then you *can't be sure the message wasn't
+   persisted*. Since the failure might have occurred after persisting the
+   message but before writing the response to the caller. This is a common
+   attribute of any RPC type call: You can't tell by the call not returning
+   that the call didn't actually succeed. Whether it's a web services call, an
+   HTTP get request, an ejb invocation the same applies. The trick is to code
+   your application so your operations are *idempotent* - i.e. they can be
+   repeated without getting the system into an inconsistent state. With a
+   message system you can do this on the application level, by checking for
+   duplicate messages, and discarding them if they arrive. Duplicate checking
+   is a very powerful technique that can remove the need for XA transactions
+   in many cases.</para>
 </chapter>
\ No newline at end of file

Modified: branches/Branch_Stable/docs/userguide/en/modules/configuration.xml
===================================================================
--- branches/Branch_Stable/docs/userguide/en/modules/configuration.xml	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/docs/userguide/en/modules/configuration.xml	2007-11-15 09:32:43 UTC (rev 3332)
@@ -1347,14 +1347,6 @@
                <para>The number of consumers currently consuming from the
                queue.</para>
             </section>
-	    <section id="conf.destination.queue.attributes.disableredistribution">
-	       <title>DisableRedistribution</title>
-	       <para>By default JBM will distribute messages between nodes for queue or topic according to load.
-	             If you want each partial queue to act as indepenedent queue, set this to true.
-	             This parameter is used as part of the Singleton Consumer pattern when you want to ensure
-	             all messages in a queue are processed sequentially by a single consumer.
-	             See the clustering configuration section for more information.</para>
-            </section>
          </section>
          <section id="conf.destination.queue.operations">
             <title>We now discuss the MBean operations of the Queue
@@ -1571,14 +1563,6 @@
                <para>The count of all non durable subscriptions on this
                topic</para>
             </section>
-	    <section id="conf.destination.queue.attributes.disableredistribution">
-		<title>DisableRedistribution</title>
-		<para>By default JBM will distribute messages between nodes for queue or topic according to load.
-			If you want each partial queue to act as indepenedent queue, set this to true.
-			This parameter is used as part of the Singleton Consumer pattern when you want to ensure
-			all messages in a queue are processed sequentially by a single consumer.
-			See the clustering configuration section for more information.</para>
-            </section>
          </section>
          <section id="conf.destination.topic.operations">
             <title>We now discuss the MBean operations of the Topic
@@ -1709,8 +1693,6 @@
 
       &lt;attribute name="SlowConsumers"&gt;false&lt;/attribute&gt;
       
-      &lt;attribute name="Singleton"&gt;false&lt;/attribute&gt;
-      
       &lt;attribute name="StrictTck"&gt;true&lt;/attribute&gt;
 
       &lt;attribute name="DefaultTempQueueFullSize"&gt;50000&lt;/attribute&gt;
@@ -1767,12 +1749,6 @@
             make sure they don't buffer any messages. Since this can prevent
             them from being consumed by faster consumers.</para>
          </section>
-	 <section id="conf.connectionfactory.attributes.singleton">
-	    <title>Singleton</title>
-	    <para>If this is true. Then JBoss Messaging will ensure that the connection factory is only bound
-	    in JNDI on a single server at any one time. This is useful when you want to implement the Singleton
-            Consumer pattern. See the clustering configuration section for more details</para>
-         </section>
          <section id="conf.connectionfactory.attributes.tckstrictbehavior">
             <title>StrictTck</title>
             <para>Set this to true if you want strict JMS behaviour as

Modified: branches/Branch_Stable/src/etc/server/default/deploy/connection-factories-service.xml
===================================================================
--- branches/Branch_Stable/src/etc/server/default/deploy/connection-factories-service.xml	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/etc/server/default/deploy/connection-factories-service.xml	2007-11-15 09:32:43 UTC (rev 3332)
@@ -123,9 +123,6 @@
       <!- - Disable JBoss Remoting Connector sanity checks - There is rarely a good reason to set this to true - ->
       
       <attribute name="DisableRemotingChecks">false</attribute>
-      
-      <!- - Is the connection factory a singleton - i.e. it only exists on only one node at any one time - ->
-      <attribute name="Singleton">false</attribute>
 
       <!- - The connection factory will be bound in the following places in JNDI - ->
 

Modified: branches/Branch_Stable/src/etc/xmdesc/ConnectionFactory-xmbean.xml
===================================================================
--- branches/Branch_Stable/src/etc/xmdesc/ConnectionFactory-xmbean.xml	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/etc/xmdesc/ConnectionFactory-xmbean.xml	2007-11-15 09:32:43 UTC (rev 3332)
@@ -123,12 +123,6 @@
       <name>DisableRemotingChecks</name>
       <type>boolean</type>
    </attribute>
-   
-   <attribute access="read-write" getMethod="isSingleton" setMethod="setSingleton">
-      <description>Is this connection factory a singleton?</description>
-      <name>Singleton</name>
-      <type>boolean</type>
-   </attribute>   
 
    <!-- Managed operations -->
 

Modified: branches/Branch_Stable/src/etc/xmdesc/Queue-xmbean.xml
===================================================================
--- branches/Branch_Stable/src/etc/xmdesc/Queue-xmbean.xml	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/etc/xmdesc/Queue-xmbean.xml	2007-11-15 09:32:43 UTC (rev 3332)
@@ -127,14 +127,8 @@
       <description>Is this a clustered destination?</description>
       <name>Clustered</name>
       <type>boolean</type>
-   </attribute>  
+   </attribute>   
    
-   <attribute access="read-write" getMethod="isDisableRedistribution" setMethod="setDisableRedistribution">
-      <description>Disable message redistribution for this destination?</description>
-      <name>DisableRedistribution</name>
-      <type>boolean</type>
-   </attribute>  
-   
    <attribute access="read-only" getMethod="getMessageCounter">
       <description>Get the message counter for the queue</description>
       <name>MessageCounter</name>

Modified: branches/Branch_Stable/src/etc/xmdesc/Topic-xmbean.xml
===================================================================
--- branches/Branch_Stable/src/etc/xmdesc/Topic-xmbean.xml	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/etc/xmdesc/Topic-xmbean.xml	2007-11-15 09:32:43 UTC (rev 3332)
@@ -109,12 +109,6 @@
       <type>boolean</type>
    </attribute>
    
-   <attribute access="read-write" getMethod="isDisableRedistribution" setMethod="setDisableRedistribution">
-      <description>Disable message redistribution for this destination?</description>
-      <name>DisableRedistribution</name>
-      <type>boolean</type>
-   </attribute>    
-   
    <attribute access="read-write" getMethod="getMessageCounterHistoryDayLimit" setMethod="setMessageCounterHistoryDayLimit">
       <description>The day limit for the message counters of this topic</description>
       <name>MessageCounterHistoryDayLimit</name>

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/ConnectionFactoryManager.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/ConnectionFactoryManager.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/ConnectionFactoryManager.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -49,8 +49,7 @@
                                  boolean supportsFailover,
                                  boolean supportsLoadBalancing,
                                  LoadBalancingFactory loadBalancingPolicy,
-                                 boolean strictTck,
-                                 boolean singleton) throws Exception;
+                                 boolean strictTck) throws Exception;
 
    void unregisterConnectionFactory(String uniqueName, boolean supportsFailover, boolean supportsLoadBalancing) throws Exception;
 }

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/ServerPeer.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/ServerPeer.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -1096,14 +1096,6 @@
 
    // Public ---------------------------------------------------------------------------------------
    
-   public void closeAllSuckersForQueue(String queueName)
-   {
-      if (clusterConnectionManager != null)
-      {
-         clusterConnectionManager.closeAllSuckersForQueue(queueName);
-      }
-   }
-   
    public void resetAllSuckers()
    {
    	clusterConnectionManager.resetAllSuckers();

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -79,8 +79,6 @@
    private boolean strictTck;
    
    private boolean disableRemotingChecks;
-   
-   private boolean singleton;
 
    // Constructors ---------------------------------------------------------------------------------
 
@@ -104,7 +102,7 @@
       try
       {
          log.debug(this + " starting");
-         
+
          started = true;
          
          if (connectorObjectName == null)
@@ -209,7 +207,7 @@
                                       locatorURI, enablePing, prefetchSize, slowConsumers,
                                       defaultTempQueueFullSize, defaultTempQueuePageSize,                                      
                                       defaultTempQueueDownCacheSize, dupsOKBatchSize, supportsFailover, supportsLoadBalancing,
-                                      loadBalancingFactory, strictTck, singleton);               
+                                      loadBalancingFactory, strictTck);               
          
          String info = "Connector " + locator.getProtocol() + "://" +
             locator.getHost() + ":" + locator.getPort();
@@ -301,16 +299,6 @@
    {
    	this.slowConsumers = slowConsumers;
    }
-   
-   public boolean isSingleton()
-   {
-      return singleton;
-   }
-   
-   public void setSingleton(boolean singleton)
-   {
-      this.singleton = singleton;
-   }
 
    public String getClientID()
    {

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -32,6 +32,7 @@
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
+import javax.naming.NamingException;
 
 import org.jboss.aop.AspectManager;
 import org.jboss.jms.client.JBossConnectionFactory;
@@ -54,6 +55,7 @@
 import org.jboss.messaging.util.Version;
 import org.jboss.remoting.InvokerLocator;
 
+import EDU.oswego.cs.dl.util.concurrent.Executor;
 import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
 import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
 
@@ -120,8 +122,7 @@
                                                       boolean supportsFailover,
                                                       boolean supportsLoadBalancing,
                                                       LoadBalancingFactory loadBalancingFactory,
-                                                      boolean strictTck,
-                                                      boolean singleton)
+                                                      boolean strictTck)
       throws Exception
    {
       log.debug(this + " registering connection factory '" + uniqueName + "', bindings: " + jndiBindings);
@@ -137,7 +138,7 @@
       String id = uniqueName;
       
       Version version = serverPeer.getVersion();
-      
+
       ServerConnectionFactoryEndpoint endpoint =
          new ServerConnectionFactoryEndpoint(uniqueName, id, serverPeer, clientID,
                                              jndiBindings, prefetchSize,
@@ -146,8 +147,7 @@
                                              defaultTempQueuePageSize,
                                              defaultTempQueueDownCacheSize,
                                              dupsOKBatchSize,
-                                             supportsFailover,
-                                             singleton);
+                                             supportsFailover);
       endpoints.put(uniqueName, endpoint);
 
       ConnectionFactoryDelegate delegate = null;
@@ -220,8 +220,7 @@
       delegates.put(uniqueName, delegate);
 
       // Now bind it in JNDI
-      rebindConnectionFactory(initialContext, jndiBindings, delegate, singleton);
-      
+      rebindConnectionFactory(initialContext, jndiBindings, delegate);
 
       ConnectionFactoryAdvised advised;
 
@@ -253,21 +252,16 @@
          throw new IllegalArgumentException("Cannot find endpoint with name " + uniqueName);
       }
 
-      boolean singleton = endpoint.isSingleton();
-      
-      if (!singleton || (singleton && serverPeer.getPostOfficeInstance().isMaster()))
-      {         
-         JNDIBindings jndiBindings = endpoint.getJNDIBindings();
-   
-         if (jndiBindings != null)
+      JNDIBindings jndiBindings = endpoint.getJNDIBindings();
+
+      if (jndiBindings != null)
+      {
+         List jndiNames = jndiBindings.getNames();
+         for(Iterator i = jndiNames.iterator(); i.hasNext(); )
          {
-            List jndiNames = jndiBindings.getNames();
-            for(Iterator i = jndiNames.iterator(); i.hasNext(); )
-            {
-               String jndiName = (String)i.next();
-               initialContext.unbind(jndiName);
-               log.debug(jndiName + " unregistered");
-            }
+            String jndiName = (String)i.next();
+            initialContext.unbind(jndiName);
+            log.debug(jndiName + " unregistered");
          }
       }
 
@@ -314,7 +308,7 @@
 
    public void notify(final ClusterNotification notification)
    {
-      log.debug(this + " received notification from node " + notification.nodeID  + " type " + notification.type);
+      log.debug(this + " received notification from node " + notification.nodeID );
 
       class NotifyRunner implements Runnable
       {
@@ -322,14 +316,11 @@
          {
             try
             {
-               if (notification.type == ClusterNotification.TYPE_NODE_JOIN ||
-                   notification.type == ClusterNotification.TYPE_NODE_LEAVE)
+               if (notification.type == ClusterNotification.TYPE_NODE_JOIN || notification.type == ClusterNotification.TYPE_NODE_LEAVE)
                {
                   // We respond to changes in the node-address mapping. This will be replicated whan a
                   // node joins / leaves the group. When this happens we need to rebind all connection factories with the new mapping.
 
-                  log.debug("Received node join/leave " + notification.type);
-                  
                   Map failoverMap = serverPeer.getPostOfficeInstance().getFailoverMap();
 
                   // Rebind
@@ -338,30 +329,19 @@
                   {
                      Map.Entry entry = (Map.Entry)i.next();
                      String uniqueName = (String)entry.getKey();
-                     
-                     ConnectionFactoryDelegate del = (ConnectionFactoryDelegate)delegates.get(uniqueName);
 
+                     Object del = delegates.get(uniqueName);
+
                      if (del == null)
                      {
                         throw new IllegalStateException(
                            "Cannot find connection factory with name " + uniqueName);
                      }
- 
+
                      if (del instanceof ClientClusteredConnectionFactoryDelegate)
                      {
-                        //Update the failover map
                         ((ClientClusteredConnectionFactoryDelegate)del).setFailoverMap(failoverMap);
                      }
-                        
-                     ServerConnectionFactoryEndpoint endpoint =
-                        (ServerConnectionFactoryEndpoint)endpoints.get(uniqueName);
-
-                     if (endpoint == null)
-                     {
-                        throw new IllegalStateException("Cannot find endpoint with name " + uniqueName);
-                     }
-                     
-                     rebindConnectionFactory(initialContext, endpoint.getJNDIBindings(), del, endpoint.isSingleton());                     
                   }
                }
                else if ((notification.type == ClusterNotification.TYPE_REPLICATOR_PUT || notification.type == ClusterNotification.TYPE_REPLICATOR_REMOVE) &&
@@ -373,7 +353,7 @@
 
                   // NOTE! All connection factories MUST be deployed on all nodes!
                   // Otherwise the server might failover onto a node which doesn't have that connection factory deployed
-                  // so the connection won't be able to reconnect.
+                  // so the connection won't be able to recconnect.
 
                   String key = (String)notification.data;
 
@@ -422,7 +402,7 @@
                            throw new IllegalStateException("Cannot find endpoint with name " + uniqueName);
                         }
 
-                        rebindConnectionFactory(initialContext, endpoint.getJNDIBindings(), del, endpoint.isSingleton());
+                        rebindConnectionFactory(initialContext, endpoint.getJNDIBindings(), del);
 
                         endpoint.updateClusteredClients(delArr, failoverMap);
                      }
@@ -498,25 +478,19 @@
    }
 
    private void rebindConnectionFactory(Context ic, JNDIBindings jndiBindings,
-                                        ConnectionFactoryDelegate delegate, boolean singleton) throws Exception
+                                        ConnectionFactoryDelegate delegate)
+      throws NamingException
    {
-      //If the cf is a singleton - it is only bound on the master
-      
-      boolean isMaster = serverPeer.getPostOfficeInstance().isMaster();
-      
-      if (!singleton || (isMaster && singleton))
+      JBossConnectionFactory cf = new JBossConnectionFactory(delegate);
+
+      if (jndiBindings != null)
       {
-         JBossConnectionFactory cf = new JBossConnectionFactory(delegate);
-   
-         if (jndiBindings != null)
+         List jndiNames = jndiBindings.getNames();
+         for(Iterator i = jndiNames.iterator(); i.hasNext(); )
          {
-            List jndiNames = jndiBindings.getNames();
-            for(Iterator i = jndiNames.iterator(); i.hasNext(); )
-            {
-               String jndiName = (String)i.next();
-               log.debug(this + " rebinding " + cf + " as " + jndiName);
-               JNDIUtil.rebind(ic, jndiName, cf);
-            }
+            String jndiName = (String)i.next();
+            log.debug(this + " rebinding " + cf + " as " + jndiName);
+            JNDIUtil.rebind(ic, jndiName, cf);
          }
       }
    }

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/destination/DestinationMBean.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/destination/DestinationMBean.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/destination/DestinationMBean.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -94,10 +94,6 @@
    
    void setMaxDeliveryAttempts(int maxDeliveryAttempts);
    
-   boolean isDisableRedistribution();
-   
-   void setDisableRedistribution(boolean disable);
-   
    // JMX operations
    
    void removeAllMessages() throws Exception;

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/destination/DestinationServiceSupport.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -420,21 +420,6 @@
       destination.setMaxDeliveryAttempts(maxDeliveryAttempts);
    }
    
-   public boolean isDisableRedistribution()
-   {
-      return destination.isDisableRedistribution();
-   }
-   
-   public void setDisableRedistribution(boolean disable)
-   {
-      if (started)
-      {
-         log.warn("DisableRedistribution can only be changed when destination is stopped");
-         return;
-      }
-      destination.setDisableRedistribution(disable);
-   }
-   
    // JMX managed operations ----------------------------------------
    
    public abstract void removeAllMessages() throws Exception;

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/destination/ManagedDestination.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/destination/ManagedDestination.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/destination/ManagedDestination.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -90,8 +90,6 @@
    protected int messageCounterHistoryDayLimit = -1;
    
    protected int maxDeliveryAttempts = -1;
-   
-   protected boolean disableRedistribution;
     
    public ManagedDestination()
    {      
@@ -308,16 +306,6 @@
    {
       this.maxDeliveryAttempts = maxDeliveryAttempts;
    }
-   
-   public void setDisableRedistribution(boolean disable)
-   {
-      this.disableRedistribution = disable;
-   }
-   
-   public boolean isDisableRedistribution()
-   {
-      return this.disableRedistribution;
-   }
      
    public abstract boolean isQueue();
 

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/destination/QueueService.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/destination/QueueService.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/destination/QueueService.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -85,7 +85,7 @@
             queue.setPagingParams(destination.getFullSize(),
                                   destination.getPageSize(),
                                   destination.getDownCacheSize());  
-                                   
+            
             queue.load();
                
             // Must be done after load
@@ -111,13 +111,6 @@
             
             queue.activate();
          }
-                  
-         if (destination.isDisableRedistribution())
-         {
-            queue.setDisableRedistribution(destination.isDisableRedistribution());
-            
-            serverPeer.closeAllSuckersForQueue(queue.getName());
-         }
          
          ((ManagedQueue)destination).setQueue(queue);
          

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/destination/TopicService.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/destination/TopicService.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/destination/TopicService.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -104,12 +104,6 @@
             
             serverPeer.getMessageCounterManager().registerMessageCounter(counterName, counter);    
             
-            if (destination.isDisableRedistribution())
-            {
-               queue.setDisableRedistribution(destination.isDisableRedistribution());
-               
-               serverPeer.closeAllSuckersForQueue(queue.getName());
-            }            
             //Now we need to trigger a delivery - this is because message suckers might have
             //been create *before* the queue was deployed - this is because message suckers can be
             //created when the clusterpullconnectionfactory deploy is detected which then causes

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -84,8 +84,6 @@
    
    private boolean slowConsumers;
 
-   private boolean singleton;
-   
    /** Cluster Topology on ClusteredConnectionFactories
        Information to failover to other connections on clients **/
    ClientConnectionFactoryDelegate[] delegates;
@@ -111,8 +109,7 @@
                                           int defaultTempQueuePageSize,
                                           int defaultTempQueueDownCacheSize,
                                           int dupsOKBatchSize,
-                                          boolean supportsFailover,
-                                          boolean singleton)
+                                          boolean supportsFailover)
    {
       this.uniqueName = uniqueName;
       this.serverPeer = serverPeer;
@@ -126,7 +123,6 @@
       this.dupsOKBatchSize = dupsOKBatchSize;
       this.supportsFailover = supportsFailover;
       this.slowConsumers = slowConsumers;
-      this.singleton = singleton;
       if (slowConsumers)
       {
       	this.prefetchSize = 1;
@@ -358,11 +354,6 @@
    {
    	return slowConsumers;
    }
-   
-   public boolean isSingleton()
-   {
-      return singleton;
-   }
 
    public String toString()
    {

Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -2090,11 +2090,6 @@
                }
             }
          }
-         
-         if (mDest.isDisableRedistribution())
-         {
-            queue.setDisableRedistribution(true);
-         }
       }
       else
       {

Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/contract/PostOffice.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/contract/PostOffice.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/contract/PostOffice.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -150,9 +150,7 @@
 	
 	boolean isFirstNode();
 	
-	boolean isMaster();
 	
-	
 	//For testing only
 	Map getRecoveryArea(String queueName);
    

Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/contract/Queue.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/contract/Queue.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/contract/Queue.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -61,10 +61,6 @@
    
    boolean isClustered();
    
-   boolean isDisableRedistribution();
-   
-   void setDisableRedistribution(boolean disable);
-   
    String getName();
    
    int getNodeID();

Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/MessagingQueue.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/MessagingQueue.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/MessagingQueue.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -100,8 +100,6 @@
    
    private long recoverDeliveriesTimeout;
    
-   private boolean disableRedistribution;
-   
    // Constructors --------------------------------------------------
        
    public MessagingQueue(int nodeID, String name, long id, MessageStore ms, PersistenceManager pm,             
@@ -365,10 +363,6 @@
    	
    	synchronized (lock)
    	{
-   	   if (disableRedistribution)
-   	   {
-   	      return;
-   	   }
    		if (!suckers.contains(sucker))
    		{
    			suckers.add(sucker);
@@ -384,7 +378,7 @@
    		}
    	}
    }
-      
+   
    public boolean unregisterSucker(MessageSucker sucker)
    {
    	synchronized (lock)
@@ -504,16 +498,6 @@
    	return this.recoveryMap.size();
    }
    
-   public void setDisableRedistribution(boolean disable)
-   {
-      this.disableRedistribution = disable;
-   }
-   
-   public boolean isDisableRedistribution()
-   {
-      return this.disableRedistribution;
-   }
-   
    // ChannelSupport overrides --------------------------------------
    
    protected void deliverInternal()

Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/clusterconnection/ClusterConnectionManager.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/clusterconnection/ClusterConnectionManager.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/clusterconnection/ClusterConnectionManager.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -167,18 +167,6 @@
 		}
 	}
 	
-	public void closeAllSuckersForQueue(String queueName)
-	{
-	   Iterator iter = connections.values().iterator();
-      
-      while (iter.hasNext())
-      {
-         ConnectionInfo conn = (ConnectionInfo)iter.next();
-         
-         conn.closeAllSuckersForQueue(queueName);
-      }
-	}
-	
 	public void setIsXA(boolean xa) throws Exception
 	{
 		boolean needToClose = this.xa != xa;
@@ -480,7 +468,7 @@
 
 			Queue localQueue = binding.queue;
 			
-			if (localQueue.isClustered() && !localQueue.isDisableRedistribution())
+			if (localQueue.isClustered())
 			{				
 				MessageSucker sucker = new MessageSucker(localQueue, info.connection, localInfo.connection, xa, preserveOrdering);
 	
@@ -698,23 +686,6 @@
 			suckers.clear();
 		}
 		
-		synchronized void closeAllSuckersForQueue(String queueName)
-      {
-         Iterator iter = suckers.values().iterator();
-         
-         while (iter.hasNext())
-         {
-            MessageSucker sucker = (MessageSucker)iter.next();
-            
-            if (sucker.getQueueName().equals(queueName))
-            {            
-               sucker.stop();
-               
-               iter.remove();
-            }
-         }
-      }
-		
 		synchronized void close()
 		{
 			closeAllSuckers();			

Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -91,7 +91,7 @@
    private CountDownLatch latch;
    
    private volatile boolean starting;
-         
+   
    //We need to process view changes on a different thread, since if we have more than one node running
    //in the same VM then the thread that sends the leave message ends up executing the view change on the other node
    //We probably don't need this if all nodes are in different VMs
@@ -208,12 +208,12 @@
       Thread.sleep(1000);
    }
    
-   public Address getControlChannelAddress()
+   public Address getSyncAddress()
    {
    	return controlChannel.getLocalAddress();
    }
    
-   public Address getDataChannelAddress()
+   public Address getAsyncAddress()
    {
    	return dataChannel.getLocalAddress();
    }
@@ -227,7 +227,7 @@
    {
    	return currentView;
    }
-      
+   
    public void multicastControl(ClusterRequest request, boolean sync) throws Exception
    {
    	if (ready.get())

Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -216,7 +216,7 @@
    //use it
    private ServerPeer serverPeer;
    
-   //Note this MUST be a queued executor to ensure replicate responses arrive back in order
+   //Note this MUST be a queued executor to ensure replicate repsonses arrive back in order
    private QueuedExecutor replyExecutor;
    
    private QueuedExecutor replicateResponseExecutor;
@@ -230,7 +230,7 @@
    private ClearableSemaphore replicateSemaphore;
    
    private boolean useJGroupsWorkaround;
-         
+      
    // Constructors ---------------------------------------------------------------------------------
 
    /*
@@ -354,7 +354,7 @@
 	      			"Are you sure you have given each node a unique node id during installation?");
 	      }
 	
-	      PostOfficeAddressInfo info = new PostOfficeAddressInfo(groupMember.getControlChannelAddress(), groupMember.getDataChannelAddress());
+	      PostOfficeAddressInfo info = new PostOfficeAddressInfo(groupMember.getSyncAddress(), groupMember.getAsyncAddress());
 	      
 	      nodeIDAddressMap.put(new Integer(thisNodeID), info);	     
 	      
@@ -976,19 +976,6 @@
 	   sendJMXNotification(VIEW_CHANGED_NOTIFICATION);
    }
    
-   public boolean isMaster()
-   {
-      View currentView = groupMember.getCurrentView();
-      if (currentView != null)
-      {
-         return currentView.getMembers().get(0).equals(groupMember.getControlChannelAddress());
-      }
-      else
-      {
-         return false;
-      }
-   }
-   
    // RequestTarget implementation ------------------------------------------------------------
    
    /*
@@ -2012,9 +1999,7 @@
    	   //This is ok - it wil be shortly followed by another calculation of the map
    	}
    	
-      log.debug("Updated failover map:\n" + dumpFailoverMap(failoverMap));
-      
-      log.debug("We are master " + this.isMaster());
+      log.debug("Updated failover map:\n" + dumpFailoverMap(failoverMap));   	      
    }
    
    private Integer findNodeIDForAddress(Address address)
@@ -2125,7 +2110,7 @@
          			else
          			{
          				//From the cluster
-         				if (!queue.isRecoverable() && queue.isClustered() && !queue.isDisableRedistribution())
+         				if (!queue.isRecoverable() && queue.isClustered())
          				{
          					//When routing from the cluster we only route to non recoverable queues
          					//who haven't already been routed to on the sending node (same name)
@@ -2164,7 +2149,7 @@
          			
          			if (trace) { log.trace(this + " is a remote queue"); }
          			
-         			if (!queue.isRecoverable() && queue.isClustered() && !queue.isDisableRedistribution())
+         			if (!queue.isRecoverable() && queue.isClustered())
          			{	         			
          				//When we send to the cluster we never send to reliable queues
          				

Deleted: branches/Branch_Stable/tests/src/org/jboss/test/messaging/jms/clustering/SingletonCFTest.java
===================================================================
--- branches/Branch_Stable/tests/src/org/jboss/test/messaging/jms/clustering/SingletonCFTest.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/tests/src/org/jboss/test/messaging/jms/clustering/SingletonCFTest.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -1,323 +0,0 @@
-/*
-   * JBoss, Home of Professional Open Source
-   * Copyright 2005, JBoss Inc., and individual contributors as indicated
-   * by the @authors tag. See the copyright.txt in the distribution for a
-   * full listing of individual contributors.
-   *
-   * This is free software; you can redistribute it and/or modify it
-   * under the terms of the GNU Lesser General Public License as
-   * published by the Free Software Foundation; either version 2.1 of
-   * the License, or (at your option) any later version.
-   *
-   * This software is distributed in the hope that it will be useful,
-   * but WITHOUT ANY WARRANTY; without even the implied warranty of
-   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   * Lesser General Public License for more details.
-   *
-   * You should have received a copy of the GNU Lesser General Public
-   * License along with this software; if not, write to the Free
-   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-   */
-
-package org.jboss.test.messaging.jms.clustering;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-
-import org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-
-/**
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision:  $</tt>
- *
- * $Id: $
- */
-public class SingletonCFTest extends MessagingTestCase
-{
-
-   // Constants ------------------------------------------------------------------------------------
-
-   // Attributes -----------------------------------------------------------------------------------
-
-   // Static ---------------------------------------------------------------------------------------
-
-   // Constructors ---------------------------------------------------------------------------------
-
-   public SingletonCFTest(String name)
-   {
-      super(name);
-   }
-
-   // Public ---------------------------------------------------------------------------------------
-      
-   //BTW this is all in one test to avoid overhead in starting and killing a lot of servers
-   public void testDeploy() throws Exception
-   {   
-      final String cfName = "SingletonCF";
-      
-      ServerManagement.start(0, "all", false);
-      ServerManagement.start(1, "all", false);
-      ServerManagement.start(2, "all", false);
-      
-      this.deployCF(cfName, 0);
-      this.deployCF(cfName, 1);
-      this.deployCF(cfName, 2);
-      
-      //Singleton should only deploy on the master
-      this.validateCFExists(cfName, 0, true);
-      this.validateCFExists(cfName, 1, false);
-      this.validateCFExists(cfName, 2, false);
-      
-      log.info("Stopping master");      
-      
-      //Now stop the master
-      ServerManagement.stop(0);
-           
-      Thread.sleep(5000);
-      
-      this.validateCFExists(cfName, 1, true);
-      this.validateCFExists(cfName, 2, false);
-      
-      ServerManagement.start(0, "all", false);
-      this.deployCF(cfName, 0);
-      
-      Thread.sleep(5000);
-      
-      this.validateCFExists(cfName, 0, false);
-      this.validateCFExists(cfName, 1, true);
-      this.validateCFExists(cfName, 2, false);
-      
-      //Node 1 is now the master - let's kill that
-      
-      ServerManagement.kill(1);
-      
-      Thread.sleep(5000);
-      
-      this.validateCFExists(cfName, 0, false);
-      this.validateCFExists(cfName, 2, true);
-      
-      ServerManagement.start(1, "all", false);
-      
-      Thread.sleep(5000);
-      
-      this.validateCFExists(cfName, 0, false);
-      this.validateCFExists(cfName, 1, false);
-      this.validateCFExists(cfName, 2, true);
-      
-      noRedist(true);
-      
-      noRedist(false);
-   }
-   
-   private void noRedist(boolean queue) throws Exception
-   {   
-      String destLookup;
-      if (queue)
-      {
-         ServerManagement.deployQueue("noredistQueue", true, 0);
-         ServerManagement.deployQueue("noredistQueue", true, 1);
-         ServerManagement.deployQueue("noredistQueue", true, 2);
-         destLookup = "/queue/noredistQueue";
-      }
-      else
-      {
-         ServerManagement.deployTopic("noredistTopic", true, 0);
-         ServerManagement.deployTopic("noredistTopic", true, 1);
-         ServerManagement.deployTopic("noredistTopic", true, 2);
-         destLookup = "/topic/noredistTopic";
-      }
-      
-      Connection conn0 = null;
-      Connection conn1 = null;
-      Connection conn2 = null;
-         
-      try
-      {                          
-         InitialContext ic0 = new InitialContext(ServerManagement.getJNDIEnvironment(0));
-         ConnectionFactory cf0 = (ConnectionFactory)ic0.lookup("/ConnectionFactory");
-         Destination dest0 = (Destination)ic0.lookup(destLookup);
-         conn0 = cf0.createConnection();
-         Session sess0 = conn0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageConsumer cons0 = sess0.createConsumer(dest0);
-         MyListener list0 = new MyListener();
-         cons0.setMessageListener(list0);
-         conn0.start();
-         
-         InitialContext ic1 = new InitialContext(ServerManagement.getJNDIEnvironment(1));
-         ConnectionFactory cf1 = (ConnectionFactory)ic1.lookup("/ConnectionFactory");
-         Destination dest1 = (Destination)ic1.lookup(destLookup);
-         conn1 = cf1.createConnection();
-         Session sess1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageConsumer cons1 = sess1.createConsumer(dest1);
-         MyListener list1 = new MyListener();
-         cons1.setMessageListener(list1);
-         conn1.start();
-         
-         InitialContext ic2 = new InitialContext(ServerManagement.getJNDIEnvironment(2));
-         ConnectionFactory cf2 = (ConnectionFactory)ic2.lookup("/SingletonCF");
-         Destination dest2 = (Destination)ic2.lookup(destLookup);
-         conn2 = cf2.createConnection();
-         Session sess2 = conn2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageConsumer cons2 = sess2.createConsumer(dest2);
-         MyListener list2 = new MyListener();
-         cons2.setMessageListener(list2);
-         conn2.start();
-         
-         final int numMessages = 1000;
-         
-         MessageProducer prod = sess2.createProducer(dest2);
-         
-         for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage tm = sess2.createTextMessage("message" + i);
-            
-            prod.send(tm);
-         }
-         
-         Thread.sleep(5000);
-         
-         assertNull(list0.msg);
-         assertNull(list1.msg);
-         assertNotNull(list2.msg);
-         
-         list0.msg = null;
-         list1.msg = null;
-         list2.msg = null;
-         
-         prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-         
-         for (int i = 0; i < numMessages; i++)
-         {
-            TextMessage tm = sess2.createTextMessage("message" + i);
-            
-            prod.send(tm);
-         }
-         
-         Thread.sleep(5000);
-         
-         assertNull(list0.msg);
-         assertNull(list1.msg);
-         assertNotNull(list2.msg);
-         
-         log.info("Done");
-      }
-      finally
-      {     
-         if (conn0 != null)
-            conn0.close();
-         
-         if (conn1 != null)
-            conn1.close();
-         
-         if (conn2 != null)
-            conn2.close();
-         
-         if (queue)
-         {
-            ServerManagement.undeployQueue("noredistQueue", 0);
-            ServerManagement.undeployQueue("noredistQueue", 1);
-            ServerManagement.undeployQueue("noredistQueue", 2);
-         }
-         else
-         {
-            ServerManagement.undeployTopic("noredistTopic", 0);
-            ServerManagement.undeployTopic("noredistTopic", 1);
-            ServerManagement.undeployTopic("noredistTopic", 2);
-         }
-      }      
-   }
-   
-   // Package protected ----------------------------------------------------------------------------
-
-   // Protected ------------------------------------------------------------------------------------
-
-   protected void setUp() throws Exception
-   {
-      super.setUp();     
-   }
-
-   protected void tearDown() throws Exception
-   {
-      super.tearDown();
-      
-      for (int i = ServerManagement.MAX_SERVER_COUNT - 1; i >=0; i--)
-      {
-         ServerManagement.kill(i);
-      }
-   }
-
-   // Private --------------------------------------------------------------------------------------
-      
-   private void deployCF(String name, int node) throws Exception
-   {
-      String objectName = "jboss.messaging.connectionfactory:service=" + name;
-      String[] bindings = new String[] { "/" + name };
-      ServerManagement.getServer(node).deployConnectionFactory(objectName, bindings, 150, true);
-   }
-   
-   private void undeployCF(String name, int node) throws Exception
-   {
-      String objectName = "jboss.messaging.connectionfactory:service=" + name;
-      ServerManagement.getServer(node).undeployConnectionFactory(new ObjectName(objectName));
-   }
-   
-   private void validateCFExists(String name, int node, boolean exists)
-   {
-      try
-      {
-         InitialContext ic = new InitialContext(ServerManagement.getJNDIEnvironment(node));
-                  
-         ConnectionFactory cf = (ConnectionFactory)ic.lookup(name);
-         
-         if (!exists)
-         {
-            fail("Connection factory exists");
-         }
-      }
-      catch (Exception e)
-      {
-         if (exists)
-         {
-            fail("Connection factory does not exist");
-         }
-      }
-   }
-   
-   
-   // Inner classes --------------------------------------------------------------------------------
-   
-   private class MyListener implements MessageListener
-   {
-      private volatile Message msg;
-
-      public void onMessage(Message msg)
-      {
-         this.msg = msg;
-         
-         //log.info(this + " got message " + msg);
-         
-         //Sleep a little so the buffer gets full
-         try
-         {
-            Thread.sleep(10);
-         }
-         catch (Exception ignore)
-         {            
-         }
-      }      
-   }
-   
-}

Modified: branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
===================================================================
--- branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/ServerManagement.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/ServerManagement.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -892,15 +892,6 @@
       insureStarted(serverIndex);
       servers[serverIndex].getServer().deployTopic(name, null, true);
    }
-   
-   /**
-    * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
-    */
-   public static void deployTopic(String name, boolean disableRedistribution, int serverIndex) throws Exception
-   {
-      insureStarted(serverIndex);
-      servers[serverIndex].getServer().deployTopic(name, null, true, disableRedistribution);
-   }
 
    /**
     * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
@@ -986,15 +977,6 @@
       insureStarted(serverIndex);
       servers[serverIndex].getServer().deployQueue(name, null, true);
    }
-   
-   /**
-    * Simulates a queue deployment (copying the queue descriptor in the deploy directory).
-    */
-   public static void deployQueue(String name, boolean disableRedistribution, int serverIndex) throws Exception
-   {
-      insureStarted(serverIndex);
-      servers[serverIndex].getServer().deployQueue(name, null, true, disableRedistribution);
-   }
 
    /**
     * Simulates a queue deployment (copying the queue descriptor in the deploy directory).

Modified: branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/InVMInitialContextFactory.java
===================================================================
--- branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/InVMInitialContextFactory.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/InVMInitialContextFactory.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -47,18 +47,13 @@
 
    static
    {
-      reset();
+      initialContexts = new HashMap();
    }
 
    public static Hashtable getJNDIEnvironment()
    {
       return getJNDIEnvironment(0);
    }
-   
-   public static void reset()
-   {
-      initialContexts = new HashMap();
-   }
 
    /**
     * @return the JNDI environment to use to get this InitialContextFactory.

Modified: branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java
===================================================================
--- branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -587,13 +587,8 @@
 
    public void deployTopic(String name, String jndiName, boolean clustered) throws Exception
    {
-      deployDestination(false, name, jndiName, clustered, false);
+      deployDestination(false, name, jndiName, clustered);
    }
-   
-   public void deployTopic(String name, String jndiName, boolean clustered, boolean disableRedistribution) throws Exception
-   {
-      deployDestination(false, name, jndiName, clustered, disableRedistribution);
-   }
 
    public void deployTopic(String name, String jndiName, int fullSize, int pageSize,
                            int downCacheSize, boolean clustered) throws Exception
@@ -610,13 +605,8 @@
 
    public void deployQueue(String name, String jndiName, boolean clustered) throws Exception
    {
-      deployDestination(true, name, jndiName, clustered, false);
+      deployDestination(true, name, jndiName, clustered);
    }
-   
-   public void deployQueue(String name, String jndiName, boolean clustered, boolean disableRedistribution) throws Exception
-   {
-      deployDestination(true, name, jndiName, clustered, disableRedistribution);
-   }
 
    public void deployQueue(String name, String jndiName, int fullSize, int pageSize,
                            int downCacheSize, boolean clustered) throws Exception
@@ -631,8 +621,7 @@
                 new String[] { "java.lang.String", "java.lang.String"} );
    }
 
-   public void deployDestination(boolean isQueue, String name, String jndiName, boolean clustered,
-                                 boolean disableRedistribution) throws Exception
+   public void deployDestination(boolean isQueue, String name, String jndiName, boolean clustered) throws Exception
    {
       String config =
          "<mbean code=\"org.jboss.jms.server.destination." + (isQueue ? "QueueService" : "TopicService") + "\"" +
@@ -641,7 +630,6 @@
          (jndiName != null ? "    <attribute name=\"JNDIName\">" + jndiName + "</attribute>" : "") +
          "       <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>" +
          "       <attribute name=\"Clustered\">" + String.valueOf(clustered) + "</attribute>" +
-         "       <attribute name=\"DisableRedistribution\">" + String.valueOf(disableRedistribution) + "</attribute>" +
          "</mbean>";
 
       MBeanConfigurationElement mbean =
@@ -716,31 +704,24 @@
                                     new String[] { "java.lang.String"})).booleanValue();
       }
    }
-   
-   public void deployConnectionFactory(String objectName,
-         String[] jndiBindings,
-         int prefetchSize, boolean singleton) throws Exception
-   {
-      deployConnectionFactory(objectName, jndiBindings, prefetchSize, -1, -1, -1, false, false, false, singleton);
-   }
 
    public void deployConnectionFactory(String objectName,
                                        String[] jndiBindings,
                                        int prefetchSize) throws Exception
    {
-      deployConnectionFactory(objectName, jndiBindings, prefetchSize, -1, -1, -1, false, false, false, false);
+      deployConnectionFactory(objectName, jndiBindings, prefetchSize, -1, -1, -1, false, false, false);
    }
 
    public void deployConnectionFactory(String objectName,
                                        String[] jndiBindings) throws Exception
    {
-      deployConnectionFactory(objectName, jndiBindings, -1, -1, -1, -1, false, false, false, false);
+      deployConnectionFactory(objectName, jndiBindings, -1, -1, -1, -1, false, false, false);
    }
 
 
     public void deployConnectionFactory(String objectName, String[] jndiBindings, boolean strictTck)  throws Exception
     {
-        deployConnectionFactory(objectName, jndiBindings, -1, -1, -1, -1, false, false, strictTck, false);
+        deployConnectionFactory(objectName, jndiBindings, -1, -1, -1, -1, false, false, strictTck);
     }
 
     public void deployConnectionFactory(String objectName,
@@ -751,7 +732,7 @@
          int defaultTempQueueDownCacheSize) throws Exception
    {
    	this.deployConnectionFactory(objectName, jndiBindings, prefetchSize, defaultTempQueueFullSize,
-   			defaultTempQueuePageSize, defaultTempQueueDownCacheSize, false, false, false, false);
+   			defaultTempQueuePageSize, defaultTempQueueDownCacheSize, false, false, false);
    }
    
    public void deployConnectionFactory(String objectName,
@@ -759,7 +740,7 @@
          boolean supportsFailover, boolean supportsLoadBalancing) throws Exception
    {
    	this.deployConnectionFactory(objectName, jndiBindings, -1, -1,
-   			-1, -1, supportsFailover, supportsLoadBalancing, false, false);
+   			-1, -1, supportsFailover, supportsLoadBalancing, false);
    }
 
    private void deployConnectionFactory(String objectName,
@@ -770,8 +751,7 @@
                                        int defaultTempQueueDownCacheSize,
                                        boolean supportsFailover,
                                        boolean supportsLoadBalancing,
-                                       boolean strictTck,
-                                       boolean singleton) throws Exception
+                                       boolean strictTck) throws Exception
    {
       log.trace("deploying connection factory with name: " + objectName);
       
@@ -806,7 +786,6 @@
       config += "<attribute name=\"SupportsFailover\">" + supportsFailover + "</attribute>";
       config += "<attribute name=\"SupportsLoadBalancing\">" + supportsLoadBalancing + "</attribute>";
       config += "<attribute name=\"StrictTck\">" + strictTck + "</attribute>";
-      config += "<attribute name=\"Singleton\">" + singleton + "</attribute>";
       if (jndiBindings != null)
       {
 	      config += "<attribute name=\"JNDIBindings\"><bindings>";

Modified: branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/RMINamingDelegate.java
===================================================================
--- branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/RMINamingDelegate.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/RMINamingDelegate.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -104,8 +104,6 @@
       public void reset()
       {
          ic = null;
-         
-         InVMInitialContextFactory.reset();
       }
    }
 }

Modified: branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java
===================================================================
--- branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/RMITestServer.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -344,11 +344,6 @@
    {
       server.deployTopic(name, jndiName, clustered);
    }
-   
-   public void deployTopic(String name, String jndiName, boolean clustered, boolean disableRedistribution) throws Exception
-   {
-      server.deployTopic(name, jndiName, clustered, disableRedistribution);
-   }
 
    public void deployTopic(String name,
                            String jndiName,
@@ -369,11 +364,6 @@
    {
       server.deployQueue(name, jndiName, clustered);
    }
-   
-   public void deployQueue(String name, String jndiName, boolean clustered, boolean disableRedistribution) throws Exception
-   {
-      server.deployQueue(name, jndiName, clustered, disableRedistribution);
-   }   
 
    public void deployQueue(String name,
                            String jndiName,
@@ -412,27 +402,22 @@
       server.deployConnectionFactory(objectName, jndiBindings, prefetchSize);
    }
 
-   public void deployConnectionFactory(String objectName, String[] jndiBindings, int prefetchSize, boolean singleton)
-      throws Exception
-   {
-      server.deployConnectionFactory(objectName, jndiBindings, prefetchSize, singleton);
-   }
 
-   public void deployConnectionFactory(String objectName, String[] jndiBindings, boolean strictTck) throws Exception
-   {
-      server.deployConnectionFactory(objectName, jndiBindings, strictTck);
+    public void deployConnectionFactory(String objectName, String[] jndiBindings, boolean strictTck) throws Exception
+    {
+        server.deployConnectionFactory(objectName, jndiBindings, strictTck);
 
-   }
+    }
 
-   public void deployConnectionFactory(String objectName,
-         String[] jndiBindings,
-         int prefetchSize,
-         int defaultTempQueueFullSize,
-         int defaultTempQueuePageSize,
-         int defaultTempQueueDownCacheSize) throws Exception
+    public void deployConnectionFactory(String objectName,
+                                       String[] jndiBindings,
+                                       int prefetchSize,
+                                       int defaultTempQueueFullSize,
+                                       int defaultTempQueuePageSize,
+                                       int defaultTempQueueDownCacheSize) throws Exception
    {
       server.deployConnectionFactory(objectName, jndiBindings, prefetchSize,
-            defaultTempQueueFullSize, defaultTempQueuePageSize, defaultTempQueueDownCacheSize);
+                                     defaultTempQueueFullSize, defaultTempQueuePageSize, defaultTempQueueDownCacheSize);
    }
    
    public void deployConnectionFactory(String objectName,

Modified: branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/Server.java
===================================================================
--- branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/Server.java	2007-11-15 08:40:31 UTC (rev 3331)
+++ branches/Branch_Stable/tests/src/org/jboss/test/messaging/tools/container/Server.java	2007-11-15 09:32:43 UTC (rev 3332)
@@ -173,11 +173,6 @@
     * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
     */
    void deployTopic(String name, String jndiName, boolean clustered) throws Exception;
-   
-   /**
-    * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
-    */
-   void deployTopic(String name, String jndiName, boolean clustered, boolean disableRedistribution) throws Exception;
 
    /**
     * Simulates a topic deployment (copying the topic descriptor in the deploy directory).
@@ -194,15 +189,10 @@
     * Simulates a queue deployment (copying the queue descriptor in the deploy directory).
     */
    void deployQueue(String name, String jndiName, boolean clustered) throws Exception;
-   
+
    /**
     * Simulates a queue deployment (copying the queue descriptor in the deploy directory).
     */
-   void deployQueue(String name, String jndiName, boolean clustered, boolean disableRedistribution) throws Exception;
-   
-   /**
-    * Simulates a queue deployment (copying the queue descriptor in the deploy directory).
-    */
    void deployQueue(String name, String jndiName, int fullSize, int pageSize,
                     int downCacheSize, boolean clustered) throws Exception;
 
@@ -223,12 +213,6 @@
    boolean undeployDestinationProgrammatically(boolean isQueue, String name) throws Exception;
 
    void deployConnectionFactory(String objectName,
-                                String[] jndiBindings, 
-                                int prefetchSize,
-                                boolean singleton
-                                 ) throws Exception;
-   
-   void deployConnectionFactory(String objectName,
                                 String[] jndiBindings,
                                 int prefetchSize,
                                 int defaultTempQueueFullSize,




More information about the jboss-cvs-commits mailing list