summaryrefslogtreecommitdiff
path: root/java/broker-plugins
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2013-04-26 16:53:46 +0000
committerAlex Rudyy <orudyy@apache.org>2013-04-26 16:53:46 +0000
commit76f2f302aadef0bd5892f65418f760c174b7b6ba (patch)
treee642d7561930230260bbf267d2f245d3bab8c604 /java/broker-plugins
parentbcedcc0a234638b352dcf778dc2aed1d2936e5c1 (diff)
downloadqpid-python-76f2f302aadef0bd5892f65418f760c174b7b6ba.tar.gz
QPID-4777: Add UI to view and edit web management configuration
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1476288 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker-plugins')
-rw-r--r--java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java21
-rw-r--r--java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Plugin.js96
-rw-r--r--java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js7
-rw-r--r--java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js170
-rw-r--r--java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js84
-rw-r--r--java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js2
-rw-r--r--java/broker-plugins/management-http/src/main/java/resources/plugin/showManagementHttp.html48
-rw-r--r--java/broker-plugins/management-http/src/main/java/resources/plugin/showManagementJmx.html28
-rw-r--r--java/broker-plugins/management-http/src/main/java/resources/showPlugin.html33
-rw-r--r--java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementFactoryTest.java2
-rw-r--r--java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementTest.java5
-rw-r--r--java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java26
12 files changed, 482 insertions, 40 deletions
diff --git a/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java b/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
index 2fc54482a4..60ec7717cb 100644
--- a/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
+++ b/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
@@ -138,15 +138,11 @@ public class HttpManagement extends AbstractPluginAdapter implements HttpManagem
put(PluginFactory.PLUGIN_TYPE, String.class);
}});
- private final Broker _broker;
-
private Server _server;
public HttpManagement(UUID id, Broker broker, Map<String, Object> attributes)
{
- super(id, DEFAULTS, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES), broker.getTaskExecutor());
- _broker = broker;
- addParent(Broker.class, broker);
+ super(id, DEFAULTS, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES), broker);
}
@Override
@@ -169,7 +165,7 @@ public class HttpManagement extends AbstractPluginAdapter implements HttpManagem
{
CurrentActor.get().message(ManagementConsoleMessages.STARTUP(OPERATIONAL_LOGGING_NAME));
- Collection<Port> httpPorts = getHttpPorts(_broker.getPorts());
+ Collection<Port> httpPorts = getHttpPorts(getBroker().getPorts());
_server = createServer(httpPorts);
try
{
@@ -195,7 +191,7 @@ public class HttpManagement extends AbstractPluginAdapter implements HttpManagem
}
catch (Exception e)
{
- throw new RuntimeException("Failed to stop http management on port " + getHttpPorts(_broker.getPorts()));
+ throw new RuntimeException("Failed to stop http management on port " + getHttpPorts(getBroker().getPorts()));
}
}
@@ -203,12 +199,6 @@ public class HttpManagement extends AbstractPluginAdapter implements HttpManagem
}
/** Added for testing purposes */
- Broker getBroker()
- {
- return _broker;
- }
-
- /** Added for testing purposes */
int getSessionTimeout()
{
return (Integer)getAttribute(TIME_OUT);
@@ -272,7 +262,7 @@ public class HttpManagement extends AbstractPluginAdapter implements HttpManagem
server.setHandler(root);
// set servlet context attributes for broker and configuration
- root.getServletContext().setAttribute(HttpManagementUtil.ATTR_BROKER, _broker);
+ root.getServletContext().setAttribute(HttpManagementUtil.ATTR_BROKER, getBroker());
root.getServletContext().setAttribute(HttpManagementUtil.ATTR_MANAGEMENT_CONFIGURATION, this);
FilterHolder restAuthorizationFilter = new FilterHolder(new ForbiddingAuthorisationFilter());
@@ -297,6 +287,7 @@ public class HttpManagement extends AbstractPluginAdapter implements HttpManagem
addRestServlet(root, "session", VirtualHost.class, Connection.class, Session.class);
addRestServlet(root, "keystore", KeyStore.class);
addRestServlet(root, "truststore", TrustStore.class);
+ addRestServlet(root, "plugin", Plugin.class);
root.addServlet(new ServletHolder(new StructureServlet()), "/rest/structure");
root.addServlet(new ServletHolder(new MessageServlet()), "/rest/message/*");
@@ -438,7 +429,7 @@ public class HttpManagement extends AbstractPluginAdapter implements HttpManagem
@Override
public SubjectCreator getSubjectCreator(SocketAddress localAddress)
{
- return _broker.getSubjectCreator(localAddress);
+ return getBroker().getSubjectCreator(localAddress);
}
}
diff --git a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Plugin.js b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Plugin.js
new file mode 100644
index 0000000000..b398683110
--- /dev/null
+++ b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Plugin.js
@@ -0,0 +1,96 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define(["dojo/_base/xhr",
+ "dojo/parser",
+ "dojo/query",
+ "dojo/_base/connect",
+ "qpid/common/properties",
+ "qpid/common/updater",
+ "qpid/common/util",
+ "dijit/registry",
+ "dojo/_base/event",
+ "dojo/domReady!"],
+ function (xhr, parser, query, connect, properties, updater, util, registry, event) {
+
+ function Plugin(name, parent, controller) {
+ this.name = name;
+ this.controller = controller;
+ this.modelObj = { type: "plugin", name: name };
+ if(parent) {
+ this.modelObj.parent = {};
+ this.modelObj.parent[ parent.type] = parent;
+ }
+ }
+
+ Plugin.prototype.getTitle = function() {
+ return "Plugin: " + this.name ;
+ };
+
+ Plugin.prototype.open = function(contentPane) {
+ var that = this;
+ this.contentPane = contentPane;
+ xhr.get({url: "showPlugin.html",
+ sync: true,
+ load: function(data) {
+ contentPane.containerNode.innerHTML = data;
+ parser.parse(contentPane.containerNode);
+
+ that.pluginUpdater = new PluginUpdater(contentPane.containerNode, that.modelObj, that.controller);
+ }});
+ };
+
+ Plugin.prototype.close = function() {
+ updater.remove( this.pluginUpdater );
+ };
+
+ function PluginUpdater(node, pluginObject, controller)
+ {
+ this.controller = controller;
+ this.name = query(".name", node)[0];
+ this.type = query(".type", node)[0];
+ this.query = "rest/plugin/"+encodeURIComponent(pluginObject.name);
+
+ var that = this;
+
+ xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"})
+ .then(function(data)
+ {
+ that.pluginData = data[0];
+
+ that.updateHeader();
+
+ require(["qpid/management/plugin/"+ that.pluginData.pluginType.toLowerCase().replace('-','')],
+ function(SpecificPlugin) {
+ that.details = new SpecificPlugin(query(".pluginDetails", node)[0], pluginObject, controller);
+ });
+
+ });
+
+ }
+
+ PluginUpdater.prototype.updateHeader = function()
+ {
+ this.name.innerHTML = this.pluginData[ "name" ];
+ this.type.innerHTML = this.pluginData[ "pluginType" ];
+ };
+
+ return Plugin;
+ });
diff --git a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js
index cd18a0c4b6..28e4445e08 100644
--- a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js
+++ b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js
@@ -33,16 +33,19 @@ define(["dojo/dom",
"qpid/management/TrustStore",
"qpid/management/AccessControlProvider",
"qpid/management/Port",
+ "qpid/management/Plugin",
"dojo/ready",
"dojo/domReady!"],
- function (dom, registry, ContentPane, Broker, VirtualHost, Exchange, Queue, Connection, AuthProvider, GroupProvider, Group, KeyStore, TrustStore, AccessControlProvider, Port, ready) {
+ function (dom, registry, ContentPane, Broker, VirtualHost, Exchange, Queue, Connection, AuthProvider,
+ GroupProvider, Group, KeyStore, TrustStore, AccessControlProvider, Port, Plugin, ready) {
var controller = {};
var constructors = { broker: Broker, virtualhost: VirtualHost, exchange: Exchange,
queue: Queue, connection: Connection,
authenticationprovider: AuthProvider, groupprovider: GroupProvider,
group: Group, keystore: KeyStore, truststore: TrustStore,
- accesscontrolprovider: AccessControlProvider, port: Port};
+ accesscontrolprovider: AccessControlProvider, port: Port,
+ plugin: Plugin};
var tabDiv = dom.byId("managedViews");
diff --git a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js
new file mode 100644
index 0000000000..9baf6a2b15
--- /dev/null
+++ b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementhttp.js
@@ -0,0 +1,170 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define(["dojo/_base/xhr",
+ "dojo/dom",
+ "dojo/parser",
+ "dojo/query",
+ "dojo/dom-construct",
+ "dojo/_base/connect",
+ "dojo/_base/window",
+ "dojo/_base/event",
+ "dojo/_base/json",
+ "dijit/registry",
+ "qpid/common/util",
+ "qpid/common/properties",
+ "qpid/common/updater",
+ "dijit/form/Button",
+ "dijit/form/ValidationTextBox",
+ "dijit/form/CheckBox",
+ "dijit/form/NumberSpinner",
+ "dojo/domReady!"],
+ function (xhr, dom, parser, query, construct, connect, win, event, json, registry, util, properties, updater) {
+
+ function ManagementHttp(containerNode, pluginObject, controller) {
+ var node = construct.create("div", null, containerNode, "last");
+ var that = this;
+ this.name = pluginObject.name;
+ xhr.get({
+ url: "plugin/showManagementHttp.html",
+ sync: true,
+ load: function(data) {
+ node.innerHTML = data;
+ parser.parse(node);
+
+ that.managementHttpUpdater= new ManagementHttpUpdater(node, pluginObject, controller);
+ that.managementHttpUpdater.update(true);
+ updater.add( that.managementHttpUpdater);
+
+ var editButton = query(".editPluginButton", node)[0];
+ connect.connect(registry.byNode(editButton), "onClick", function(evt){ that.edit(); });
+ }});
+ }
+
+ ManagementHttp.prototype.close = function() {
+ updater.remove( this.managementHttpUpdater );
+ };
+
+ ManagementHttp.prototype.edit = function() {
+ var widgetFactories = [{
+ name: "name",
+ createWidget: function(plugin) {
+ return new dijit.form.ValidationTextBox({
+ required: true,
+ value: plugin.name,
+ disabled: true,
+ label: "Name:",
+ regexp: "^[\x20-\x2e\x30-\x7F]{1,255}$",
+ name: "name"});
+ }
+ }, {
+ name: "httpBasicAuthenticationEnabled",
+ createWidget: function(plugin) {
+ return new dijit.form.CheckBox({
+ required: false,
+ checked: plugin.httpBasicAuthenticationEnabled,
+ label: "HTTP Basic Authentication Enabled:",
+ name: "httpBasicAuthenticationEnabled"});
+ }
+ }, {
+ name: "httpsBasicAuthenticationEnabled",
+ createWidget: function(plugin) {
+ return new dijit.form.CheckBox({
+ required: false,
+ checked: plugin.httpsBasicAuthenticationEnabled,
+ label: "HTTPS Basic Authentication Enabled:",
+ name: "httpsBasicAuthenticationEnabled"});
+ }
+ }, {
+ name: "httpSaslAuthenticationEnabled",
+ createWidget: function(plugin) {
+ return new dijit.form.CheckBox({
+ required: false,
+ checked: plugin.httpSaslAuthenticationEnabled,
+ label: "HTTP SASL Authentication Enabled:",
+ name: "httpSaslAuthenticationEnabled"});
+ }
+ }, {
+ name: "httpsSaslAuthenticationEnabled",
+ createWidget: function(plugin) {
+ return new dijit.form.CheckBox({
+ required: false,
+ checked: plugin.httpsSaslAuthenticationEnabled,
+ label: "HTTPS SASL Authentication Enabled:",
+ name: "httpsSaslAuthenticationEnabled"});
+ }
+ }, {
+ name: "sessionTimeout",
+ createWidget: function(plugin) {
+ return new dijit.form.NumberSpinner({
+ invalidMessage: "Invalid value",
+ required: false,
+ value: plugin.sessionTimeout,
+ smallDelta: 1,
+ constraints: {min:1,places:0, pattern: "#####"},
+ label: "Session timeout (s):",
+ name: "sessionTimeout"
+ });
+ }
+ }
+ ];
+ var data = this.managementHttpUpdater.pluginData;
+ util.showSetAttributesDialog(
+ widgetFactories,
+ data,
+ "rest/plugin/" + encodeURIComponent(data.name),
+ "Edit plugin - " + data.name);
+ };
+
+ function ManagementHttpUpdater(node, pluginObject, controller)
+ {
+ this.controller = controller;
+ this.query = "rest/plugin/"+encodeURIComponent(pluginObject.name);
+ this.name = pluginObject.name;
+ this.httpBasicAuthenticationEnabled = query(".httpBasicAuthenticationEnabled", node)[0];
+ this.httpsBasicAuthenticationEnabled = query(".httpsBasicAuthenticationEnabled", node)[0];
+ this.sessionTimeout = query(".sessionTimeout", node)[0];
+ this.httpsSaslAuthenticationEnabled = query(".httpsSaslAuthenticationEnabled", node)[0];
+ this.httpSaslAuthenticationEnabled = query(".httpSaslAuthenticationEnabled", node)[0];
+ }
+
+ ManagementHttpUpdater.prototype.update = function(syncRequest)
+ {
+ var that = this;
+
+ function showBoolean(val)
+ {
+ return "<input type='checkbox' disabled='disabled' "+(val ? "checked='checked'": "")+" />" ;
+ }
+
+ xhr.get({url: this.query, sync: syncRequest ? syncRequest : properties.useSyncGet, handleAs: "json"})
+ .then(function(data) {
+ that.pluginData = data[0];
+ that.httpBasicAuthenticationEnabled.innerHTML = showBoolean(that.pluginData.httpBasicAuthenticationEnabled);
+ that.httpsBasicAuthenticationEnabled.innerHTML = showBoolean(that.pluginData.httpsBasicAuthenticationEnabled);
+ that.httpsSaslAuthenticationEnabled.innerHTML = showBoolean(that.pluginData.httpsSaslAuthenticationEnabled);
+ that.httpSaslAuthenticationEnabled.innerHTML = showBoolean(that.pluginData.httpSaslAuthenticationEnabled);
+ that.sessionTimeout.innerHTML = that.pluginData.sessionTimeout;
+ });
+
+ };
+
+ return ManagementHttp;
+ });
diff --git a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js
new file mode 100644
index 0000000000..64750ae403
--- /dev/null
+++ b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/plugin/managementjmx.js
@@ -0,0 +1,84 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+define(["dojo/_base/xhr",
+ "dojo/dom",
+ "dojo/parser",
+ "dojo/query",
+ "dojo/dom-construct",
+ "dojo/_base/connect",
+ "dojo/_base/window",
+ "dojo/_base/event",
+ "dojo/_base/json",
+ "dijit/registry",
+ "qpid/common/util",
+ "qpid/common/properties",
+ "qpid/common/updater",
+ "dojo/domReady!"],
+ function (xhr, dom, parser, query, construct, connect, win, event, json, registry, util, properties, updater) {
+
+ function ManagementJmx(containerNode, pluginObject, controller) {
+ var node = construct.create("div", null, containerNode, "last");
+ var that = this;
+ this.name = pluginObject.name;
+ xhr.get({
+ url: "plugin/showManagementJmx.html",
+ sync: true,
+ load: function(data) {
+ node.innerHTML = data;
+ parser.parse(node);
+
+ that.managementJmxUpdater= new ManagementJmxUpdater(node, pluginObject, controller);
+ that.managementJmxUpdater.update(true);
+ updater.add( that.managementJmxUpdater);
+ }});
+ }
+
+ ManagementJmx.prototype.close = function() {
+ updater.remove( this.managementJmxUpdater );
+ };
+
+ function ManagementJmxUpdater(node, pluginObject, controller)
+ {
+ this.controller = controller;
+ this.query = "rest/plugin/"+encodeURIComponent(pluginObject.name);
+ this.name = pluginObject.name;
+ this.usePlatformMBeanServer = query(".usePlatformMBeanServer", node)[0];
+ }
+
+ ManagementJmxUpdater.prototype.update = function(syncRequest)
+ {
+ var that = this;
+
+ function showBoolean(val)
+ {
+ return "<input type='checkbox' disabled='disabled' "+(val ? "checked='checked'": "")+" />" ;
+ }
+
+ xhr.get({url: this.query, sync: syncRequest ? syncRequest : properties.useSyncGet, handleAs: "json"})
+ .then(function(data) {
+ that.pluginData = data[0];
+ that.usePlatformMBeanServer.innerHTML = showBoolean(that.pluginData.usePlatformMBeanServer);
+ });
+
+ };
+
+ return ManagementJmx;
+ });
diff --git a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
index 05df5e24b7..8dc336b347 100644
--- a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
+++ b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
@@ -282,6 +282,8 @@ define(["dojo/_base/xhr",
controller.show("truststore", details.truststore, {broker: {type:"broker", name:""}});
} else if (details.type == 'accesscontrolprovider') {
controller.show("accesscontrolprovider", details.accesscontrolprovider, {broker: {type:"broker", name:""}});
+ } else if (details.type == 'plugin') {
+ controller.show("plugin", details.plugin, {broker: {type:"broker", name:""}});
}
};
diff --git a/java/broker-plugins/management-http/src/main/java/resources/plugin/showManagementHttp.html b/java/broker-plugins/management-http/src/main/java/resources/plugin/showManagementHttp.html
new file mode 100644
index 0000000000..ea4bfc93f8
--- /dev/null
+++ b/java/broker-plugins/management-http/src/main/java/resources/plugin/showManagementHttp.html
@@ -0,0 +1,48 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<div>
+ <div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 260px;">Basic Authentication for HTTP enabled:</div>
+ <div class="httpBasicAuthenticationEnabled" style="float:left;"></div><br/>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 260px;">Basic Authentication for HTTPS enabled:</div>
+ <div class="httpsBasicAuthenticationEnabled" style="float:left;"></div><br/>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 260px;">SASL Authentication for HTTP enabled:</div>
+ <div class="httpSaslAuthenticationEnabled" style="float:left;"></div><br/>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 260px;">SASL Authentication for HTTPS enabled:</div>
+ <div class="httpsSaslAuthenticationEnabled" style="float:left;"></div><br/>
+ </div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 260px;">Session timeout (s):</div>
+ <div class="sessionTimeout" style="float:left;"></div><br/>
+ </div>
+ </div>
+ <br/>
+ <div class="dijitDialogPaneActionBar">
+ <button data-dojo-type="dijit.form.Button" class="editPluginButton" type="button">Edit</button>
+ </div>
+</div>
diff --git a/java/broker-plugins/management-http/src/main/java/resources/plugin/showManagementJmx.html b/java/broker-plugins/management-http/src/main/java/resources/plugin/showManagementJmx.html
new file mode 100644
index 0000000000..3abf578fbd
--- /dev/null
+++ b/java/broker-plugins/management-http/src/main/java/resources/plugin/showManagementJmx.html
@@ -0,0 +1,28 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<div>
+ <div>
+ <div style="clear:both">
+ <div class="formLabel-labelCell" style="float:left; width: 260px;">Use Platform MBean Server:</div>
+ <div class="usePlatformMBeanServer" style="float:left;"></div><br/>
+ </div>
+ </div>
+</div>
diff --git a/java/broker-plugins/management-http/src/main/java/resources/showPlugin.html b/java/broker-plugins/management-http/src/main/java/resources/showPlugin.html
new file mode 100644
index 0000000000..f2f3134037
--- /dev/null
+++ b/java/broker-plugins/management-http/src/main/java/resources/showPlugin.html
@@ -0,0 +1,33 @@
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<div class="plugin">
+ <div>
+ <div style="both:clear">
+ <div class="formLabel-labelCell" style="float:left; width: 260px;">Name:</div>
+ <div class="name" style="float:left;"></div><br/>
+ </div>
+ <div style="both:clear">
+ <div class="formLabel-labelCell" style="float:left; width: 260px;">Type:</div>
+ <div class="type" style="float:left;"></div><br/>
+ </div>
+ </div>
+ <div class="pluginDetails"></div>
+</div>
diff --git a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementFactoryTest.java b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementFactoryTest.java
index bb4c46826c..10bc9f941b 100644
--- a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementFactoryTest.java
+++ b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementFactoryTest.java
@@ -54,7 +54,7 @@ public class HttpManagementFactoryTest extends QpidTestCase
HttpManagement management = (HttpManagement) _pluginFactory.createInstance(_id, _attributes, _broker);
- assertEquals(_broker, management.getBroker());
+ assertEquals(_broker, management.getParent(Broker.class));
assertEquals(SESSION_TIMEOUT, management.getSessionTimeout());
}
diff --git a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementTest.java b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementTest.java
index 55606af117..18d774e341 100644
--- a/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementTest.java
+++ b/java/broker-plugins/management-http/src/test/java/org/apache/qpid/server/management/plugin/HttpManagementTest.java
@@ -55,11 +55,6 @@ public class HttpManagementTest extends QpidTestCase
_management = new HttpManagement(_id, _broker, attributes);
}
- public void testGetBroker()
- {
- assertEquals("Unexpected broker", _broker, _management.getBroker());
- }
-
public void testGetSessionTimeout()
{
assertEquals("Unexpected session timeout", 10000l, _management.getSessionTimeout());
diff --git a/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java b/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java
index 3342aea4fb..cebfb8d9d9 100644
--- a/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java
+++ b/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java
@@ -89,16 +89,13 @@ public class JMXManagement extends AbstractPluginAdapter implements Configuratio
put(PluginFactory.PLUGIN_TYPE, String.class);
}};
- private final Broker _broker;
private JMXManagedObjectRegistry _objectRegistry;
private final Map<ConfiguredObject, AMQManagedObject> _children = new HashMap<ConfiguredObject, AMQManagedObject>();
public JMXManagement(UUID id, Broker broker, Map<String, Object> attributes)
{
- super(id, DEFAULTS, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES), broker.getTaskExecutor());
- _broker = broker;
- addParent(Broker.class, broker);
+ super(id, DEFAULTS, MapValueConverter.convert(attributes, ATTRIBUTE_TYPES), broker);
}
@Override
@@ -130,9 +127,10 @@ public class JMXManagement extends AbstractPluginAdapter implements Configuratio
private void start() throws JMException, IOException
{
+ Broker broker = getBroker();
Port connectorPort = null;
Port registryPort = null;
- Collection<Port> ports = _broker.getPorts();
+ Collection<Port> ports = broker.getPorts();
for (Port port : ports)
{
if (State.QUIESCED.equals(port.getActualState()))
@@ -158,13 +156,13 @@ public class JMXManagement extends AbstractPluginAdapter implements Configuratio
throw new IllegalStateException("No JMX RMI port found supporting protocol " + Protocol.RMI);
}
- _objectRegistry = new JMXManagedObjectRegistry(_broker, connectorPort, registryPort, this);
+ _objectRegistry = new JMXManagedObjectRegistry(broker, connectorPort, registryPort, this);
- _broker.addChangeListener(this);
+ broker.addChangeListener(this);
synchronized (_children)
{
- for(VirtualHost virtualHost : _broker.getVirtualHosts())
+ for(VirtualHost virtualHost : broker.getVirtualHosts())
{
if(!_children.containsKey(virtualHost))
{
@@ -181,7 +179,7 @@ public class JMXManagement extends AbstractPluginAdapter implements Configuratio
createAdditionalMBeansFromProviders(virtualHost, mbean);
}
}
- Collection<AuthenticationProvider> authenticationProviders = _broker.getAuthenticationProviders();
+ Collection<AuthenticationProvider> authenticationProviders = broker.getAuthenticationProviders();
for (AuthenticationProvider authenticationProvider : authenticationProviders)
{
if(authenticationProvider instanceof PasswordCredentialManagingAuthenticationProvider)
@@ -194,7 +192,7 @@ public class JMXManagement extends AbstractPluginAdapter implements Configuratio
}
}
new Shutdown(_objectRegistry);
- new ServerInformationMBean(_objectRegistry, _broker);
+ new ServerInformationMBean(_objectRegistry, broker);
if (LoggingManagementFacade.getCurrentInstance() != null)
{
new LoggingManagementMBean(LoggingManagementFacade.getCurrentInstance(), _objectRegistry);
@@ -234,7 +232,7 @@ public class JMXManagement extends AbstractPluginAdapter implements Configuratio
}
_children.clear();
}
- _broker.removeChangeListener(this);
+ getBroker().removeChangeListener(this);
_objectRegistry.close();
}
@@ -352,12 +350,6 @@ public class JMXManagement extends AbstractPluginAdapter implements Configuratio
}
}
- /** Added for testing purposes */
- Broker getBroker()
- {
- return _broker;
- }
-
@Override
public String getName()
{