Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 5626 invoked from network); 8 Jun 2010 12:58:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Jun 2010 12:58:53 -0000 Received: (qmail 17351 invoked by uid 500); 8 Jun 2010 12:58:53 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 17296 invoked by uid 500); 8 Jun 2010 12:58:53 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 17288 invoked by uid 99); 8 Jun 2010 12:58:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 12:58:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 12:58:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 052C923888EC; Tue, 8 Jun 2010 12:58:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: dejanb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100608125829.052C923888EC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 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 connections = new CopyOnWriteArrayList(); 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();