qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1332242 - in /qpid/branches/java-config-and-management/qpid/java: broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/ broker-plugins/management/src/main/java/resources/ broker-plugins/management/src/main/java/...
Date Mon, 30 Apr 2012 15:23:34 GMT
Author: rgodfrey
Date: Mon Apr 30 15:23:33 2012
New Revision: 1332242

URL: http://svn.apache.org/viewvc?rev=1332242&view=rev
Log:
NO-JIRA : [Java Config] Updates to make IE happier, make port configurable

Added:
    qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/HTTPPortAdapter.java
      - copied, changed from r1332173, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
Modified:
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/Management.java
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/connection.html
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/exchange.html
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/common.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/connection.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/exchange.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/queue.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/structure.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/vhost.js
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/queue.html
    qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/vhost.html
    qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
    qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
    qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
    qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/Management.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/Management.java?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/Management.java
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/org/apache/qpid/server/management/plugin/Management.java
Mon Apr 30 15:23:33 2012
@@ -20,6 +20,8 @@
  */
 package org.apache.qpid.server.management.plugin;
 
+import java.util.ArrayList;
+import java.util.Collection;
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.management.plugin.servlet.DefinedFileServlet;
 import org.apache.qpid.server.management.plugin.servlet.FileServlet;
@@ -34,8 +36,10 @@ import org.apache.qpid.server.model.Conf
 import org.apache.qpid.server.model.Connection;
 import org.apache.qpid.server.model.Exchange;
 import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.model.Session;
+import org.apache.qpid.server.model.Transport;
 import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.mortbay.jetty.Server;
@@ -50,8 +54,8 @@ public class Management
 
     private Broker _broker;
 
