[hornetq-commits] JBoss hornetq SVN: r9360 - trunk/src/main/org/hornetq/api/core/management.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Jun 24 08:41:35 EDT 2010


Author: jmesnil
Date: 2010-06-24 08:41:35 -0400 (Thu, 24 Jun 2010)
New Revision: 9360

Modified:
   trunk/src/main/org/hornetq/api/core/management/ManagementHelper.java
Log:
https://jira.jboss.org/browse/HORNETQ-343: Management operation results can not be read from Stomp clients

* store management operation results in the message body buffer as a nullable SimpleString (instead of a nullable String) so that it can be read by Stomp messages
* added ManagementWithStompTest
* fixed doc which contains erroneous explanation about Stomp/JMS/Core mapping

Modified: trunk/src/main/org/hornetq/api/core/management/ManagementHelper.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/management/ManagementHelper.java	2010-06-24 12:40:30 UTC (rev 9359)
+++ trunk/src/main/org/hornetq/api/core/management/ManagementHelper.java	2010-06-24 12:41:35 UTC (rev 9360)
@@ -145,7 +145,7 @@
          paramString = null;
       }
 
-      message.getBodyBuffer().writeNullableString(paramString);
+      message.getBodyBuffer().writeNullableSimpleString(SimpleString.toSimpleString(paramString));
    }
 
    private static JSONArray toJSONArray(final Object[] array) throws Exception
@@ -303,7 +303,8 @@
     */
    public static Object[] retrieveOperationParameters(final Message message) throws Exception
    {
-      String jsonString = message.getBodyBuffer().readNullableString();
+      SimpleString sstring = message.getBodyBuffer().readNullableSimpleString();
+      String jsonString = (sstring == null) ? null : sstring.toString();
 
       if (jsonString != null)
       {
@@ -353,7 +354,7 @@
          resultString = null;
       }
 
-      message.getBodyBuffer().writeNullableString(resultString);
+      message.getBodyBuffer().writeNullableSimpleString(SimpleString.toSimpleString(resultString));
    }
 
    /**
@@ -364,8 +365,9 @@
     */
    public static Object[] getResults(final Message message) throws Exception
    {
-      String jsonString = message.getBodyBuffer().readNullableString();
-
+      SimpleString sstring = message.getBodyBuffer().readNullableSimpleString();
+      String jsonString = (sstring == null) ? null : sstring.toString();
+                                           ;
       if (jsonString != null)
       {
          JSONArray jsonArray = new JSONArray(jsonString);



More information about the hornetq-commits mailing list