1 24 package org.objectweb.joram.client.jms; 25 26 import org.objectweb.joram.shared.excepts.*; 27 28 import javax.jms.JMSException ; 29 import javax.jms.MessageNotWriteableException ; 30 31 34 public final class TextMessage extends Message implements javax.jms.TextMessage { 35 38 TextMessage() { 39 super(); 40 momMsg.type = momMsg.TEXT; 41 } 42 43 50 TextMessage(Session session, 51 org.objectweb.joram.shared.messages.Message momMsg) { 52 super(session, momMsg); 53 } 54 55 62 public void setText(String text) throws MessageNotWriteableException { 63 if (RObody) 64 throw new MessageNotWriteableException ("Can't set a text as the message body is read-only."); 65 66 momMsg.setText(text); 67 } 68 69 75 public String getText() throws JMSException { 76 return momMsg.getText(); 77 } 78 } 79 | Popular Tags |