activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r1209841 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
Date Sat, 03 Dec 2011 07:15:12 GMT
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
             }
         }
     }
-
 }



Mime
View raw message