activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1325735 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
Date Fri, 13 Apr 2012 12:24:59 GMT
Author: gtully
Date: Fri Apr 13 12:24:58 2012
New Revision: 1325735

URL: http://svn.apache.org/viewvc?rev=1325735&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3630 - NetworkBridgeFilterFactory should be assigned
to Queue not NetworkBridge - thanks. the filter should be evaluated per destination

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=1325735&r1=1325734&r2=1325735&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
Fri Apr 13 12:24:58 2012
@@ -121,7 +121,7 @@ public abstract class DemandForwardingBr
     protected CountDownLatch localStartedLatch = new CountDownLatch(1);
     protected final AtomicBoolean lastConnectSucceeded = new AtomicBoolean(false);
     protected NetworkBridgeConfiguration configuration;
-    protected NetworkBridgeFilterFactory filterFactory;
+    protected final NetworkBridgeFilterFactory defaultFilterFactory = new DefaultNetworkBridgeFilterFactory();
 
     protected final BrokerId remoteBrokerPath[] = new BrokerId[] {null};
     protected Object brokerInfoMutex = new Object();
@@ -1188,18 +1188,14 @@ public abstract class DemandForwardingBr
     }
 
     protected NetworkBridgeFilter createNetworkBridgeFilter(ConsumerInfo info) throws IOException
{
-        if (filterFactory == null)  {
-            if (brokerService != null && brokerService.getDestinationPolicy() !=
null) {
-                PolicyEntry entry = brokerService.getDestinationPolicy().getEntryFor(info.getDestination());
-                if (entry != null) {
-                    filterFactory = entry.getNetworkBridgeFilterFactory();
-                }
-            }
-            if (filterFactory == null) {
-                filterFactory = new DefaultNetworkBridgeFilterFactory();
+        NetworkBridgeFilterFactory filterFactory = defaultFilterFactory;
+        if (brokerService != null && brokerService.getDestinationPolicy() != null)
{
+            PolicyEntry entry = brokerService.getDestinationPolicy().getEntryFor(info.getDestination());
+            if (entry != null && entry.getNetworkBridgeFilterFactory() != null) {
+                filterFactory = entry.getNetworkBridgeFilterFactory();
             }
         }
-         return filterFactory.create(info, getRemoteBrokerPath(), configuration.getNetworkTTL()
);
+        return filterFactory.create(info, getRemoteBrokerPath(), configuration.getNetworkTTL());
     }
 
     protected void serviceLocalBrokerInfo(Command command) throws InterruptedException {



Mime
View raw message