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 C8C74797F for ; Sat, 3 Dec 2011 07:15:43 +0000 (UTC) Received: (qmail 40614 invoked by uid 500); 3 Dec 2011 07:15:42 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 40529 invoked by uid 500); 3 Dec 2011 07:15:39 -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 40522 invoked by uid 99); 3 Dec 2011 07:15:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Dec 2011 07:15:36 +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; Sat, 03 Dec 2011 07:15:33 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id ADE5323888FD for ; Sat, 3 Dec 2011 07:15:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1209841 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java Date: Sat, 03 Dec 2011 07:15:12 -0000 To: commits@activemq.apache.org From: rajdavies@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111203071512.ADE5323888FD@eris.apache.org> Author: rajdavies Date: Sat Dec 3 07:15:12 2011 New Revision: 1209841 URL: http://svn.apache.org/viewvc?rev=1209841&view=rev Log: Only stop transport for java.lang.SecurityException - as some tests rely on Connection continung after an exception from the broker Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java?rev=1209841&r1=1209840&r2=1209841&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java Sat Dec 3 07:15:12 2011 @@ -1307,13 +1307,15 @@ public class ActiveMQConnection implemen }catch(Throwable e) { LOG.error("Caught an exception trying to create a JMSException for " +er.getException(),e); } - //dispose of transport - Transport t = this.transport; - if (null != t){ - ServiceSupport.dispose(t); - } - if(jmsEx !=null) { - throw jmsEx; + //dispose of transport for security exceptions + if (er.getException() instanceof SecurityException){ + Transport t = this.transport; + if (null != t){ + ServiceSupport.dispose(t); + } + if(jmsEx !=null) { + throw jmsEx; + } } } } @@ -1521,8 +1523,9 @@ public class ActiveMQConnection implemen } public void finalize() throws Throwable{ - if (scheduler != null){ - scheduler.stop(); + Scheduler s = this.scheduler; + if (s != null){ + s.stop(); } } @@ -2473,5 +2476,4 @@ public class ActiveMQConnection implemen } } } - }