JMSTextMessage

public class JMSTextMessage
extends JMSMessage
implements TextMessage
java.lang.Object
   |
   +----com.ibm.jms.JMSMessage
           |
           +----com.ibm.jms.JMSTextMessage
          

A TextMessage is used to send a message containing a java.lang.String. It inherits from JMSMessage and adds a text body.

When a client receives a TextMessage, it is in read-only mode. If a client attempts to write to the message at this point, a MessageNotWriteableException is thrown. If clearBody() is called, the message can then be both read from and written to.

Methods

clearBody

public void clearBody() throws JMSException;

Clears out the message body. No other part of the message is changed.

Exceptions

getText

public String getText() throws JMSException;

Gets the String containing this message's data. The default value is null.

Returns
Exceptions

setText

public void setText(String messageText) throws JMSException;

Sets the String containing this message's data.

Parameters
Exceptions

toString

public String toString();

Returns a String containing a formatted version of the Message.

Returns