activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1412180 - /activemq/trunk/activemq-client/src/main/java/org/apache/activemq/command/Message.java
Date Wed, 21 Nov 2012 16:32:08 GMT
Author: tabish
Date: Wed Nov 21 16:32:07 2012
New Revision: 1412180

URL: http://svn.apache.org/viewvc?rev=1412180&view=rev
Log:
Fix StompSslAuthtest failure caused by https://issues.apache.org/jira/browse/AMQ-4180

Modified:
    activemq/trunk/activemq-client/src/main/java/org/apache/activemq/command/Message.java

Modified: activemq/trunk/activemq-client/src/main/java/org/apache/activemq/command/Message.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/command/Message.java?rev=1412180&r1=1412179&r2=1412180&view=diff
==============================================================================
--- activemq/trunk/activemq-client/src/main/java/org/apache/activemq/command/Message.java
(original)
+++ activemq/trunk/activemq-client/src/main/java/org/apache/activemq/command/Message.java
Wed Nov 21 16:32:07 2012
@@ -36,6 +36,7 @@ import org.apache.activemq.util.ByteArra
 import org.apache.activemq.util.ByteSequence;
 import org.apache.activemq.util.MarshallingSupport;
 import org.apache.activemq.wireformat.WireFormat;
+import org.fusesource.hawtbuf.UTF8Buffer;
 
 /**
  * Represents an ActiveMQ message
@@ -167,7 +168,12 @@ public abstract class Message extends Ba
             }
             properties = unmarsallProperties(marshalledProperties);
         }
-        return properties.get(name);
+        Object result = properties.get(name);
+        if (result instanceof UTF8Buffer) {
+            result = result.toString();
+        }
+
+        return result;
     }
 
     @SuppressWarnings("unchecked")
@@ -211,7 +217,8 @@ public abstract class Message extends Ba
         return MarshallingSupport.unmarshalPrimitiveMap(new DataInputStream(new ByteArrayInputStream(marshalledProperties)));
     }
 
-    public void beforeMarshall(WireFormat wireFormat) throws IOException {
+    @Override
+	public void beforeMarshall(WireFormat wireFormat) throws IOException {
         // Need to marshal the properties.
         if (marshalledProperties == null && properties != null) {
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -222,13 +229,16 @@ public abstract class Message extends Ba
         }
     }
 
-    public void afterMarshall(WireFormat wireFormat) throws IOException {
+    @Override
+	public void afterMarshall(WireFormat wireFormat) throws IOException {
     }
 
-    public void beforeUnmarshall(WireFormat wireFormat) throws IOException {
+    @Override
+	public void beforeUnmarshall(WireFormat wireFormat) throws IOException {
     }
 
-    public void afterUnmarshall(WireFormat wireFormat) throws IOException {
+    @Override
+	public void afterUnmarshall(WireFormat wireFormat) throws IOException {
     }
 
     // /////////////////////////////////////////////////////////////////
@@ -288,7 +298,8 @@ public abstract class Message extends Ba
     /**
      * @openwire:property version=1
      */
-    public MessageId getMessageId() {
+    @Override
+	public MessageId getMessageId() {
         return messageId;
     }
 
@@ -310,7 +321,8 @@ public abstract class Message extends Ba
     /**
      * @openwire:property version=1
      */
-    public String getGroupID() {
+    @Override
+	public String getGroupID() {
         return groupID;
     }
 
@@ -321,7 +333,8 @@ public abstract class Message extends Ba
     /**
      * @openwire:property version=1
      */
-    public int getGroupSequence() {
+    @Override
+	public int getGroupSequence() {
         return groupSequence;
     }
 
@@ -343,7 +356,8 @@ public abstract class Message extends Ba
     /**
      * @openwire:property version=1
      */
-    public boolean isPersistent() {
+    @Override
+	public boolean isPersistent() {
         return persistent;
     }
 
@@ -354,7 +368,8 @@ public abstract class Message extends Ba
     /**
      * @openwire:property version=1
      */
-    public long getExpiration() {
+    @Override
+	public long getExpiration() {
         return expiration;
     }
 
@@ -454,7 +469,8 @@ public abstract class Message extends Ba
      *
      * @openwire:property version=1 cache=true
      */
-    public ConsumerId getTargetConsumerId() {
+    @Override
+	public ConsumerId getTargetConsumerId() {
         return targetConsumerId;
     }
 
@@ -462,12 +478,14 @@ public abstract class Message extends Ba
         this.targetConsumerId = targetConsumerId;
     }
 
-    public boolean isExpired() {
+    @Override
+	public boolean isExpired() {
         long expireTime = getExpiration();
         return expireTime > 0 && System.currentTimeMillis() > expireTime;
     }
 
-    public boolean isAdvisory() {
+    @Override
+	public boolean isAdvisory() {
         return type != null && type.equals(AdvisorySupport.ADIVSORY_MESSAGE_TYPE);
     }
 
@@ -498,14 +516,16 @@ public abstract class Message extends Ba
         }
     }
 
-    public void incrementRedeliveryCounter() {
+    @Override
+	public void incrementRedeliveryCounter() {
         redeliveryCounter++;
     }
 
     /**
      * @openwire:property version=1
      */
-    public int getRedeliveryCounter() {
+    @Override
+	public int getRedeliveryCounter() {
         return redeliveryCounter;
     }
 
@@ -580,15 +600,18 @@ public abstract class Message extends Ba
         this.userID = jmsxUserID;
     }
 
-    public int getReferenceCount() {
+    @Override
+	public int getReferenceCount() {
         return referenceCount;
     }
 
-    public Message getMessageHardRef() {
+    @Override
+	public Message getMessageHardRef() {
         return this;
     }
 
-    public Message getMessage() {
+    @Override
+	public Message getMessage() {
         return this;
     }
 
@@ -599,7 +622,8 @@ public abstract class Message extends Ba
         }
     }
 
-    public MessageDestination getRegionDestination() {
+    @Override
+	public MessageDestination getRegionDestination() {
         return regionDestination;
     }
 
@@ -616,7 +640,8 @@ public abstract class Message extends Ba
         return true;
     }
 
-    public int incrementReferenceCount() {
+    @Override
+	public int incrementReferenceCount() {
         int rc;
         int size;
         synchronized (this) {
@@ -634,7 +659,8 @@ public abstract class Message extends Ba
         return rc;
     }
 
-    public int decrementReferenceCount() {
+    @Override
+	public int decrementReferenceCount() {
         int rc;
         int size;
         synchronized (this) {
@@ -653,7 +679,8 @@ public abstract class Message extends Ba
         return rc;
     }
 
-    public int getSize() {
+    @Override
+	public int getSize() {
         int minimumMessageSize = getMinimumMessageSize();
         if (size < minimumMessageSize || size == 0) {
             size = minimumMessageSize;
@@ -748,7 +775,8 @@ public abstract class Message extends Ba
         this.brokerOutTime = brokerOutTime;
     }
 
-    public boolean isDropped() {
+    @Override
+	public boolean isDropped() {
         return false;
     }
 



Mime
View raw message