activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r718592 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java
Date Tue, 18 Nov 2008 13:57:02 GMT
Author: dejanb
Date: Tue Nov 18 05:57:01 2008
New Revision: 718592

URL: http://svn.apache.org/viewvc?rev=718592&view=rev
Log:
fix for AMQ-2003

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java?rev=718592&r1=718591&r2=718592&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java
Tue Nov 18 05:57:01 2008
@@ -40,12 +40,22 @@
     private Map<String, String> headers = new HashMap<String, String>();
     private byte[] content = NO_DATA;
 
+    public StompFrame(String command) {
+    	this(command, null, null);
+    }
+    
+    public StompFrame(String command, Map<String, String> headers) {
+    	this(command, headers, null);
+    }    
+    
     public StompFrame(String command, Map<String, String> headers, byte[] data) {
         this.action = command;
-        this.headers = headers;
-        this.content = data;
+        if (headers != null)
+        	this.headers = headers;
+        if (data != null)
+        	this.content = data;
     }
-
+    
     public StompFrame() {
     }
 
@@ -60,6 +70,10 @@
     public byte[] getContent() {
         return content;
     }
+    
+    public String getBody() {
+    	return new String(content);
+    }
 
     public void setContent(byte[] data) {
         this.content = data;



Mime
View raw message