-    private Server _server;
-    private Context _root;
+    private Collection<Server> _servers = new ArrayList<Server>();
+    
 
     public Management()
     {
@@ -59,59 +63,87 @@ public class Management
 
         _broker = ApplicationRegistry.getInstance().getBroker();
 
-        _server = new Server(8080);
+        Collection<Port> ports = _broker.getPorts();
+        for(Port port : ports)
+        {
+            // TODO - cover cases where more than just HTTP supported, and SSL as a transport
+            if(port.getProtocols().contains(Protocol.HTTP))
+            {
+                if(port.getTransports().contains(Transport.TCP))
+                {
+                    _servers.add(createServer(port.getPort()));
+                }
+            }
+        }
 
-        _root = new Context(_server,"/", Context.SESSIONS);
-        _root.addServlet(new ServletHolder(new VhostsServlet(_broker)), "/api/vhosts/*");
-        _root.addServlet(new ServletHolder(new ExchangesServlet(_broker)), "/api/exchanges/*");
-
-        addRestServlet("virtualhost", VirtualHost.class);
-        addRestServlet("exchange", VirtualHost.class, Exchange.class);
-        addRestServlet("queue", VirtualHost.class, Queue.class);
-        addRestServlet("connection", VirtualHost.class, Connection.class);
-        addRestServlet("binding", VirtualHost.class, Exchange.class, Queue.class, Binding.class);
-        addRestServlet("port", Port.class);
-        addRestServlet("session", VirtualHost.class, Connection.class, Session.class);
-
-        _root.addServlet(new ServletHolder(new StructureServlet(_broker)), "/rest/structure");
-
-        _root.addServlet(new ServletHolder(new SaslServlet(_broker)), "/rest/sasl");
-
-        _root.addServlet(new ServletHolder(new DefinedFileServlet("queue.html")),"/queue");
-        _root.addServlet(new ServletHolder(new DefinedFileServlet("exchange.html")),"/exchange");
-        _root.addServlet(new ServletHolder(new DefinedFileServlet("vhost.html")),"/vhost");
-        _root.addServlet(new ServletHolder(new DefinedFileServlet("broker.html")),"/broker");
-        _root.addServlet(new ServletHolder(new DefinedFileServlet("connection.html")),"/connection");
-
-
-        _root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.js");
-        _root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.css");
-        _root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.html");
-        _root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.png");
-        _root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.gif");
-        _root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.jpg");
-        _root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.jpeg");
-        _root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.json");
+        
+    }
+
+    private Server createServer(int port)
+    {
+        Server server = new Server(port);
+        Context root;
+        root = new Context(server,"/", Context.SESSIONS);
+        root.addServlet(new ServletHolder(new VhostsServlet(_broker)), "/api/vhosts/*");
+        root.addServlet(new ServletHolder(new ExchangesServlet(_broker)), "/api/exchanges/*");
+
+        addRestServlet(root, "virtualhost", VirtualHost.class);
+        addRestServlet(root, "exchange", VirtualHost.class, Exchange.class);
+        addRestServlet(root, "queue", VirtualHost.class, Queue.class);
+        addRestServlet(root, "connection", VirtualHost.class, Connection.class);
+        addRestServlet(root, "binding", VirtualHost.class, Exchange.class, Queue.class, Binding.class);
+        addRestServlet(root, "port", Port.class);
+        addRestServlet(root, "session", VirtualHost.class, Connection.class, Session.class);
+
+        root.addServlet(new ServletHolder(new StructureServlet(_broker)), "/rest/structure");
+
+        root.addServlet(new ServletHolder(new SaslServlet(_broker)), "/rest/sasl");
+
+        root.addServlet(new ServletHolder(new DefinedFileServlet("queue.html")),"/queue");
+        root.addServlet(new ServletHolder(new DefinedFileServlet("exchange.html")),"/exchange");
+        root.addServlet(new ServletHolder(new DefinedFileServlet("vhost.html")),"/vhost");
+        root.addServlet(new ServletHolder(new DefinedFileServlet("broker.html")),"/broker");
+        root.addServlet(new ServletHolder(new DefinedFileServlet("connection.html")),"/connection");
+
+
+        root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.js");
+        root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.css");
+        root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.html");
+        root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.png");
+        root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.gif");
+        root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.jpg");
+        root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.jpeg");
+        root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.json");
+        root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.txt");
+        root.addServlet(new ServletHolder(FileServlet.INSTANCE), "*.xsl");
 
-        final SessionManager sessionManager = _root.getSessionHandler().getSessionManager();
+        final SessionManager sessionManager = root.getSessionHandler().getSessionManager();
 
         sessionManager.setMaxCookieAge(60 * 30);
         sessionManager.setMaxInactiveInterval(60 * 15);
+        
+        return server;
     }
 
-    private void addRestServlet(String name, Class<? extends ConfiguredObject>... hierarchy)
+    private void addRestServlet(Context root, String name, Class<? extends ConfiguredObject>...
hierarchy)
     {
-        _root.addServlet(new ServletHolder(new RestServlet(_broker, hierarchy)), "/rest/"+name+"/*");
+        root.addServlet(new ServletHolder(new RestServlet(_broker, hierarchy)), "/rest/"+name+"/*");
     }
 
     public void start() throws Exception
     {
-        _server.start();
+        for(Server server : _servers)
+        {
+            server.start();
+        }
     }
 
     public void stop() throws Exception
     {
-        _server.stop();
+        for(Server server : _servers)
+        {
+            server.stop();
+        }
     }
 
 }

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/broker.html
Mon Apr 30 15:23:33 2012
@@ -37,11 +37,11 @@
 		<link rel="stylesheet" href="../css/common.css" media="screen">
 
         <!-- load dojo and provide config via data attribute -->
-		<!--<script src="/dojo/1.7.2/dojo/dojo.js.uncompressed.js" data-dojo-config="async:
true">
+		<!--<script src="/dojo/1.7.2/dojo/dojo.js.uncompressed.js" data-dojo-config="async:
true, parseOnLoad: true">
         </script>                                                                 
               -->
 
         <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js"
-                data-dojo-config="async: true">
+                data-dojo-config="async: true, parseOnLoad: true">
         </script>
 
         <script src="/js/broker.js">

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/connection.html
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/connection.html?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/connection.html
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/connection.html
Mon Apr 30 15:23:33 2012
@@ -36,7 +36,7 @@
 
         <!-- load dojo and provide config via data attribute
          style="height: 800px"-->
