Only stop transport for java.lang.SecurityException - as some tests rely on Connection continung after an exception from the broker

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1209841 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2011-12-03 07:15:12 +00:00
parent 3a71f8e33d
commit da7f9962c6
1 changed files with 12 additions and 10 deletions

View File

@ -1307,13 +1307,15 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
}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 implements Connection, TopicConnection, QueueCon
}
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 implements Connection, TopicConnection, QueueCon
}
}
}
}