activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r426160 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
Date Thu, 27 Jul 2006 17:36:17 GMT
Author: jstrachan
Date: Thu Jul 27 10:36:17 2006
New Revision: 426160

URL: http://svn.apache.org/viewvc?rev=426160&view=rev
Log:
fixed failing MBeanTest due to my bad refactoring :)

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

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java?rev=426160&r1=426159&r2=426160&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
Thu Jul 27 10:36:17 2006
@@ -179,8 +179,29 @@
         broker.removeSubscription(context, info);
     }
     
-    static public ConnectionContext getConnectionContext(Broker broker) {
-        return broker.getAdminConnectionContext();
+    
+    /**
+     * Returns the broker's administration connection context used for configuring the broker
+     * at startup
+     */
+    public static ConnectionContext getConnectionContext(Broker broker) {
+        ConnectionContext adminConnectionContext = broker.getAdminConnectionContext();
+        if (adminConnectionContext == null) {
+            adminConnectionContext = createAdminConnectionContext(broker);
+            broker.setAdminConnectionContext(adminConnectionContext);
+        }
+        return adminConnectionContext;
+    }
+    
+    /**
+     * Factory method to create the new administration connection context object.
+     * Note this method is here rather than inside a default broker implementation to
+     * ensure that the broker reference inside it is the outer most interceptor
+     */
+    protected static ConnectionContext createAdminConnectionContext(Broker broker) {
+        ConnectionContext context = new ConnectionContext();
+        context.setBroker(broker);
+        return context;
     }
 
 }



Mime
View raw message