-		<!--<script src="/dojo/1.7.2/dojo/dojo.js.uncompressed.js" data-dojo-config="async:
true">
+		<!--<script src="/dojo/1.7.2/dojo/dojo.js.uncompressed.js" data-dojo-config="async:
true, parseOnLoad: true">
         </script>                                                                 
               -->
 
         <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js"

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/exchange.html
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/exchange.html?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/exchange.html
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/exchange.html
Mon Apr 30 15:23:33 2012
@@ -36,7 +36,7 @@
 
         <!-- load dojo and provide config via data attribute
          style="height: 800px"-->
-		<!--<script src="/dojo/1.7.2/dojo/dojo.js.uncompressed.js" data-dojo-config="async:
true">
+		<!--<script src="/dojo/1.7.2/dojo/dojo.js.uncompressed.js" data-dojo-config="async:
true, parseOnLoad: true">
         </script>                                                                 
               -->
 
         <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js"

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/common.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/common.js?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/common.js
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/common.js
Mon Apr 30 15:23:33 2012
@@ -20,12 +20,27 @@
  */
 var updateList = new Array();
 
-setInterval(function(){
-      for(var i = 0; i < updateList.length; i++)
-      {
-          var obj = updateList[i];
-          obj.update();
-      }}, 5000);
+var useSyncGet = false;
+
+require(["dojo/has", "dojo/_base/sniff"], function(has)
+{
+  if(has("ie") <= 8)
+  {
+    useSyncGet = true;
+  }
+});
+
+setInterval(function()
+{
+  for(var i = 0; i < updateList.length; i++)
+  {
+      var obj = updateList[i];
+      obj.update();
+
+
+  }
+}, 5000);
+
 
 
 function formatBytes(amount)
