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:
Bosanac Dejan 2013-02-01 10:17:44 +00:00
parent a3bfd17e7d
commit e8deea92b6
4 changed files with 20 additions and 8 deletions

View File

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

View File

@ -45,7 +45,7 @@ public class OsgiConfiguration extends AbstractConfiguration implements ManagedS
BundleContext context = FrameworkUtil.getBundle(getClass()).getBundleContext();
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(),
this, properties);
@ -73,6 +73,14 @@ public class OsgiConfiguration extends AbstractConfiguration implements ManagedS
@Override
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);
}
}

View File

@ -29,13 +29,13 @@ import javax.management.remote.JMXServiceURL;
*/
public class SystemPropertiesConfiguration extends AbstractConfiguration {
private static final String PROPERTY_JMS_URL = "webconsole.jms.url";
private 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_URL = "webconsole.jms.url";
public static final String PROPERTY_JMS_USER = "webconsole.jms.user";
public static final String PROPERTY_JMS_PASSWORD = "webconsole.jms.password";
private static final String PROPERTY_JMX_URL = "webconsole.jmx.url";
private 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_URL = "webconsole.jmx.url";
public static final String PROPERTY_JMX_USER = "webconsole.jmx.user";
public static final String PROPERTY_JMX_PASSWORD = "webconsole.jmx.password";
public ConnectionFactory getConnectionFactory() {
String jmsUrl = System.getProperty(PROPERTY_JMS_URL);