activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r375598 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
Date Tue, 07 Feb 2006 13:34:15 GMT
Author: rajdavies
Date: Tue Feb  7 05:34:12 2006
New Revision: 375598

URL: http://svn.apache.org/viewcvs?rev=375598&view=rev
Log:
fix for usecase: ThreeBrokerQueueNetworkUsingTcpTest.java

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java?rev=375598&r1=375597&r2=375598&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridge.java
Tue Feb  7 05:34:12 2006
@@ -80,6 +80,7 @@
     private boolean disposed=false;
     BrokerId localBrokerId;
     BrokerId remoteBrokerId;
+    private Object brokerInfoMutex = new Object();
     private static class DemandSubscription{
         ConsumerInfo remoteInfo;
         ConsumerInfo localInfo;
@@ -235,7 +236,7 @@
                         demandConsumerDispatched=0;
                     }
                 }else if(command.isBrokerInfo()){
-                    synchronized(this){
+                    synchronized(brokerInfoMutex){
                         BrokerInfo remoteBrokerInfo=(BrokerInfo) command;
                         remoteBrokerId=remoteBrokerInfo.getBrokerId();
                         remoteBrokerPath[0]=remoteBrokerId;
@@ -245,10 +246,11 @@
                                 log.info("Disconnecting loop back connection.");
                                 waitStarted();
                                 ServiceSupport.dispose(this);
-                            }else{
-                                triggerLocalStartBridge();
                             }
                         }
+                        if (!disposed){
+                            triggerLocalStartBridge();
+                        }
                     }
                 }else{
                     switch(command.getDataStructureType()){
@@ -381,7 +383,7 @@
                         }
                     }
                 }else if(command.isBrokerInfo()){
-                    synchronized(this){
+                    synchronized(brokerInfoMutex){
                         localBrokerId=((BrokerInfo) command).getBrokerId();
                         localBrokerPath[0]=localBrokerId;
                         if(remoteBrokerId!=null){



Mime
View raw message