From commits-return-18217-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Mon Feb 20 21:48:23 2012 Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C73749715 for ; Mon, 20 Feb 2012 21:48:23 +0000 (UTC) Received: (qmail 15520 invoked by uid 500); 20 Feb 2012 21:48:23 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 15483 invoked by uid 500); 20 Feb 2012 21:48:23 -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 15476 invoked by uid 99); 20 Feb 2012 21:48:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Feb 2012 21:48:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Mon, 20 Feb 2012 21:48:20 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CE6D72388C54 for ; Mon, 20 Feb 2012 21:47:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1291465 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java Date: Mon, 20 Feb 2012 21:47:59 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120220214759.CE6D72388C54@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Feb 20 21:47:59 2012 New Revision: 1291465 URL: http://svn.apache.org/viewvc?rev=1291465&view=rev Log: fix for: https://issues.apache.org/jira/browse/AMQ-3731 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=1291465&r1=1291464&r2=1291465&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 Mon Feb 20 21:47:59 2012 @@ -16,7 +16,21 @@ */ package org.apache.activemq.network; -import javax.jms.JMSException; +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.security.cert.X509Certificate; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; + +import javax.management.ObjectName; + import org.apache.activemq.Service; import org.apache.activemq.advisory.AdvisorySupport; import org.apache.activemq.broker.BrokerService; @@ -27,35 +41,54 @@ import org.apache.activemq.broker.region import org.apache.activemq.broker.region.RegionBroker; import org.apache.activemq.broker.region.Subscription; import org.apache.activemq.broker.region.policy.PolicyEntry; -import org.apache.activemq.command.*; +import org.apache.activemq.command.ActiveMQDestination; +import org.apache.activemq.command.ActiveMQMessage; +import org.apache.activemq.command.ActiveMQTempDestination; +import org.apache.activemq.command.ActiveMQTopic; +import org.apache.activemq.command.BrokerId; +import org.apache.activemq.command.BrokerInfo; +import org.apache.activemq.command.Command; +import org.apache.activemq.command.ConnectionError; +import org.apache.activemq.command.ConnectionId; +import org.apache.activemq.command.ConnectionInfo; +import org.apache.activemq.command.ConsumerId; +import org.apache.activemq.command.ConsumerInfo; +import org.apache.activemq.command.DataStructure; +import org.apache.activemq.command.DestinationInfo; +import org.apache.activemq.command.ExceptionResponse; +import org.apache.activemq.command.KeepAliveInfo; +import org.apache.activemq.command.Message; +import org.apache.activemq.command.MessageAck; +import org.apache.activemq.command.MessageDispatch; +import org.apache.activemq.command.NetworkBridgeFilter; +import org.apache.activemq.command.ProducerInfo; +import org.apache.activemq.command.RemoveInfo; +import org.apache.activemq.command.Response; +import org.apache.activemq.command.SessionInfo; +import org.apache.activemq.command.ShutdownInfo; +import org.apache.activemq.command.WireFormatInfo; import org.apache.activemq.filter.DestinationFilter; import org.apache.activemq.filter.MessageEvaluationContext; import org.apache.activemq.thread.DefaultThreadPools; import org.apache.activemq.thread.TaskRunnerFactory; -import org.apache.activemq.transport.*; +import org.apache.activemq.transport.DefaultTransportListener; +import org.apache.activemq.transport.FutureResponse; +import org.apache.activemq.transport.ResponseCallback; +import org.apache.activemq.transport.Transport; +import org.apache.activemq.transport.TransportDisposedIOException; +import org.apache.activemq.transport.TransportFilter; import org.apache.activemq.transport.tcp.SslTransport; -import org.apache.activemq.util.*; +import org.apache.activemq.util.IdGenerator; +import org.apache.activemq.util.IntrospectionSupport; +import org.apache.activemq.util.LongSequenceGenerator; +import org.apache.activemq.util.MarshallingSupport; +import org.apache.activemq.util.ServiceStopper; +import org.apache.activemq.util.ServiceSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.management.ObjectName; -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.security.cert.X509Certificate; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Properties; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; - /** * A useful base class for implementing demand forwarding bridges. - * - * */ public abstract class DemandForwardingBridgeSupport implements NetworkBridge, BrokerServiceAware { private static final Logger LOG = LoggerFactory.getLogger(DemandForwardingBridgeSupport.class); @@ -339,9 +372,11 @@ public abstract class DemandForwardingBr ss.throwFirstException(); } } - brokerService.getBroker().removeBroker(null, remoteBrokerInfo); - brokerService.getBroker().networkBridgeStopped(remoteBrokerInfo); - LOG.info(configuration.getBrokerName() + " bridge to " + remoteBrokerName + " stopped"); + if (remoteBrokerInfo != null) { + brokerService.getBroker().removeBroker(null, remoteBrokerInfo); + brokerService.getBroker().networkBridgeStopped(remoteBrokerInfo); + LOG.info(configuration.getBrokerName() + " bridge to " + remoteBrokerName + " stopped"); + } } }