@@ -1522,100 +1522,6 @@ private void correctInvalidNettyConnectorHost(TransportConfiguration transportCo
15221522 }
15231523 }
15241524
1525- /**
1526- * This class is responsible for auto-creating the JMS (and underlying core) resources when a client sends a message
1527- * to a non-existent JMS queue or topic
1528- */
1529- // class JMSDestinationCreator implements QueueCreator {
1530- //
1531- // @Override
1532- // public boolean create(SimpleString address) throws Exception {
1533- // AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString());
1534- // if (address.toString().startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX) && settings.isAutoCreateQueues()) {
1535- // return internalCreateJMSQueue(false, address.toString().substring(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX.length()), null, true, true);
1536- // } else if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoCreateAddresses()) {
1537- // return createTopic(false, address.toString().substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length()), true);
1538- // } else {
1539- // return false;
1540- // }
1541- // }
1542- // }
1543-
1544- // class JMSQueueDeleter implements QueueDeleter {
1545- //
1546- // @Override
1547- // public boolean delete(SimpleString queueName) throws Exception {
1548- // Queue queue = server.locateQueue(queueName);
1549- // SimpleString address = queue.getAddress();
1550- // AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString());
1551- // long consumerCount = queue.getConsumerCount();
1552- // long messageCount = queue.getMessageCount();
1553- //
1554- // if (address.toString().startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX) && settings.isAutoDeleteJmsQueues() && queue.getMessageCount() == 0) {
1555- // if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled()) {
1556- // ActiveMQJMSServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; isAutoDeleteJmsQueues = " + settings.isAutoDeleteJmsQueues());
1557- // }
1558- //
1559- // return destroyQueue(queueName.toString().substring(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX.length()), false);
1560- // } else {
1561- // return false;
1562- // }
1563- // }
1564- // }
1565-
1566- /**
1567- * When a core queue is created with a jms.topic prefix this class will create the associated JMS resources
1568- * retroactively. This would happen if, for example, a client created a subscription a non-existent JMS topic and
1569- * autoCreateJmsTopics = true.
1570- */
1571- // class JMSPostQueueCreationCallback implements PostQueueCreationCallback {
1572- //
1573- // @Override
1574- // public void callback(SimpleString queueName) throws Exception {
1575- // Queue queue = server.locateQueue(queueName);
1576- // String address = queue.getAddress().toString();
1577- //
1578- // AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString());
1579- // /* When a topic is created a dummy subscription is created which never receives any messages; when the queue
1580- // * for that dummy subscription is created we don't want to call createTopic again. Therefore we make sure the
1581- // * queue name doesn't start with the topic prefix.
1582- // */
1583- // if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoCreateAddresses() && !queueName.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX)) {
1584- // createTopic(false, address.toString().substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length()), true);
1585- // }
1586- // }
1587- // }
1588-
1589- /**
1590- * When a core queue representing a JMS topic subscription is deleted this class will check to see if that was the
1591- * last subscription on the topic and if so and autoDeleteJmsTopics = true then it will delete the JMS resources
1592- * for that topic.
1593- */
1594- // class JMSPostQueueDeletionCallback implements PostQueueDeletionCallback {
1595- //
1596- // @Override
1597- // public void callback(SimpleString address, SimpleString queueName) throws Exception {
1598- // Queue queue = server.locateQueue(address);
1599- // Collection<Binding> bindings = server.getPostOffice().getBindingsForAddress(address).getBindings();
1600- //
1601- // AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString());
1602- //
1603- // if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoDeleteJmsTopics() && bindings.size() == 1 && queue != null && queue.isAutoCreated()) {
1604- // try {
1605- // destroyTopic(address.toString().substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length()));
1606- // } catch (IllegalStateException e) {
1607- // /*
1608- // * During shutdown the callback can be invoked after the JMSServerManager is already shut down so we just
1609- // * ignore the exception in that case
1610- // */
1611- // if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled()) {
1612- // ActiveMQJMSServerLogger.LOGGER.debug("Failed to destroy topic", e);
1613- // }
1614- // }
1615- // }
1616- // }
1617- // }
1618-
16191525 private final class JMSReloader implements ReloadCallback {
16201526
16211527 @ Override
0 commit comments