Author: jmesnil
Date: 2009-11-06 05:25:52 -0500 (Fri, 06 Nov 2009)
New Revision: 8235
Modified:
trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java
trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java
trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
Log:
unregistered JMS management resources when the JMS server is stopped
Modified: trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java 2009-11-06
10:16:01 UTC (rev 8234)
+++ trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java 2009-11-06
10:25:52 UTC (rev 8235)
@@ -624,7 +624,7 @@
if (!unexpectedResourceNames.isEmpty())
{
log.warn("On ManagementService stop, there are " +
unexpectedResourceNames.size() +
- " unexpected registered MBeans");
+ " unexpected registered MBeans: " +
unexpectedResourceNames);
}
for (ObjectName on : this.registeredNames)
Modified: trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2009-11-06
10:16:01 UTC (rev 8234)
+++ trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2009-11-06
10:25:52 UTC (rev 8235)
@@ -201,6 +201,8 @@
jmsManagementService.unregisterJMSServer();
+ jmsManagementService.stop();
+
server.stop();
started = false;
Modified: trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java 2009-11-06
10:16:01 UTC (rev 8234)
+++ trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java 2009-11-06
10:25:52 UTC (rev 8235)
@@ -45,4 +45,6 @@
void registerConnectionFactory(String name, HornetQConnectionFactory
connectionFactory, List<String> bindings) throws Exception;
void unregisterConnectionFactory(String name) throws Exception;
+
+ void stop() throws Exception;
}
Modified:
trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
===================================================================
---
trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java 2009-11-06
10:16:01 UTC (rev 8234)
+++
trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java 2009-11-06
10:25:52 UTC (rev 8235)
@@ -27,8 +27,11 @@
import org.hornetq.jms.HornetQTopic;
import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.jms.server.JMSServerManager;
+import org.hornetq.jms.server.management.ConnectionFactoryControl;
import org.hornetq.jms.server.management.JMSManagementService;
+import org.hornetq.jms.server.management.JMSQueueControl;
import org.hornetq.jms.server.management.JMSServerControl;
+import org.hornetq.jms.server.management.TopicControl;
/*
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
@@ -127,6 +130,22 @@
managementService.unregisterFromJMX(objectName);
managementService.unregisterFromRegistry(ResourceNames.JMS_CONNECTION_FACTORY +
name);
}
+
+ public void stop() throws Exception
+ {
+ for (Object resource :
managementService.getResources(ConnectionFactoryControl.class))
+ {
+ unregisterConnectionFactory(((ConnectionFactoryControl)resource).getName());
+ }
+ for (Object resource : managementService.getResources(JMSQueueControl.class))
+ {
+ unregisterQueue(((JMSQueueControl)resource).getName());
+ }
+ for (Object resource : managementService.getResources(TopicControl.class))
+ {
+ unregisterTopic(((TopicControl)resource).getName());
+ }
+ }
// Package protected ---------------------------------------------
Show replies by date