From 500a734d047a3fb6445eff0fbb80c6b23593b21c Mon Sep 17 00:00:00 2001 From: jbertram Date: Wed, 4 May 2016 15:26:59 -0500 Subject: [PATCH] Fix AutoDeleteJmsQueueTest --- .../jms/server/impl/JMSServerManagerImpl.java | 11 +++++++++-- .../activemq/artemis/core/server/ActiveMQServer.java | 7 +++++++ .../artemis/core/server/impl/ActiveMQServerImpl.java | 12 +++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java index 8fe181a767..c9a16179ff 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java @@ -483,7 +483,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback public void runException() throws Exception { checkBindings(bindings); - if (internalCreateQueue(queueName, selectorString, durable)) { + if (internalCreateQueue(queueName, selectorString, durable, autoCreated)) { ActiveMQDestination destination = queues.get(queueName); if (destination == null) { @@ -1047,6 +1047,13 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback private synchronized boolean internalCreateQueue(final String queueName, final String selectorString, final boolean durable) throws Exception { + return internalCreateQueue(queueName, selectorString, durable, false); + } + + private synchronized boolean internalCreateQueue(final String queueName, + final String selectorString, + final boolean durable, + final boolean autoCreated) throws Exception { if (queues.get(queueName) != null) { return false; } @@ -1060,7 +1067,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback coreFilterString = SelectorTranslator.convertToActiveMQFilterString(selectorString); } - Queue queue = server.deployQueue(SimpleString.toSimpleString(activeMQQueue.getAddress()), SimpleString.toSimpleString(activeMQQueue.getAddress()), SimpleString.toSimpleString(coreFilterString), durable, false); + Queue queue = server.deployQueue(SimpleString.toSimpleString(activeMQQueue.getAddress()), SimpleString.toSimpleString(activeMQQueue.getAddress()), SimpleString.toSimpleString(coreFilterString), durable, false, autoCreated); queues.put(queueName, activeMQQueue); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java index 2b0e322564..3719453553 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java @@ -254,6 +254,13 @@ public interface ActiveMQServer extends ActiveMQComponent { boolean durable, boolean temporary) throws Exception; + Queue deployQueue(SimpleString address, + SimpleString queueName, + SimpleString filterString, + boolean durable, + boolean temporary, + boolean autoCreated) throws Exception; + Queue locateQueue(SimpleString queueName); BindingQueryResult bindingQuery(SimpleString address) throws Exception; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java index 29f2e7a4e5..40a7b6c2fb 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java @@ -1406,6 +1406,16 @@ public class ActiveMQServerImpl implements ActiveMQServer { final SimpleString filterString, final boolean durable, final boolean temporary) throws Exception { + return deployQueue(address, resourceName, filterString, durable, temporary, false); + } + + @Override + public Queue deployQueue(final SimpleString address, + final SimpleString resourceName, + final SimpleString filterString, + final boolean durable, + final boolean temporary, + final boolean autoCreated) throws Exception { if (resourceName.toString().toLowerCase().startsWith("jms.topic")) { ActiveMQServerLogger.LOGGER.deployTopic(resourceName); @@ -1414,7 +1424,7 @@ public class ActiveMQServerImpl implements ActiveMQServer { ActiveMQServerLogger.LOGGER.deployQueue(resourceName); } - return createQueue(address, resourceName, filterString, null, durable, temporary, true, false, false); + return createQueue(address, resourceName, filterString, null, durable, temporary, true, false, autoCreated); } @Override