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
This commit is contained in:
Bosanac Dejan 2009-06-09 15:03:47 +00:00
parent 34f00a6a03
commit 88dfd77002
4 changed files with 25 additions and 12 deletions

View File

@ -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

View File

@ -15,7 +15,15 @@
limitations under the License.
-->
<!-- START SNIPPET: xbean -->
<beans>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<broker useJmx="true" xmlns="http://activemq.apache.org/schema/core">

View File

@ -26,7 +26,7 @@
</parent>
<artifactId>activemq-web</artifactId>
<packaging>jar</packaging>
<packaging>bundle</packaging>
<name>ActiveMQ :: Web</name>
<description>Web Connector for REST API and Streamlets support</description>

View File

@ -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<ObjectName> 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");
}