@@ -184,21 +199,21 @@ UpdatableStore.prototype.update = functi
     {
         for(var i=0; i < data.length; i++)
         {
-            if(item = store.get(data[i].id))
+            if(theItem = store.get(data[i].id))
             {
                 var modified;
                 for(var propName in data[i])
                 {
-                    if(item[ propName ] != data[i][ propName ])
+                    if(theItem[ propName ] != data[i][ propName ])
                     {
-                        item[ propName ] = data[i][ propName ];
+                        theItem[ propName ] = data[i][ propName ];
                         modified = true;
                     }
                 }
                 if(modified)
                 {
                     // ... check attributes for updates
-                    store.notify(item, data[i].id);
+                    store.notify(theItem, data[i].id);
                 }
             }
             else

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/connection.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/connection.js?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/connection.js
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/connection.js
Mon Apr 30 15:23:33 2012
@@ -55,7 +55,7 @@ require(["dojo/store/JsonRest",
 
             var thisObj = this;
 
-            xhr.get({url: this.query, handleAs: "json"}).then(function(data)
+            xhr.get({url: this.query, sync: useSyncGet, handleAs: "json"}).then(function(data)
                              {
                                 thisObj.connectionData = data[0];
 
@@ -94,7 +94,7 @@ require(["dojo/store/JsonRest",
 
             var thisObj = this;
 
-            xhr.get({url: this.query, handleAs: "json"}).then(function(data)
+            xhr.get({url: this.query, sync: useSyncGet, handleAs: "json"}).then(function(data)
                  {
                     thisObj.connectionData = data[0];
 

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/exchange.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/exchange.js?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/exchange.js
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/exchange.js
Mon Apr 30 15:23:33 2012
@@ -50,7 +50,7 @@ require(["dojo/store/JsonRest",
 
             var thisObj = this;
 
-            xhr.get({url: this.query, handleAs: "json"}).then(function(data)
+            xhr.get({url: this.query, sync: useSyncGet, handleAs: "json"}).then(function(data)
                              {
                                 thisObj.exchangeData = data[0];
                                 flattenStatistics( thisObj.exchangeData );
@@ -81,7 +81,7 @@ require(["dojo/store/JsonRest",
 
             var thisObj = this;
 
-            xhr.get({url: this.query, handleAs: "json"}).then(function(data)
+            xhr.get({url: this.query, sync: useSyncGet, handleAs: "json"}).then(function(data)
                  {
                     thisObj.exchangeData = data[0];
 

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/queue.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/queue.js?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/queue.js
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/queue.js
Mon Apr 30 15:23:33 2012
@@ -54,7 +54,7 @@ require(["dojo/store/JsonRest",
 
             var thisObj = this;
 
-            xhr.get({url: this.query, handleAs: "json"}).then(function(data)
+            xhr.get({url: this.query, sync: useSyncGet, handleAs: "json"}).then(function(data)
                              {
                                 thisObj.queueData = data[0];
 
@@ -108,7 +108,7 @@ require(["dojo/store/JsonRest",
 
             var thisObj = this;
 
-            xhr.get({url: this.query, handleAs: "json"}).then(function(data)
+            xhr.get({url: this.query, sync: useSyncGet, handleAs: "json"}).then(function(data)
                  {
                     thisObj.queueData = data[0];
                     flattenStatistics( thisObj.queueData )

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/structure.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/structure.js?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/structure.js
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/structure.js
Mon Apr 30 15:23:33 2012
@@ -161,10 +161,10 @@ BrokerTreeModel.prototype.fetchItemByIde
                 {
                     for(var i = 0 ; i < prop.length; i++)
                     {
-                        var item = fetchItem(id, prop[i]);
-                        if( item )
+                        var theItem = fetchItem(id, prop[i]);
+                        if( theItem )
                         {
-                            return item;
+                            return theItem;
                         }
                     }
                 }
@@ -178,44 +178,59 @@ BrokerTreeModel.prototype.fetchItemByIde
 
 BrokerTreeModel.prototype.getChildren = function(parentItem, onComplete)
 {
-    if(parentItem._dummyChild)
+    if(parentItem)
     {
-        onComplete(parentItem.data[ parentItem._dummyChild ]);
-    }
-    else
-    {
-        var children = [];
-        for(var propName in parentItem)
+        if(parentItem._dummyChild)
         {
-            var prop = parentItem[ propName ];
-
-            if(isArray(prop))
+            onComplete(parentItem.data[ parentItem._dummyChild ]);
+        }
+        else
+        {
+            var children = [];
+            for(var propName in parentItem)
             {
-                children.push({ id: parentItem.id+propName, _dummyChild: propName, data:
parentItem });
+                var prop = parentItem[ propName ];
+
+                if(isArray(prop))
+                {
+                    children.push({ id: parentItem.id+propName, _dummyChild: propName, data:
parentItem });
+                }
             }
+            onComplete( children );
         }
-        onComplete( children );
+    }
+    else
+    {
+        onComplete([]);
     }
 };
 
-BrokerTreeModel.prototype.getIdentity = function (item)
+BrokerTreeModel.prototype.getIdentity = function (theItem)
 {
-    return item.id;
+    if(theItem)
+    {
+        return theItem.id;
+    }
+
 };
 
-BrokerTreeModel.prototype.getLabel = function (item)
+BrokerTreeModel.prototype.getLabel = function (theItem)
 {
-    if(item)
+    if(theItem)
     {
-        if(item._dummyChild)
+        if(theItem._dummyChild)
         {
-            return item._dummyChild;
+            return theItem._dummyChild;
         }
         else
         {
-            return item.name;
+            return theItem.name;
         }
     }
+    else
+    {
+        return "";
+    }
 };
 
 BrokerTreeModel.prototype.getRoot = function (onItem)
@@ -223,22 +238,29 @@ BrokerTreeModel.prototype.getRoot = func
     onItem( this.model );
 };
 
-BrokerTreeModel.prototype.mayHaveChildren = function (item)
+BrokerTreeModel.prototype.mayHaveChildren = function (theItem)
 {
-    if(item._dummyChild)
+    if(theItem)
     {
-        return true;
-    }
-    else
-    {
-        for(var propName in item)
+        if(theItem._dummyChild)
         {
-            var prop = item[ propName ];
-            if(isArray(prop))
+            return true;
+        }
+        else
+        {
+            for(var propName in theItem)
             {
-                return true;
+                var prop = theItem[ propName ];
+                if(isArray(prop))
+                {
+                    return true;
+                }
             }
+            return false;
         }
+    }
+    else
+    {
         return false;
     }
 };
@@ -247,12 +269,12 @@ require(["dojo/io-query", "dojo/domReady
     function(ioQuery)
     {
 
-        BrokerTreeModel.prototype.relocate = function (item)
+        BrokerTreeModel.prototype.relocate = function (theItem)
         {
 
-            function findItemDetails(item, details, type, object)
+            function findItemDetails(theItem, details, type, object)
             {
-                if(item.id == object.id)
+                if(theItem.id == object.id)
                 {
                     details.type = type;
                     details[ type ] = object.name;
@@ -269,7 +291,7 @@ require(["dojo/io-query", "dojo/domReady
                         {
                             for(var i = 0 ; i < prop.length; i++)
                             {
-                                findItemDetails(item, details, propName.substring(0, propName.length-1),prop[i])
+                                findItemDetails(theItem, details, propName.substring(0, propName.length-1),prop[i])
 
                                 if(details.type)
                                 {
@@ -294,7 +316,7 @@ require(["dojo/io-query", "dojo/domReady
 
             var details = new Object();
 
-            findItemDetails(item, details, "broker", this.model);
+            findItemDetails(theItem, details, "broker", this.model);
 
             var uri;
 
@@ -338,7 +360,7 @@ require(["dojo/_base/xhr", "dojo/domRead
              {
                  var thisObj = this;
 
-                 xhr.get({url: this.query, handleAs: "json"})
+                 xhr.get({url: this.query, sync: useSyncGet, handleAs: "json"})
                      .then(function(data)
                            {
                                if(thisObj.model)
@@ -361,7 +383,7 @@ require(["dojo/_base/xhr", "dojo/domRead
                  tree.on("dblclick",
                          function(object)
                          {
-                             if(!object._dummyChild)
+                             if(object && !object._dummyChild)
                              {
                                 structure.relocate(object);
                              }

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/vhost.js
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/vhost.js?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/vhost.js
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/js/vhost.js
Mon Apr 30 15:23:33 2012
@@ -47,7 +47,7 @@ require(["dojo/store/JsonRest",
 
             var thisObj = this;
 
-            xhr.get({url: this.query, handleAs: "json"}).then(function(data)
+            xhr.get({url: this.query, sync: useSyncGet, handleAs: "json"}).then(function(data)
                              {
                                 thisObj.vhostData = data[0];
 
@@ -66,11 +66,11 @@ require(["dojo/store/JsonRest",
                                                              dojo.connect(obj.grid, "onRowDblClick",
obj.grid,
                                                              function(evt){
                                                                     var idx = evt.rowIndex,
-                                                                    item = this.getItem(idx);
+                                                                    theItem = this.getItem(idx);
 
                                                                     url = "/queue?vhost="
                                                                      + thisObj.vhostData.name
+ "&queue=" +
-                                                                    obj.dataStore.getValue(item,"name");
+                                                                    obj.dataStore.getValue(theItem,"name");
 
                                                                     window.location = url;
 
@@ -89,11 +89,11 @@ require(["dojo/store/JsonRest",
                                                                dojo.connect(obj.grid, "onRowDblClick",
obj.grid,
                                                                function(evt){
                                                                       var idx = evt.rowIndex,
-                                                                      item = this.getItem(idx);
+                                                                      theItem = this.getItem(idx);
 
                                                                       url = "/exchange?vhost="
                                                                        + encodeURIComponent(thisObj.vhostData.name)
+ "&exchange=" +
-                                                                      encodeURIComponent(obj.dataStore.getValue(item,"name"));
+                                                                      encodeURIComponent(obj.dataStore.getValue(theItem,"name"));
 
                                                                       window.location = url;
 
@@ -120,11 +120,11 @@ require(["dojo/store/JsonRest",
                                                              dojo.connect(obj.grid, "onRowDblClick",
obj.grid,
                                                              function(evt){
                                                                     var idx = evt.rowIndex,
-                                                                    item = this.getItem(idx);
+                                                                    theItem = this.getItem(idx);
 
                                                                     url = "/connection?vhost="
                                                                      + encodeURIComponent(thisObj.vhostData.name)
+ "&connection=" +
-                                                                    encodeURIComponent(obj.dataStore.getValue(item,"name"));
+                                                                    encodeURIComponent(obj.dataStore.getValue(theItem,"name"));
 
                                                                     window.location = url;
 
@@ -152,7 +152,7 @@ require(["dojo/store/JsonRest",
 
             var thisObj = this;
 
-            xhr.get({url: this.query, handleAs: "json"}).then(function(data)
+            xhr.get({url: this.query, sync: useSyncGet, handleAs: "json"}).then(function(data)
                  {
                     thisObj.vhostData = data[0];
                     flattenStatistics( thisObj.vhostData );

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/queue.html
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/queue.html?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/queue.html
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/queue.html
Mon Apr 30 15:23:33 2012
@@ -36,7 +36,7 @@
 
         <!-- load dojo and provide config via data attribute
          style="height: 800px"-->
-		<!--<script src="/dojo/1.7.2/dojo/dojo.js.uncompressed.js" data-dojo-config="async:
true">
+		<!--<script src="/dojo/1.7.2/dojo/dojo.js.uncompressed.js" data-dojo-config="async:
true, parseOnLoad: true">
         </script>                                                                 
               -->
 
         <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js"

Modified: qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/vhost.html
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/vhost.html?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/vhost.html
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker-plugins/management/src/main/java/resources/vhost.html
Mon Apr 30 15:23:33 2012
@@ -36,13 +36,14 @@
 
         <!-- load dojo and provide config via data attribute
          style="height: 800px"-->
-		<!--<script src="/dojo/1.7.2/dojo/dojo.js.uncompressed.js" data-dojo-config="async:
true">
+		<!--<script src="/dojo/1.7.2/dojo/dojo.js.uncompressed.js" data-dojo-config="async:
true, parseOnLoad: true">
         </script>                                                                 
               -->
 
         <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js"
                 data-dojo-config="async: true, parseOnLoad: true">
         </script>
 
+
             <script>
                 require(["dijit/layout/BorderContainer", "dijit/layout/TabContainer", "dijit/layout/ContentPane",
                 "dijit/TitlePane", "dojo/parser"]);

Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/ServerConfiguration.java
Mon Apr 30 15:23:33 2012
@@ -66,6 +66,7 @@ public class ServerConfiguration extends
     public static final long DEFAULT_HOUSEKEEPING_PERIOD = 30000L;
     public static final int DEFAULT_JMXPORT_REGISTRYSERVER = 8999;
     public static final int JMXPORT_CONNECTORSERVER_OFFSET = 100;
+    public static final int DEFAULT_HTTP_MANAGEMENT_PORT = 8080;
 
     public static final String QPID_HOME = "QPID_HOME";
     public static final String QPID_WORK = "QPID_WORK";
@@ -104,6 +105,8 @@ public class ServerConfiguration extends
         envVarMap.put("QPID_MSGAUTH", "security.msg-auth");
         envVarMap.put("QPID_AUTOREGISTER", "auto_register");
         envVarMap.put("QPID_MANAGEMENTENABLED", "management.enabled");
+        envVarMap.put("QPID_HTTPMANAGEMENTENABLED", "management.http.enabled");
+        envVarMap.put("QPID_HTTPMANAGEMENTPORT", "management.http.port");
         envVarMap.put("QPID_HEARTBEATDELAY", "heartbeat.delay");
         envVarMap.put("QPID_HEARTBEATTIMEOUTFACTOR", "heartbeat.timeoutFactor");
         envVarMap.put("QPID_MAXIMUMMESSAGEAGE", "maximumMessageAge");
@@ -541,6 +544,16 @@ public class ServerConfiguration extends
         return getBooleanValue("management.platform-mbeanserver", true);
     }
 
+    public boolean getHTTPManagementEnabled()
+    {
+        return getBooleanValue("management.http.enabled", true);
+    }
+
+    public int getHTTPManagementPort()
+    {
+        return getIntValue("management.http.port", 8080);
+    }
+
     public String[] getVirtualHosts()
     {
         return _virtualHosts.keySet().toArray(new String[_virtualHosts.size()]);

Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
Mon Apr 30 15:23:33 2012
@@ -50,6 +50,7 @@ public class BrokerAdapter extends Abstr
             new HashMap<org.apache.qpid.server.virtualhost.VirtualHost, VirtualHostAdapter>();
     private final StatisticsAdapter _statistics;
     private final Map<QpidAcceptor, PortAdapter> _portAdapters = new HashMap<QpidAcceptor,
PortAdapter>();
+    private HTTPPortAdapter _httpManagementPort;
 
 
     public BrokerAdapter(final IApplicationRegistry instance)
@@ -103,6 +104,11 @@ public class BrokerAdapter extends Abstr
                     _portAdapters.put(entry.getValue(), new PortAdapter(this, entry.getValue(),
entry.getKey()));
                 }
             }
+            if(_applicationRegistry.useHTTPManagement())
+            {
+                _httpManagementPort = new HTTPPortAdapter(this, _applicationRegistry.getHTTPManagementPort());
+            }
+
         }
     }
 
@@ -110,7 +116,12 @@ public class BrokerAdapter extends Abstr
     {
         synchronized (_portAdapters)
         {
-            return new ArrayList<Port>(_portAdapters.values());
+            final ArrayList<Port> ports = new ArrayList<Port>(_portAdapters.values());
+            if(_httpManagementPort != null)
+            {
+                ports.add(_httpManagementPort);
+            }
+            return ports;
         }
     }
 

Copied: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/HTTPPortAdapter.java
(from r1332173, qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java)
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/HTTPPortAdapter.java?p2=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/HTTPPortAdapter.java&p1=qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java&r1=1332173&r2=1332242&rev=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/PortAdapter.java
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/HTTPPortAdapter.java
Mon Apr 30 15:23:33 2012
@@ -21,6 +21,9 @@
 
 package org.apache.qpid.server.model.adapter;
 
+import java.security.AccessControlException;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.Connection;
@@ -30,83 +33,35 @@ import org.apache.qpid.server.model.Prot
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.Statistics;
 import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.model.VirtualHostAlias;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
-import org.apache.qpid.server.transport.QpidAcceptor;
 
-import java.net.InetSocketAddress;
-import java.security.AccessControlException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-public class PortAdapter extends AbstractAdapter implements Port
+public class HTTPPortAdapter extends AbstractAdapter implements Port
 {
     private final BrokerAdapter _broker;
-    private final QpidAcceptor _acceptor;
-    private final InetSocketAddress _address;
-    private final Collection<Protocol> _protocols;
-
-    public PortAdapter(BrokerAdapter brokerAdapter, QpidAcceptor acceptor, InetSocketAddress
address)
+    private int _port;
+    public HTTPPortAdapter(BrokerAdapter brokerAdapter, int port)
     {
         _broker = brokerAdapter;
-        _acceptor = acceptor;
-        _address = address;
-
-        List<Protocol> protocols = new ArrayList<Protocol>();
-
-        for(AmqpProtocolVersion pv : _acceptor.getSupported())
-        {
-             switch(pv)
-             {
-                 case v0_8:
-                     protocols.add(Protocol.AMQP_0_8);
-                     break;
-                 case v0_9:
-                     protocols.add(Protocol.AMQP_0_9);
-                     break;
-                 case v0_9_1:
-                     protocols.add(Protocol.AMQP_0_9_1);
-                     break;
-                 case v0_10:
-                     protocols.add(Protocol.AMQP_0_10);
-                     break;
-                 case v1_0_0:
-                     protocols.add(Protocol.AMQP_1_0);
-                     break;
-             }
-        }
-
-        _protocols = Collections.unmodifiableCollection(protocols);
+        _port = port;
 
     }
 
     @Override
     public String getBindingAddress()
     {
-        return _address.getHostName();
+        return "0.0.0.0";
     }
 
     @Override
     public int getPort()
     {
-        return _address.getPort();
+        return _port;
     }
 
     @Override
     public Collection<Transport> getTransports()
     {
-        switch (_acceptor.getTransport())
-        {
-            case TCP:
-                return Collections.singleton(Transport.TCP);
-            case SSL:
-                return Collections.singleton(Transport.SSL);
-        }
-
-        return null;  // TODO - Implement
+        return Collections.singleton(Transport.TCP);        
     }
 
     @Override
@@ -126,7 +81,7 @@ public class PortAdapter extends Abstrac
     @Override
     public Collection<Protocol> getProtocols()
     {
-        return _protocols;
+        return Collections.singleton(Protocol.HTTP);
     }
 
     @Override
@@ -146,24 +101,13 @@ public class PortAdapter extends Abstrac
     @Override
     public Collection<VirtualHostAlias> getVirtualHostBindings()
     {
-        List<VirtualHostAlias> aliases = new ArrayList<VirtualHostAlias>();
-        for(VirtualHost vh : _broker.getVirtualHosts())
-        {
-            for(VirtualHostAlias alias : vh.getAliases())
-            {
-                if(alias.getPort().equals(this))
-                {
-                    aliases.add(alias);
-                }
-            }
-        }
-        return Collections.unmodifiableCollection(aliases);
+        return Collections.emptySet();
     }
 
     @Override
     public Collection<Connection> getConnections()
     {
-        return null;  // TODO - Implement
+        return Collections.emptySet();  // TODO - Implement
     }
 
     @Override

Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
Mon Apr 30 15:23:33 2012
@@ -82,6 +82,7 @@ import java.util.concurrent.atomic.Atomi
  */
 public abstract class ApplicationRegistry implements IApplicationRegistry
 {
+
     private static final Logger _logger = Logger.getLogger(ApplicationRegistry.class);
 
     private static AtomicReference<IApplicationRegistry> _instance = new AtomicReference<IApplicationRegistry>(null);
@@ -122,6 +123,8 @@ public abstract class ApplicationRegistr
     private BundleContext _bundleContext;
 
     private final List<PortBindingListener> _portBindingListeners = new ArrayList<PortBindingListener>();
+    
+    private int _httpManagementPort = -1;
 
     protected static Logger get_logger()
     {
@@ -314,6 +317,12 @@ public abstract class ApplicationRegistr
         try
         {
             initialiseStatistics();
+
+            if(_configuration.getHTTPManagementEnabled())
+            {
+                _httpManagementPort = _configuration.getHTTPManagementPort();
+            }
+
             _broker = new BrokerAdapter(this);
 
             initialiseManagedObjectRegistry();
@@ -773,4 +782,18 @@ public abstract class ApplicationRegistr
             _portBindingListeners.add(listener);
         }
     }
+
+
+    @Override
+    public boolean useHTTPManagement()
+    {
+System.err.println("_httpManagementPort: " + _httpManagementPort );
+        return _httpManagementPort != -1;
+    }
+
+    @Override
+    public int getHTTPManagementPort()
+    {
+        return _httpManagementPort;
+    }
 }

Modified: qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java?rev=1332242&r1=1332241&r2=1332242&view=diff
==============================================================================
--- qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
(original)
+++ qpid/branches/java-config-and-management/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
Mon Apr 30 15:23:33 2012
@@ -105,6 +105,10 @@ public interface IApplicationRegistry ex
 
     void addPortBindingListener(PortBindingListener listener);
 
+    boolean useHTTPManagement();
+
+    int getHTTPManagementPort();
+
     public interface PortBindingListener
     {
         public void bound(QpidAcceptor acceptor, InetSocketAddress bindAddress);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message