|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activemq.message.AbstractPacket
org.activemq.message.ActiveMQMessage
org.activemq.message.ActiveMQTextMessage
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.
Session.createTextMessage()
,
Session.createTextMessage(String)
,
BytesMessage
,
MapMessage
,
Message
,
ObjectMessage
,
StreamMessage
,
String
Field Summary |
Fields inherited from class org.activemq.message.AbstractPacket |
bitArray, BROKERS_VISITED_INDEX, cachedHashCode, RECEIPT_REQUIRED_INDEX |
Fields inherited from interface javax.jms.Message |
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
Constructor Summary | |
ActiveMQTextMessage()
|
Method Summary | |
void |
clearBody()
Clears out the message body. |
ActiveMQMessage |
deepCopy()
|
int |
getPacketType()
Return the type of Packet |
java.lang.String |
getText()
Gets the string containing this message's data. |
void |
readBody(java.io.DataInput dataIn)
Used to help build the body from an input stream |
void |
readText(java.io.DataInput dataIn)
read the text as UTF-8 |
void |
setText(java.lang.String string)
Sets the string containing this message's data. |
ActiveMQMessage |
shallowCopy()
|
java.lang.String |
toString()
|
void |
writeBody(java.io.DataOutput dataOut)
Used serialize the message body to an output stream |
void |
writeText(java.io.DataOutput dataOut)
dumps the text body as UTF-8 |
Methods inherited from class org.activemq.message.AbstractPacket |
addBrokerVisited, clearBrokersVisited, decrementMemoryReferenceCount, equals, getBitArray, getBrokersVisited, getBrokersVisitedAsString, getId, getMemoryUsage, getMemoryUsageReferenceCount, getPacketTypeAsString, hasVisited, incrementMemoryReferenceCount, initializeOther, isReceipt, isReceiptRequired, setBitArray, setBrokersVisitedAsString, setId, setMemoryUsage, setReceiptRequired |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, 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 |
Methods inherited from interface org.activemq.io.util.MemoryManageable |
decrementMemoryReferenceCount, getMemoryUsage, getMemoryUsageReferenceCount, incrementMemoryReferenceCount |
Constructor Detail |
public ActiveMQTextMessage()
Method Detail |
public java.lang.String toString()
toString
in class ActiveMQMessage
public int getPacketType()
getPacketType
in interface Packet
getPacketType
in class ActiveMQMessage
public ActiveMQMessage shallowCopy() throws javax.jms.JMSException
shallowCopy
in class ActiveMQMessage
javax.jms.JMSException
public ActiveMQMessage deepCopy() throws javax.jms.JMSException
deepCopy
in class ActiveMQMessage
javax.jms.JMSException
public void clearBody() throws javax.jms.JMSException
If this message body was read-only, calling this method leaves the message body in the same state as an empty body in a newly created message.
clearBody
in interface javax.jms.Message
clearBody
in class ActiveMQMessage
javax.jms.JMSException
- if the JMS provider fails to clear the message
body due to some internal error.public void setText(java.lang.String string) throws javax.jms.JMSException
setText
in interface javax.jms.TextMessage
string
- the String
containing the message's data
javax.jms.JMSException
- if the JMS provider fails to set the text due to
some internal error.
javax.jms.MessageNotWriteableException
- if the message is in read-only
mode.public java.lang.String getText() throws javax.jms.JMSException
getText
in interface javax.jms.TextMessage
String
containing the message's data
javax.jms.JMSException
public void writeBody(java.io.DataOutput dataOut) throws java.io.IOException
writeBody
in interface BodyPacket
writeBody
in class ActiveMQMessage
dataOut
-
java.io.IOException
public void readBody(java.io.DataInput dataIn) throws java.io.IOException
readBody
in interface BodyPacket
readBody
in class ActiveMQMessage
dataIn
-
java.io.IOException
public void writeText(java.io.DataOutput dataOut) throws java.io.IOException
dataOut
-
java.io.IOException
public void readText(java.io.DataInput dataIn) throws java.io.IOException
dataIn
-
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |