mirror of https://github.com/apache/activemq.git
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:
parent
34f00a6a03
commit
88dfd77002
|
@ -40,8 +40,6 @@
|
||||||
WEB-INF/lib/activation*.jar,
|
WEB-INF/lib/activation*.jar,
|
||||||
WEB-INF/lib/activeio*.jar,
|
WEB-INF/lib/activeio*.jar,
|
||||||
WEB-INF/lib/activemq-console*.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/geronimo*.jar,
|
||||||
WEB-INF/lib/xml-apis*.jar,
|
WEB-INF/lib/xml-apis*.jar,
|
||||||
WEB-INF/lib/xerces*.jar
|
WEB-INF/lib/xerces*.jar
|
||||||
|
|
|
@ -15,7 +15,15 @@
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<!-- START SNIPPET: xbean -->
|
<!-- 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">
|
<broker useJmx="true" xmlns="http://activemq.apache.org/schema/core">
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>activemq-web</artifactId>
|
<artifactId>activemq-web</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>bundle</packaging>
|
||||||
<name>ActiveMQ :: Web</name>
|
<name>ActiveMQ :: Web</name>
|
||||||
<description>Web Connector for REST API and Streamlets support</description>
|
<description>Web Connector for REST API and Streamlets support</description>
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,15 @@ public class RemoteJMXBrokerFacade extends BrokerFacadeSupport {
|
||||||
this.brokerName = brokerName;
|
this.brokerName = brokerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public WebConsoleConfiguration getConfiguration() {
|
||||||
|
return configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfiguration(WebConsoleConfiguration configuration) {
|
||||||
|
this.configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
* Shutdown this facade aka close any open connection.
|
* Shutdown this facade aka close any open connection.
|
||||||
*/
|
*/
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
|
@ -76,7 +84,7 @@ public class RemoteJMXBrokerFacade extends BrokerFacadeSupport {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BrokerViewMBean getBrokerAdmin() throws Exception {
|
public BrokerViewMBean getBrokerAdmin() throws Exception {
|
||||||
MBeanServerConnection connection = getConnection();
|
MBeanServerConnection connection = getMBeanServerConnection();
|
||||||
|
|
||||||
Set brokers = findBrokers(connection);
|
Set brokers = findBrokers(connection);
|
||||||
if (brokers.size() == 0) {
|
if (brokers.size() == 0) {
|
||||||
|
@ -89,13 +97,10 @@ public class RemoteJMXBrokerFacade extends BrokerFacadeSupport {
|
||||||
|
|
||||||
public String getBrokerName() throws Exception,
|
public String getBrokerName() throws Exception,
|
||||||
MalformedObjectNameException {
|
MalformedObjectNameException {
|
||||||
MBeanServerConnection connection = getMBeanServerConnection();
|
return getBrokerAdmin().getBrokerName();
|
||||||
ObjectName brokerObjectName = getBrokerObjectName(connection);
|
}
|
||||||
String brokerName = brokerObjectName.getKeyProperty("BrokerName");
|
|
||||||
return brokerName;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected MBeanServerConnection getConnection() throws IOException {
|
protected MBeanServerConnection getMBeanServerConnection() throws Exception {
|
||||||
JMXConnector connector = this.connector;
|
JMXConnector connector = this.connector;
|
||||||
if (isConnectionActive(connector)) {
|
if (isConnectionActive(connector)) {
|
||||||
return connector.getMBeanServerConnection();
|
return connector.getMBeanServerConnection();
|
||||||
|
@ -200,10 +205,12 @@ public class RemoteJMXBrokerFacade extends BrokerFacadeSupport {
|
||||||
Set<ObjectName> brokers = connection.queryNames(name, null);
|
Set<ObjectName> brokers = connection.queryNames(name, null);
|
||||||
return brokers;
|
return brokers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void purgeQueue(ActiveMQDestination destination) throws Exception {
|
public void purgeQueue(ActiveMQDestination destination) throws Exception {
|
||||||
QueueViewMBean queue = getQueue(destination.getPhysicalName());
|
QueueViewMBean queue = getQueue(destination.getPhysicalName());
|
||||||
queue.purge();
|
queue.purge();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ManagementContext getManagementContext() {
|
public ManagementContext getManagementContext() {
|
||||||
throw new IllegalStateException("not supported");
|
throw new IllegalStateException("not supported");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue