activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1441375 - in /activemq/trunk: activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/ activemq-web-console/src/main/java/org/apache/activemq/web/config/ activemq-web/src/main/java/org/apache/activemq/web/config/
Date Fri, 01 Feb 2013 10:17:44 GMT
Author: dejanb
Date: Fri Feb  1 10:17:44 2013
New Revision: 1441375

URL: http://svn.apache.org/viewvc?rev=1441375&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-4034 - osgi web console, finishing config admin
configuration

Added:
    activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server.cfg
      - copied, changed from r1441299, activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server-default.cfg
    activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.webconsole.cfg
Removed:
    activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server-default.cfg
Modified:
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/config/OsgiConfiguration.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/config/SystemPropertiesConfiguration.java

Copied: activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server.cfg
(from r1441299, activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server-default.cfg)
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server.cfg?p2=activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server.cfg&p1=activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.server-default.cfg&r1=1441299&r2=1441375&rev=1441375&view=diff
==============================================================================
    (empty)

Added: activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.webconsole.cfg
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.webconsole.cfg?rev=1441375&view=auto
==============================================================================
--- activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.webconsole.cfg
(added)
+++ activemq/trunk/activemq-karaf-itest/src/test/resources/org/apache/activemq/karaf/itest/org.apache.activemq.webconsole.cfg
Fri Feb  1 10:17:44 2013
@@ -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
\ No newline at end of file

Modified: activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/config/OsgiConfiguration.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/config/OsgiConfiguration.java?rev=1441375&r1=1441374&r2=1441375&view=diff
==============================================================================
--- activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/config/OsgiConfiguration.java
(original)
+++ activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/config/OsgiConfiguration.java
Fri Feb  1 10:17:44 2013
@@ -45,7 +45,7 @@ public class OsgiConfiguration extends A
 
         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 A
 
     @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);
     }
 }

Modified: activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/config/SystemPropertiesConfiguration.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/config/SystemPropertiesConfiguration.java?rev=1441375&r1=1441374&r2=1441375&view=diff
==============================================================================
--- activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/config/SystemPropertiesConfiguration.java
(original)
+++ activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/config/SystemPropertiesConfiguration.java
Fri Feb  1 10:17:44 2013
@@ -29,13 +29,13 @@ import javax.management.remote.JMXServic
  */
 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";
-
-	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_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";
+
+    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);



Mime
View raw message