[mule-scm] [mule][25303] branches/mule-3.3.x/core/src/main/java/org/mule/el/context: EE-3095 Add toString() method for org.mule.el.context. MessagePropertyMapContext

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[mule-scm] [mule][25303] branches/mule-3.3.x/core/src/main/java/org/mule/el/context: EE-3095 Add toString() method for org.mule.el.context. MessagePropertyMapContext

dirk.olmes
[mule][25303] branches/mule-3.3.x/core/src/main/java/org/mule/el/context: EE-3095 Add toString() method for org.mule.el.context.MessagePropertyMapContext
Revision
25303
Author
dirk.olmes
Date
2013-02-22 21:31:11 -0600 (Fri, 22 Feb 2013)

Log Message

EE-3095 Add toString() method for org.mule.el.context.MessagePropertyMapContext

Modified Paths

Diff

Modified: branches/mule-3.3.x/core/src/main/java/org/mule/el/context/MessageContext.java (25302 => 25303)


--- branches/mule-3.3.x/core/src/main/java/org/mule/el/context/MessageContext.java	2013-02-22 16:06:41 UTC (rev 25302)
+++ branches/mule-3.3.x/core/src/main/java/org/mule/el/context/MessageContext.java	2013-02-23 03:31:11 UTC (rev 25303)
@@ -21,9 +21,9 @@
 
 /**
  * Exposes information about the current Mule message:
- * 
+ *
  * <li> <b>id</b>                    <i>The unique message id</i>
- * <li> <b>rootId</b>                <i>The root message id.  The id of the message before being split into parts. 
+ * <li> <b>rootId</b>                <i>The root message id.  The id of the message before being split into parts.
  *                                      If was is not split then this value is the same as the id.</i>
  * <li> <b>correlationId</b>         <i>The message correlationId.</i>
  * <li> <b>correlationSequence</b>   <i>The message correlation sequence number.</i>
@@ -125,4 +125,9 @@
         return new OutboundAttachmentMapContext(message);
     }
 
+    @Override
+    public String toString()
+    {
+        return message.toString();
+    }
 }

Modified: branches/mule-3.3.x/core/src/main/java/org/mule/el/context/MessagePropertyMapContext.java (25302 => 25303)


--- branches/mule-3.3.x/core/src/main/java/org/mule/el/context/MessagePropertyMapContext.java	2013-02-22 16:06:41 UTC (rev 25302)
+++ branches/mule-3.3.x/core/src/main/java/org/mule/el/context/MessagePropertyMapContext.java	2013-02-23 03:31:11 UTC (rev 25303)
@@ -14,6 +14,8 @@
 import org.mule.api.transport.PropertyScope;
 import org.mule.config.i18n.CoreMessages;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
 
 public class MessagePropertyMapContext extends AbstractMapContext<String, Object>
@@ -89,4 +91,15 @@
         message.clearProperties(propertyScope);
     }
 
+    @Override
+    public String toString()
+    {
+        Map<String, Object> map = new HashMap<String, Object>();
+        for (String key : message.getPropertyNames(propertyScope))
+        {
+            Object value = message.getProperty(key, propertyScope);
+            map.put(key, value);
+        }
+        return map.toString();
+    }
 }

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email