You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2007/01/17 21:27:18 UTC
svn commit: r497161 -
/incubator/qpid/branches/qpid.0-9/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java
Author: rajith
Date: Wed Jan 17 12:27:17 2007
New Revision: 497161
URL: http://svn.apache.org/viewvc?view=rev&rev=497161
Log:
This contains modifications to create messages using the new MessageHeaders and Content classes
Modified:
incubator/qpid/branches/qpid.0-9/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java
Modified: incubator/qpid/branches/qpid.0-9/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java?view=diff&rev=497161&r1=497160&r2=497161
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java Wed Jan 17 12:27:17 2007
@@ -20,14 +20,13 @@
*/
package org.apache.qpid.client.message;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.ContentHeaderBody;
-
-import javax.jms.JMSException;
import java.util.HashMap;
import java.util.Map;
-import java.util.List;
+
+import javax.jms.JMSException;
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.Content;
public class MessageFactoryRegistry
{
@@ -59,18 +58,17 @@
* @throws JMSException
*/
public AbstractJMSMessage createMessage(long deliveryTag, boolean redelivered,
- ContentHeaderBody contentHeader,
- List bodies) throws AMQException, JMSException
+ MessageHeaders contentHeader,
+ Content body) throws AMQException, JMSException
{
- BasicContentHeaderProperties properties = (BasicContentHeaderProperties) contentHeader.properties;
- MessageFactory mf = (MessageFactory) _mimeToFactoryMap.get(properties.getContentType());
+ MessageFactory mf = (MessageFactory) _mimeToFactoryMap.get(contentHeader.getContentType());
if (mf == null)
{
- throw new AMQException("Unsupport MIME type of " + properties.getContentType());
+ throw new AMQException("Unsupport MIME type of " + contentHeader.getContentType());
}
else
{
- return mf.createMessage(deliveryTag, redelivered, contentHeader, bodies);
+ return mf.createMessage(deliveryTag, redelivered, contentHeader, body);
}
}