activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r451518 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Date Sat, 30 Sep 2006 02:07:00 GMT
Author: jlim
Date: Fri Sep 29 19:06:59 2006
New Revision: 451518

URL: http://svn.apache.org/viewvc?view=rev&rev=451518
Log:
https://issues.apache.org/activemq/browse/AMQ-812 - allow all destinations, including inactive
ones to be shown in jmx 

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?view=diff&rev=451518&r1=451517&r2=451518
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Fri Sep 29 19:06:59 2006
@@ -22,11 +22,7 @@
 import java.io.Serializable;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import javax.management.MBeanServer;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -1200,6 +1196,8 @@
                 mbeanServer.registerMBean(adminView, objectName);
                 registeredMBeanNames.add(objectName);
             }
+            //register all destination in persistence store including inactive destinations
as mbeans 
+            this.startDestinationsInPersistenceStore(broker);
         }
         
 
@@ -1492,8 +1490,29 @@
     }
 
    
-    
+    /**
+     * Starts all destiantions in persistence store. This includes all inactive destinations
+     */
+    protected void startDestinationsInPersistenceStore(Broker broker) throws Exception {
+        Set destinations = destinationFactory.getDestinations();
+        if (destinations != null) {
+            Iterator iter = destinations.iterator();
+
+            ConnectionContext adminConnectionContext = broker.getAdminConnectionContext();
+            if (adminConnectionContext == null) {
+                ConnectionContext context = new ConnectionContext();
+                context.setBroker(broker);
+                adminConnectionContext = context;
+                broker.setAdminConnectionContext(adminConnectionContext);
+            }
+
 
+            while (iter.hasNext()) {
+                ActiveMQDestination destination = (ActiveMQDestination) iter.next();
+                broker.addDestination(adminConnectionContext, destination);
+            }
+        }
+    }
     
 
     



Mime
View raw message