activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r373862 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
Date Tue, 31 Jan 2006 16:31:26 GMT
Author: rajdavies
Date: Tue Jan 31 08:31:21 2006
New Revision: 373862

URL: http://svn.apache.org/viewcvs?rev=373862&view=rev
Log:
Add a check to the iterate() so that on failover - it's not possible
to iterate for ever if the transport has actually been stopped

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java?rev=373862&r1=373861&r2=373862&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
Tue Jan 31 08:31:21 2006
@@ -170,22 +170,21 @@
                     }
                 }
 
-                
-                try {
-                    log.debug("Waiting " + reconnectDelay + " ms before attempting connection.
");
-                    Thread.sleep(reconnectDelay);
+                if(!disposed){
+                    try{
+                        log.debug("Waiting "+reconnectDelay+" ms before attempting connection.
");
+                        Thread.sleep(reconnectDelay);
+                    }catch(InterruptedException e1){
+                        Thread.currentThread().interrupt();
+                    }
+                    if(useExponentialBackOff){
+                        // Exponential increment of reconnect delay.
+                        reconnectDelay*=backOffMultiplier;
+                        if(reconnectDelay>maxReconnectDelay)
+                            reconnectDelay=maxReconnectDelay;
+                    }
                 }
-                catch (InterruptedException e1) {
-                    Thread.currentThread().interrupt();
-                }
-
-                if (useExponentialBackOff) {
-                    // Exponential increment of reconnect delay.
-                    reconnectDelay *= backOffMultiplier;
-                    if (reconnectDelay > maxReconnectDelay)
-                        reconnectDelay = maxReconnectDelay;
-                }
-                return true;
+                return !disposed;
             }
 
         });



Mime
View raw message