01: package dalma.endpoints.jms.impl;
02:
03: import javax.jms.JMSException;
04: import javax.jms.TextMessage;
05: import java.io.Serializable;
06:
07: /**
08: * {@link Serializable} {@link TextMessage}.
09: *
10: * @author Kohsuke Kawaguchi
11: */
12: public class TextMessageImpl extends MessageImpl<TextMessage> implements
13: TextMessage {
14: private String text;
15:
16: public TextMessageImpl() {
17: }
18:
19: public TextMessageImpl wrap(TextMessage s) throws JMSException {
20: super .wrap(s);
21: this .text = s.getText();
22: return this ;
23: }
24:
25: public void writeTo(TextMessage d) throws JMSException {
26: super .writeTo(d);
27: d.setText(text);
28: }
29:
30: public void clearBody() throws JMSException {
31: text = null;
32: }
33:
34: public void setText(String string) throws JMSException {
35: this .text = string;
36: }
37:
38: public String getText() throws JMSException {
39: return text;
40: }
41:
42: private static final long serialVersionUID = 1L;
43: }
|