|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
javax.jms Interface TextMessage
- All Superinterfaces:
- Message
public interface TextMessage
- extends Message
TextMessage 对象用于发送包含 java.lang.String 的消息。它继承自 Message 接口并添加了文本消息正文。
此消息类型可用于传输基于文本的消息,包括那些含有 XML 内容的消息。
当客户端接收 TextMessage 时,它是只读模式。如果客户端尝试在此时写入消息,则抛出 MessageNotWriteableException。如果调用了 clearBody,现在便可以读取和写入消息。
| version |
| |
| See also | createTextMessage(), createTextMessage(String), javax.jms.BytesMessage, javax.jms.MapMessage, javax.jms.Message, javax.jms.ObjectMessage, javax.jms.StreamMessage, java.lang.String |
A TextMessage object is used to send a message containing a
java.lang.String.
It inherits from the Message interface and adds a text message
body.
This message type can be used to transport text-based messages, including those with XML content.
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 now be both read from and written to.
- Version:
- 1.1 - February 2, 2002
- Author:
- Mark Hapner, Rich Burridge, Kate Stout
- See Also:
Session.createTextMessage(),Session.createTextMessage(String),BytesMessage,MapMessage,Message,ObjectMessage,StreamMessage,String
| Field Summary |
|---|
| Fields inherited from interface javax.jms.Message |
|---|
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
| Method Summary | |
|---|---|
String |
getText()
Gets the string containing this message's data. |
void |
setText(String string)
Sets the string containing this message's data. |
| Method Detail |
|---|
public void
setText(String string) throws JMSException
设置包含此消息数据的字符串。
| string |
包含消息数据的 String |
| Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法设置文本。 |
| Throws | MessageNotWriteableException: 如果消息是只读模式。 |
setText
void setText(String string) throws JMSException
- Sets the string containing this message's data.
- Parameters:
string- theStringcontaining the message's data- Throws:
JMSException- if the JMS provider fails to set the text due to some internal error.MessageNotWriteableException- if the message is in read-only mode.
public String
getText() throws JMSException
获取包含此消息数据的字符串。默认值为 null。
| return |
包含消息数据的 String |
| Throws | JMSException: 如果 JMS 提供者由于某个内部错误无法获取文本。 |
getText
String getText() throws JMSException
- Gets the string containing this message's data. The default
value is null.
- Returns:
- the
Stringcontaining the message's data - Throws:
JMSException- if the JMS provider fails to get the text due to some internal error.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!