activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1375459 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
Date Tue, 21 Aug 2012 10:26:24 GMT
Author: gtully
Date: Tue Aug 21 10:26:24 2012
New Revision: 1375459

URL: http://svn.apache.org/viewvc?rev=1375459&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3887 - have local dispatch do safe wait till remove
broker setup is complete such that producer is fully created

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

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java?rev=1375459&r1=1375458&r2=1375459&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
Tue Aug 21 10:26:24 2012
@@ -405,7 +405,7 @@ public abstract class DemandForwardingBr
         if (!disposed.get()) {
             try {
                 if (command.isMessageDispatch()) {
-                    waitStarted();
+                    safeWaitUntilStarted();
                     MessageDispatch md = (MessageDispatch) command;
                     serviceRemoteConsumerAdvisory(md.getMessage().getDataStructure());
                     ackAdvisory(md.getMessage());
@@ -686,6 +686,7 @@ public abstract class DemandForwardingBr
         if (!disposed.get()) {
             try {
                 if (command.isMessageDispatch()) {
+                    safeWaitUntilStarted();
                     enqueueCounter.incrementAndGet();
                     final MessageDispatch md = (MessageDispatch) command;
                     final DemandSubscription sub = subscriptionMapByLocalId.get(md.getConsumerId());
@@ -1211,10 +1212,6 @@ public abstract class DemandForwardingBr
         return removeDone;
     }
 
-    protected void waitStarted() throws InterruptedException {
-        startedLatch.await();
-    }
-
     /**
      * Performs a timed wait on the started latch and then checks for disposed before performing
      * another wait each time the the started wait times out.
@@ -1229,11 +1226,6 @@ public abstract class DemandForwardingBr
         }
     }
 
-    protected void clearDownSubscriptions() {
-        subscriptionMapByLocalId.clear();
-        subscriptionMapByRemoteId.clear();
-    }
-
     protected NetworkBridgeFilter createNetworkBridgeFilter(ConsumerInfo info) throws IOException
{
         NetworkBridgeFilterFactory filterFactory = defaultFilterFactory;
         if (brokerService != null && brokerService.getDestinationPolicy() != null)
{
@@ -1252,7 +1244,7 @@ public abstract class DemandForwardingBr
                     if (LOG.isTraceEnabled()) {
                         LOG.trace(configuration.getBrokerName() + " disconnecting local loop
back connection for: " + remoteBrokerName + ", with id:" + remoteBrokerId);
                     }
-                    waitStarted();
+                    safeWaitUntilStarted();
                     ServiceSupport.dispose(this);
                 }
             }



Mime
View raw message