[jboss-cvs] JBoss Messaging SVN: r3285 - in branches/Branch_Stable/src/main/org/jboss: messaging/core/impl/message and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Nov 2 17:43:15 EDT 2007


Author: clebert.suconic at jboss.com
Date: 2007-11-02 17:43:15 -0400 (Fri, 02 Nov 2007)
New Revision: 3285

Modified:
   branches/Branch_Stable/src/main/org/jboss/jms/message/JBossObjectMessage.java
   branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/message/MessageSupport.java
Log:
JBMESSAGING-1138 - fix for object types

Modified: branches/Branch_Stable/src/main/org/jboss/jms/message/JBossObjectMessage.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/message/JBossObjectMessage.java	2007-11-02 20:36:42 UTC (rev 3284)
+++ branches/Branch_Stable/src/main/org/jboss/jms/message/JBossObjectMessage.java	2007-11-02 21:43:15 UTC (rev 3285)
@@ -21,7 +21,11 @@
   */
 package org.jboss.jms.message;
 
+import org.jboss.messaging.util.StreamUtils;
+
 import java.io.Serializable;
+import java.io.DataOutputStream;
+import java.io.IOException;
 import java.util.Map;
 
 import javax.jms.JMSException;
@@ -132,6 +136,11 @@
 
    // Protected -----------------------------------------------------
 
+   protected void doWriteObject(DataOutputStream out, Object payload) throws IOException
+   {
+      StreamUtils.writeObject(out, payload, false, true);
+   }
+
    // Private -------------------------------------------------------
 
    // Inner classes -------------------------------------------------

Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/message/MessageSupport.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/message/MessageSupport.java	2007-11-02 20:36:42 UTC (rev 3284)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/message/MessageSupport.java	2007-11-02 21:43:15 UTC (rev 3285)
@@ -28,6 +28,7 @@
 import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
+import java.io.IOException;
 
 import org.jboss.logging.Logger;
 import org.jboss.messaging.core.contract.Message;
@@ -212,7 +213,7 @@
 			{
 				ByteArrayOutputStream bos = new ByteArrayOutputStream(BUFFER_SIZE);
 				DataOutputStream daos = new DataOutputStream(bos);
-				StreamUtils.writeObject(daos, payload, false, true);
+				doWriteObject(daos, payload);
 				daos.close();
 				payloadAsByteArray = bos.toByteArray();				
 				
@@ -230,7 +231,7 @@
 		return payloadAsByteArray;
 	}
 
-	public synchronized Object getPayload()
+   public synchronized Object getPayload()
 	{		
 		if (payload != null)
 		{
@@ -390,6 +391,13 @@
 
 	// Protected -----------------------------------------------------
 
+   // Certain MessageTypes will need different behaviors. For example ObjectMessages won't use container types
+   protected void doWriteObject(DataOutputStream out, Object payload) throws IOException
+   {
+      StreamUtils.writeObject(out, payload, true, true);
+   }
+
+
 	// Private -------------------------------------------------------
 
 	// Inner classes -------------------------------------------------




More information about the jboss-cvs-commits mailing list