activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1398731 - in /activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web: MessageQuery.java WebClient.java
Date Tue, 16 Oct 2012 11:03:05 GMT
Author: dejanb
Date: Tue Oct 16 11:03:04 2012
New Revision: 1398731

URL: http://svn.apache.org/viewvc?rev=1398731&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-4110 - web console sending messages to the secured
broker - use default credentials defined in factory if not explicitly set

Modified:
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java

Modified: activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java?rev=1398731&r1=1398730&r2=1398731&view=diff
==============================================================================
--- activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java (original)
+++ activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageQuery.java Tue
Oct 16 11:03:04 2012
@@ -112,6 +112,20 @@ public class MessageQuery extends QueueB
         return null;
     }
 
+    public Map<String, Object> getPropertiesMap() throws JMSException {
+        Map<String, Object> answer = new HashMap<String, Object>();
+        Message aMessage = getMessage();
+        Enumeration iter = aMessage.getPropertyNames();
+        while (iter.hasMoreElements()) {
+            String name = (String) iter.nextElement();
+            Object value = aMessage.getObjectProperty(name);
+            if (value != null) {
+                answer.put(name, value);
+            }
+        }
+        return answer;
+    }
+
     protected Map<String, Object> createMapBody(MapMessage mapMessage) throws JMSException
{
         Map<String, Object> answer = new HashMap<String, Object>();
         Enumeration iter = mapMessage.getMapNames();

Modified: activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java?rev=1398731&r1=1398730&r2=1398731&view=diff
==============================================================================
--- activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java (original)
+++ activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java Tue Oct
16 11:03:04 2012
@@ -263,7 +263,11 @@ public class WebClient implements HttpSe
 
     public Connection getConnection() throws JMSException {
         if (connection == null) {
-            connection = factory.createConnection(username, password);
+            if (username != null && password != null) {
+                connection = factory.createConnection(username, password);
+            } else {
+                connection = factory.createConnection();
+            }
             connection.start();
         }
         return connection;



Mime
View raw message