mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4034 - osgi web console, finishing config admin configuration
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1441375 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a3bfd17e7d
commit
e8deea92b6
|
@ -0,0 +1,4 @@
|
||||||
|
webconsole.jms.url=tcp://localhost:61616
|
||||||
|
webconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
|
||||||
|
webconsole.jmx.user=karaf
|
||||||
|
webconsole.jmx.password=karaf
|
|
@ -45,7 +45,7 @@ public class OsgiConfiguration extends AbstractConfiguration implements ManagedS
|
||||||
|
|
||||||
BundleContext context = FrameworkUtil.getBundle(getClass()).getBundleContext();
|
BundleContext context = FrameworkUtil.getBundle(getClass()).getBundleContext();
|
||||||
Dictionary properties = new Hashtable();
|
Dictionary properties = new Hashtable();
|
||||||
properties.put(Constants.SERVICE_PID, "org.apache.activemq.server");
|
properties.put(Constants.SERVICE_PID, "org.apache.activemq.webconsole");
|
||||||
service = context.registerService(ManagedService.class.getName(),
|
service = context.registerService(ManagedService.class.getName(),
|
||||||
this, properties);
|
this, properties);
|
||||||
|
|
||||||
|
@ -73,6 +73,14 @@ public class OsgiConfiguration extends AbstractConfiguration implements ManagedS
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updated(Dictionary dictionary) throws ConfigurationException {
|
public void updated(Dictionary dictionary) throws ConfigurationException {
|
||||||
//TODO update properties
|
jmxUrl = (String)dictionary.get(SystemPropertiesConfiguration.PROPERTY_JMX_URL);
|
||||||
|
if (jmxUrl == null) {
|
||||||
|
throw new IllegalArgumentException("A JMS-url must be specified (system property " + SystemPropertiesConfiguration.PROPERTY_JMX_URL);
|
||||||
|
}
|
||||||
|
jmxUser = (String)dictionary.get(SystemPropertiesConfiguration.PROPERTY_JMX_USER);
|
||||||
|
jmxPassword = (String)dictionary.get(SystemPropertiesConfiguration.PROPERTY_JMX_PASSWORD);
|
||||||
|
jmxUrl = (String)dictionary.get(SystemPropertiesConfiguration.PROPERTY_JMS_URL);
|
||||||
|
jmsUser = (String)dictionary.get(SystemPropertiesConfiguration.PROPERTY_JMS_USER);
|
||||||
|
jmsPassword = (String)dictionary.get(SystemPropertiesConfiguration.PROPERTY_JMS_PASSWORD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,13 +29,13 @@ import javax.management.remote.JMXServiceURL;
|
||||||
*/
|
*/
|
||||||
public class SystemPropertiesConfiguration extends AbstractConfiguration {
|
public class SystemPropertiesConfiguration extends AbstractConfiguration {
|
||||||
|
|
||||||
private static final String PROPERTY_JMS_URL = "webconsole.jms.url";
|
public static final String PROPERTY_JMS_URL = "webconsole.jms.url";
|
||||||
private static final String PROPERTY_JMS_USER = "webconsole.jms.user";
|
public static final String PROPERTY_JMS_USER = "webconsole.jms.user";
|
||||||
private static final String PROPERTY_JMS_PASSWORD = "webconsole.jms.password";
|
public static final String PROPERTY_JMS_PASSWORD = "webconsole.jms.password";
|
||||||
|
|
||||||
private static final String PROPERTY_JMX_URL = "webconsole.jmx.url";
|
public static final String PROPERTY_JMX_URL = "webconsole.jmx.url";
|
||||||
private static final String PROPERTY_JMX_USER = "webconsole.jmx.user";
|
public static final String PROPERTY_JMX_USER = "webconsole.jmx.user";
|
||||||
private static final String PROPERTY_JMX_PASSWORD = "webconsole.jmx.password";
|
public static final String PROPERTY_JMX_PASSWORD = "webconsole.jmx.password";
|
||||||
|
|
||||||
public ConnectionFactory getConnectionFactory() {
|
public ConnectionFactory getConnectionFactory() {
|
||||||
String jmsUrl = System.getProperty(PROPERTY_JMS_URL);
|
String jmsUrl = System.getProperty(PROPERTY_JMS_URL);
|
||||||
|
|
Loading…
Reference in New Issue