From ceb6f31cdde10e52f0caa4c4bdd396700a262dee Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Tue, 23 Jan 2007 14:23:25 +0000 Subject: Modified Content to make get methods to be non-consuming through use of light-weight copys. Shortened name of Content type enum. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@499030 13f79535-47bb-0310-9956-ffa450edef68 --- java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java | 4 ++-- .../src/main/java/org/apache/qpid/server/queue/AMQMessage.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'java/broker/src') diff --git a/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java b/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java index 47288884f3..7c161522ca 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java +++ b/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java @@ -193,10 +193,10 @@ public class AMQChannel message.setPublisher(publisher); Content body = transferBody.getBody(); switch (body.getContentType()) { - case CONTENT_TYPE_INLINE: + case INLINE_T: route(message); break; - case CONTENT_TYPE_REFERENCE: + case REF_T: getMessages(body.getContentAsByteArray()).add(message); break; } diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java index 44994fe161..9a228b48d4 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java @@ -139,7 +139,7 @@ public class AMQMessage int size = _transferBody.getBodySize(); Content body = _transferBody.getBody(); switch (body.getContentType()) { - case CONTENT_TYPE_INLINE: + case INLINE_T: size -= _transferBody.getBody().getEncodedSize(); break; } @@ -149,9 +149,9 @@ public class AMQMessage public long getBodySize() { Content body = _transferBody.getBody(); switch (body.getContentType()) { - case CONTENT_TYPE_INLINE: + case INLINE_T: return _transferBody.getBody().getContent().limit(); - case CONTENT_TYPE_REFERENCE: + case REF_T: return getReferenceSize(); default: throw new IllegalStateException("unrecognized type: " + body.getContentType()); -- cgit v1.2.1