From bd83128345a1345d235363e300be2f4623c5c297 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Wed, 17 Jan 2007 20:27:17 +0000 Subject: This contains modifications to create messages using the new MessageHeaders and Content classes git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@497161 13f79535-47bb-0310-9956-ffa450edef68 --- .../client/message/MessageFactoryRegistry.java | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'java') diff --git a/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java b/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java index 348988f06d..108f041f78 100644 --- a/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java +++ b/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java @@ -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 @@ public class MessageFactoryRegistry * @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); } } -- cgit v1.2.1