From 88dfd77002417434eac8e12db586f0b31ea37782 Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Tue, 9 Jun 2009 15:03:47 +0000 Subject: [PATCH] https://issues.apache.org/activemq/browse/AMQ-1324 - additional changes to make the console work nice in osgi environment and with remote brokers git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@783025 13f79535-47bb-0310-9956-ffa450edef68 --- activemq-web-console/pom.xml | 2 -- .../src/main/webapp/WEB-INF/activemq.xml | 10 +++++++- activemq-web/pom.xml | 2 +- .../activemq/web/RemoteJMXBrokerFacade.java | 23 ++++++++++++------- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/activemq-web-console/pom.xml b/activemq-web-console/pom.xml index ebc09c7ccc..9e8ddfea6f 100755 --- a/activemq-web-console/pom.xml +++ b/activemq-web-console/pom.xml @@ -40,8 +40,6 @@ WEB-INF/lib/activation*.jar, WEB-INF/lib/activeio*.jar, WEB-INF/lib/activemq-console*.jar, - WEB-INF/lib/activemq-core*.jar, - WEB-INF/lib/activemq-xmpp*.jar, WEB-INF/lib/geronimo*.jar, WEB-INF/lib/xml-apis*.jar, WEB-INF/lib/xerces*.jar diff --git a/activemq-web-console/src/main/webapp/WEB-INF/activemq.xml b/activemq-web-console/src/main/webapp/WEB-INF/activemq.xml index 3f809a2230..c742c41cbe 100755 --- a/activemq-web-console/src/main/webapp/WEB-INF/activemq.xml +++ b/activemq-web-console/src/main/webapp/WEB-INF/activemq.xml @@ -15,7 +15,15 @@ limitations under the License. --> - + diff --git a/activemq-web/pom.xml b/activemq-web/pom.xml index 52eb00e6a1..a2622aad53 100755 --- a/activemq-web/pom.xml +++ b/activemq-web/pom.xml @@ -26,7 +26,7 @@ activemq-web - jar + bundle ActiveMQ :: Web Web Connector for REST API and Streamlets support diff --git a/activemq-web/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java b/activemq-web/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java index 54cfcab036..09d8c2c051 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/RemoteJMXBrokerFacade.java @@ -58,7 +58,15 @@ public class RemoteJMXBrokerFacade extends BrokerFacadeSupport { this.brokerName = brokerName; } - /** + public WebConsoleConfiguration getConfiguration() { + return configuration; + } + + public void setConfiguration(WebConsoleConfiguration configuration) { + this.configuration = configuration; + } + + /** * Shutdown this facade aka close any open connection. */ public void shutdown() { @@ -76,7 +84,7 @@ public class RemoteJMXBrokerFacade extends BrokerFacadeSupport { } public BrokerViewMBean getBrokerAdmin() throws Exception { - MBeanServerConnection connection = getConnection(); + MBeanServerConnection connection = getMBeanServerConnection(); Set brokers = findBrokers(connection); if (brokers.size() == 0) { @@ -89,13 +97,10 @@ public class RemoteJMXBrokerFacade extends BrokerFacadeSupport { public String getBrokerName() throws Exception, MalformedObjectNameException { - MBeanServerConnection connection = getMBeanServerConnection(); - ObjectName brokerObjectName = getBrokerObjectName(connection); - String brokerName = brokerObjectName.getKeyProperty("BrokerName"); - return brokerName; - } + return getBrokerAdmin().getBrokerName(); + } - protected MBeanServerConnection getConnection() throws IOException { + protected MBeanServerConnection getMBeanServerConnection() throws Exception { JMXConnector connector = this.connector; if (isConnectionActive(connector)) { return connector.getMBeanServerConnection(); @@ -200,10 +205,12 @@ public class RemoteJMXBrokerFacade extends BrokerFacadeSupport { Set brokers = connection.queryNames(name, null); return brokers; } + public void purgeQueue(ActiveMQDestination destination) throws Exception { QueueViewMBean queue = getQueue(destination.getPhysicalName()); queue.purge(); } + public ManagementContext getManagementContext() { throw new IllegalStateException("not supported"); }