Skip to content

Commit 8eb52ef

Browse files
jbertramclebertsuconic
authored andcommitted
NO-JIRA remove dead code with invalid JavaDoc
1 parent 003063a commit 8eb52ef

2 files changed

Lines changed: 5 additions & 145 deletions

File tree

artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -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

tests/joram-tests/src/test/java/org/objectweb/jtests/jms/conform/connection/TopicConnectionTest.java

Lines changed: 5 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,14 @@
2525

2626
/**
2727
* Test topic-specific connection features.
28-
*
28+
* <p>
2929
* Test setting of client ID which is relevant only for Durable Subscription
3030
*/
31-
3231
public class TopicConnectionTest extends PubSubTestCase {
3332

3433
/**
35-
* Test that a call to <code>setClientID</code> will throw an
36-
* <code>IllegalStateException</code> if a client ID has already been set
37-
* see JMS javadoc
34+
* Test that a call to {@code setClientID} will throw an {@code IllegalStateException} if a client ID has already
35+
* been set see JMS javadoc
3836
* http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Connection.html#setClientID(java.lang.String)
3937
*/
4038
@Test
@@ -65,8 +63,8 @@ public void testSetClientID_1() {
6563
}
6664

6765
/**
68-
* Test that a call to <code>setClientID</code> can occur only after connection creation
69-
* and before any other action on the connection.
66+
* Test that a call to {@code setClientID} can occur only after connection creation and before any other action on
67+
* the connection.
7068
* <em>This test is relevant only if the ID is set by the JMS client</em>
7169
* see JMS javadoc
7270
* http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Connection.html#setClientID(java.lang.String)
@@ -97,48 +95,4 @@ public void testSetClientID_2() {
9795
Assert.fail("Should raise a javax.jms.IllegalStateException, not a java.lang.IllegalStateException");
9896
}
9997
}
100-
101-
/**
102-
* Test that if another connection with the same clientID is already running when
103-
* <code>setClientID</code> is called, the JMS provider should detect the duplicate
104-
* ID and throw an <code>InvalidClientIDException</code>
105-
* <em>This test is relevant only if the ID is set by the JMS client</em>
106-
* see JMS javadoc
107-
* http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Connection.html#setClientID(java.lang.String)
108-
*
109-
*... This test is not valid... as getClientID is caleld before setClientID
110-
*/
111-
/*public void testSetClientID_3()
112-
{
113-
try
114-
{
115-
// we start from a clean state for the first connection
116-
subscriberConnection.close();
117-
subscriberConnection = null;
118-
119-
subscriberConnection = subscriberTCF.createTopicConnection();
120-
// if the JMS provider has set a client ID, this test is not relevant
121-
if (subscriberConnection.getClientID() != null)
122-
{
123-
return;
124-
}
125-
// the JMS provider has not set a client ID, so we do
126-
subscriberConnection.setClientID("testSetClientID_3");
127-
assertEquals("testSetClientID_3", subscriberConnection.getClientID());
128-
129-
// we create a new connection and try to set the same ID than for subscriberConnection
130-
TopicConnection connection_2 = subscriberTCF.createTopicConnection();
131-
assertTrue(connection_2.getClientID() == null);
132-
connection_2.setClientID("testSetClientID_3");
133-
fail("Should throw a javax.jms.InvalidClientIDException");
134-
}
135-
catch (InvalidClientIDException e)
136-
{
137-
}
138-
catch (JMSException e)
139-
{
140-
fail(e);
141-
}
142-
}*/
143-
14498
}

0 commit comments

Comments
 (0)