Author: clebert.suconic(a)jboss.com
Date: 2011-06-06 22:41:29 -0400 (Mon, 06 Jun 2011)
New Revision: 10781
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/management/JMSManagementService.java
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
Log:
avoiding NPE
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2011-06-07
02:24:54 UTC (rev 10780)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2011-06-07
02:41:29 UTC (rev 10781)
@@ -1042,9 +1042,10 @@
SimpleString.toSimpleString(coreFilterString),
durable,
false);
+
queues.put(queueName, hqQueue);
- jmsManagementService.registerQueue(hqQueue);
+ jmsManagementService.registerQueue(hqQueue, queue);
return true;
}
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/management/JMSManagementService.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/management/JMSManagementService.java 2011-06-07
02:24:54 UTC (rev 10780)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/management/JMSManagementService.java 2011-06-07
02:41:29 UTC (rev 10781)
@@ -14,6 +14,7 @@
package org.hornetq.jms.server.management;
import org.hornetq.api.jms.management.JMSServerControl;
+import org.hornetq.core.server.Queue;
import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.jms.client.HornetQQueue;
import org.hornetq.jms.client.HornetQTopic;
@@ -32,7 +33,7 @@
void unregisterJMSServer() throws Exception;
- void registerQueue(HornetQQueue queue) throws Exception;
+ void registerQueue(HornetQQueue queue, Queue serverQueue) throws Exception;
void unregisterQueue(String name) throws Exception;
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java 2011-06-07
02:24:54 UTC (rev 10780)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java 2011-06-07
02:41:29 UTC (rev 10781)
@@ -87,9 +87,8 @@
managementService.unregisterFromRegistry(ResourceNames.JMS_SERVER);
}
- public synchronized void registerQueue(final HornetQQueue queue) throws Exception
+ public synchronized void registerQueue(final HornetQQueue queue, final Queue
serverQueue) throws Exception
{
- Queue serverQueue = server.locateQueue(new SimpleString(queue.getName()));
QueueControl coreQueueControl =
(QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE +
queue.getAddress());
MessageCounterManager messageCounterManager =
managementService.getMessageCounterManager();
MessageCounter counter = new MessageCounter(queue.getName(),