Skip to content

Commit

Permalink
NO-JIRA remove dead code with invalid JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
jbertram committed Feb 20, 2025
1 parent 0a6bf72 commit 1e09236
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 138 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1484,100 +1484,6 @@ private void correctInvalidNettyConnectorHost(TransportConfiguration transportCo
}
}

/**
* This class is responsible for auto-creating the JMS (and underlying core) resources when a client sends a message
* to a non-existent JMS queue or topic
*/
// class JMSDestinationCreator implements QueueCreator {
//
// @Override
// public boolean create(SimpleString address) throws Exception {
// AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString());
// if (address.toString().startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX) && settings.isAutoCreateQueues()) {
// return internalCreateJMSQueue(false, address.toString().substring(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX.length()), null, true, true);
// } else if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoCreateAddresses()) {
// return createTopic(false, address.toString().substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length()), true);
// } else {
// return false;
// }
// }
// }

// class JMSQueueDeleter implements QueueDeleter {
//
// @Override
// public boolean delete(SimpleString queueName) throws Exception {
// Queue queue = server.locateQueue(queueName);
// SimpleString address = queue.getAddress();
// AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString());
// long consumerCount = queue.getConsumerCount();
// long messageCount = queue.getMessageCount();
//
// if (address.toString().startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX) && settings.isAutoDeleteJmsQueues() && queue.getMessageCount() == 0) {
// if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled()) {
// ActiveMQJMSServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; isAutoDeleteJmsQueues = " + settings.isAutoDeleteJmsQueues());
// }
//
// return destroyQueue(queueName.toString().substring(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX.length()), false);
// } else {
// return false;
// }
// }
// }

/**
* When a core queue is created with a jms.topic prefix this class will create the associated JMS resources
* retroactively. This would happen if, for example, a client created a subscription a non-existent JMS topic and
* autoCreateJmsTopics = true.
*/
// class JMSPostQueueCreationCallback implements PostQueueCreationCallback {
//
// @Override
// public void callback(SimpleString queueName) throws Exception {
// Queue queue = server.locateQueue(queueName);
// String address = queue.getAddress().toString();
//
// AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString());
// /* When a topic is created a dummy subscription is created which never receives any messages; when the queue
// * for that dummy subscription is created we don't want to call createTopic again. Therefore we make sure the
// * queue name doesn't start with the topic prefix.
// */
// if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoCreateAddresses() && !queueName.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX)) {
// createTopic(false, address.toString().substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length()), true);
// }
// }
// }

/**
* When a core queue representing a JMS topic subscription is deleted this class will check to see if that was the
* last subscription on the topic and if so and autoDeleteJmsTopics = true then it will delete the JMS resources
* for that topic.
*/
// class JMSPostQueueDeletionCallback implements PostQueueDeletionCallback {
//
// @Override
// public void callback(SimpleString address, SimpleString queueName) throws Exception {
// Queue queue = server.locateQueue(address);
// Collection<Binding> bindings = server.getPostOffice().getBindingsForAddress(address).getBindings();
//
// AddressSettings settings = server.getAddressSettingsRepository().getMatch(address.toString());
//
// if (address.toString().startsWith(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX) && settings.isAutoDeleteJmsTopics() && bindings.size() == 1 && queue != null && queue.isAutoCreated()) {
// try {
// destroyTopic(address.toString().substring(ActiveMQDestination.JMS_TOPIC_ADDRESS_PREFIX.length()));
// } catch (IllegalStateException e) {
// /*
// * During shutdown the callback can be invoked after the JMSServerManager is already shut down so we just
// * ignore the exception in that case
// */
// if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled()) {
// ActiveMQJMSServerLogger.LOGGER.debug("Failed to destroy topic", e);
// }
// }
// }
// }
// }

private final class JMSReloader implements ReloadCallback {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,48 +95,4 @@ public void testSetClientID_2() {
Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException");
}
}

/**
* Test that if another connection with the same clientID is already running when
* Test that a call to {@code setClientID} will throw an
* {@code IllegalStateException} if a client ID has already been set
* <em>This test is relevant only if the ID is set by the JMS client</em>
* see JMS javadoc
* http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Connection.html#setClientID(java.lang.String)
*
*... This test is not valid... as getClientID is caleld before setClientID
*/
/*public void testSetClientID_3()
{
try
{
// we start from a clean state for the first connection
subscriberConnection.close();
subscriberConnection = null;
subscriberConnection = subscriberTCF.createTopicConnection();
// if the JMS provider has set a client ID, this test is not relevant
if (subscriberConnection.getClientID() != null)
{
return;
}
// the JMS provider has not set a client ID, so we do
subscriberConnection.setClientID("testSetClientID_3");
assertEquals("testSetClientID_3", subscriberConnection.getClientID());
// we create a new connection and try to set the same ID than for subscriberConnection
TopicConnection connection_2 = subscriberTCF.createTopicConnection();
assertTrue(connection_2.getClientID() == null);
connection_2.setClientID("testSetClientID_3");
fail("Should throw a javax.jms.InvalidClientIDException");
}
catch (InvalidClientIDException e)
{
}
catch (JMSException e)
{
fail(e);
}
}*/

}

0 comments on commit 1e09236

Please sign in to comment.