From 0df30712b979e4fd2f413da4f3c3913a9a51956c Mon Sep 17 00:00:00 2001 From: jbertram Date: Tue, 18 Oct 2016 16:03:59 -0500 Subject: [PATCH] ARTEMIS-808 use privileges to stop executor --- .../artemis/jms/client/ActiveMQConnection.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java index f896494443..440b576f3c 100644 --- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java +++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnection.java @@ -33,6 +33,8 @@ import javax.jms.Topic; import javax.jms.TopicConnection; import javax.jms.TopicSession; import java.lang.ref.WeakReference; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.HashSet; import java.util.Set; import java.util.concurrent.ExecutorService; @@ -359,7 +361,13 @@ public class ActiveMQConnection extends ActiveMQConnectionForContextImpl impleme } } - failoverListenerExecutor.shutdown(); + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Object run() { + failoverListenerExecutor.shutdown(); + return null; + } + }); closed = true; } catch (ActiveMQException e) {