fix for AMQ-2003

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@718592 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2008-11-18 13:57:01 +00:00
parent 1ab2f59af7
commit da98de0459
1 changed files with 17 additions and 3 deletions

View File

@ -40,10 +40,20 @@ public class StompFrame implements Command {
private Map<String, String> headers = new HashMap<String, String>(); private Map<String, String> headers = new HashMap<String, String>();
private byte[] content = NO_DATA; 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) { public StompFrame(String command, Map<String, String> headers, byte[] data) {
this.action = command; this.action = command;
this.headers = headers; if (headers != null)
this.content = data; this.headers = headers;
if (data != null)
this.content = data;
} }
public StompFrame() { public StompFrame() {
@ -61,6 +71,10 @@ public class StompFrame implements Command {
return content; return content;
} }
public String getBody() {
return new String(content);
}
public void setContent(byte[] data) { public void setContent(byte[] data) {
this.content = data; this.content = data;
} }