activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r952642 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/proxy/ProxyConnector.java test/java/org/apache/activemq/proxy/ProxyTestSupport.java
Date Tue, 08 Jun 2010 12:58:28 GMT
Author: dejanb
Date: Tue Jun  8 12:58:28 2010
New Revision: 952642

URL: http://svn.apache.org/viewvc?rev=952642&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQ-2767 - proxyToLocalBroker <proxyConnector>
property

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnector.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/proxy/ProxyTestSupport.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnector.java?rev=952642&r1=952641&r2=952642&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnector.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/proxy/ProxyConnector.java
Tue Jun  8 12:58:28 2010
@@ -45,6 +45,11 @@ public class ProxyConnector implements S
     private URI remote;
     private URI localUri;
     private String name;
+    /**
+     * Should we proxy commands to the local broker using VM transport as well?
+     */
+    private boolean proxyToLocalBroker = true;
+    
     private final CopyOnWriteArrayList<ProxyConnection> connections = new CopyOnWriteArrayList<ProxyConnection>();
 
     public void start() throws Exception {
@@ -131,11 +136,11 @@ public class ProxyConnector implements S
     private Transport createRemoteTransport() throws Exception {
         Transport transport = TransportFactory.compositeConnect(remote);
         CompositeTransport ct = transport.narrow(CompositeTransport.class);
-        if (ct != null && localUri != null) {
+        if (ct != null && localUri != null && proxyToLocalBroker) {
             ct.add(false,new URI[] {localUri});
         }
 
-        // Add a transport filter so that can track the transport life cycle
+        // Add a transport filter so that we can track the transport life cycle
         transport = new TransportFilter(transport) {
             @Override
             public void stop() throws Exception {
@@ -162,4 +167,12 @@ public class ProxyConnector implements S
         this.name = name;
     }
 
+    public boolean isProxyToLocalBroker() {
+        return proxyToLocalBroker;
+    }
+
+    public void setProxyToLocalBroker(boolean proxyToLocalBroker) {
+        this.proxyToLocalBroker = proxyToLocalBroker;
+    }
+
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/proxy/ProxyTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/proxy/ProxyTestSupport.java?rev=952642&r1=952641&r2=952642&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/proxy/ProxyTestSupport.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/proxy/ProxyTestSupport.java
Tue Jun  8 12:58:28 2010
@@ -46,6 +46,7 @@ public class ProxyTestSupport extends Br
         BrokerService service = new BrokerService();
         service.setBrokerName("broker1");
         service.setPersistent(false);
+        service.setUseJmx(false);
 
         connector = service.addConnector(getLocalURI());
         proxyConnector = new ProxyConnector();
@@ -61,6 +62,7 @@ public class ProxyTestSupport extends Br
         BrokerService service = new BrokerService();
         service.setBrokerName("broker2");
         service.setPersistent(false);
+        service.setUseJmx(false);
 
         remoteConnector = service.addConnector(getRemoteURI());
         remoteProxyConnector = new ProxyConnector();



Mime
View raw message