|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Field Summary |
Fields inherited from interface javax.jms.Message |
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
Method Summary | |
void |
clearBody()
Clears out the message body. |
java.lang.String |
getText()
Gets the String containing this message's data. |
void |
setText(java.lang.String messageText)
Sets the String containing this message's data. |
java.lang.String |
toString()
Returns a String containing a formatted version of the Message. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.jms.Message |
acknowledge, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty |
Method Detail |
public void clearBody() throws javax.jms.JMSException
clearBody
in interface javax.jms.Message
clearBody
in class JMSMessage
javax.jms.JMSException
- if an internal error occurspublic java.lang.String getText() throws javax.jms.JMSException
getText
in interface javax.jms.TextMessage
javax.jms.JMSException
- IllegalStateException with reason
MQJMS_E_BAD_CCSID
.public void setText(java.lang.String messageText) throws javax.jms.JMSException
setText
in interface javax.jms.TextMessage
messageText
- the String containing the message's data
javax.jms.JMSException
- if an internal error occurs.
javax.jms.MessageNotWriteableException
- if the message is in read-only mode.public java.lang.String toString()
toString
in class JMSMessage
|
(c) Copyright IBM Corp. 2005. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |