public class ActiveMQTextMessage extends ActiveMQMessage implements TextMessage
| Modifier and Type | Field and Description |
|---|---|
static byte |
TYPE |
message, OLD_QUEUE_QUALIFIED_PREFIX, OLD_TEMP_QUEUE_QUALIFED_PREFIX, OLD_TEMP_TOPIC_QUALIFED_PREFIX, OLD_TOPIC_QUALIFIED_PREFIX, propertiesReadOnly, readOnly, replyToDEFAULT_DELIVERY_DELAY, DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE| Constructor and Description |
|---|
ActiveMQTextMessage(ClientMessage message,
ClientSession session) |
ActiveMQTextMessage(ClientSession session) |
ActiveMQTextMessage(TextMessage foreign,
ClientSession session)
A copy constructor for non-ActiveMQ Artemis JMS TextMessages.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearBody()
Clears out the message body.
|
void |
doBeforeReceive() |
protected <T> T |
getBodyInternal(Class<T> c) |
String |
getText()
Gets the string containing this message's data.
|
byte |
getType() |
boolean |
isBodyAssignableTo(Class c)
Returns whether the message body is capable of being assigned to the specified type.
|
void |
setText(String text)
Sets the string containing this message's data.
|
acknowledge, checkBuffer, checkPrefix, checkPrefixStr, checkRead, checkWrite, clearProperties, coreCompositeTypeToJMSCompositeType, coreMaptoJMSMap, createMessage, createMessage, doBeforeSend, getBody, getBooleanProperty, getByteProperty, getCoreMessage, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDeliveryTime, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, hasNoBody, prefixOf, propertyExists, resetMessageID, saveToOutputStream, setBooleanProperty, setByteProperty, setClientAcknowledge, setDoubleProperty, setFloatProperty, setIndividualAcknowledge, setInputStream, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDeliveryTime, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setOutputStream, setShortProperty, setStringProperty, toString, waitCompletionOnStreamclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacknowledge, clearProperties, getBody, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDeliveryTime, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDeliveryTime, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringPropertypublic static final byte TYPE
public ActiveMQTextMessage(ClientSession session)
public ActiveMQTextMessage(ClientMessage message, ClientSession session)
public ActiveMQTextMessage(TextMessage foreign, ClientSession session) throws JMSException
JMSExceptionpublic byte getType()
getType in class ActiveMQMessagepublic void setText(String text) throws JMSException
TextMessagesetText in interface TextMessagetext - the String containing the message's dataJMSException - if the Jakarta Messaging provider fails to set the text due to some internal error.MessageNotWriteableException - if the message is in read-only mode.public String getText()
TextMessagegetText in interface TextMessageString containing the message's datapublic void clearBody()
throws JMSException
MessageIf 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 MessageclearBody in class ActiveMQMessageJMSException - if the Jakarta Messaging provider fails to clear the message body due to some internal error.public void doBeforeReceive()
throws ActiveMQException
doBeforeReceive in class ActiveMQMessageActiveMQExceptionprotected <T> T getBodyInternal(Class<T> c)
getBodyInternal in class ActiveMQMessagepublic boolean isBodyAssignableTo(Class c)
MessagegetBody on the same message with the same type argument would not throw a
MessageFormatException.
If the message is a StreamMessage then false is always returned. If the message is a ObjectMessage
and object deserialization fails then false is returned. If the message has no body then any type may be specified
and true is returned.
isBodyAssignableTo in interface MessageisBodyAssignableTo in class ActiveMQMessagec - The specified type TextMessage then this method will only return true if this parameter is set to
String.class or another type to which a String is assignable. ObjectMessage then this method will only return true if this parameter is set to
java.io.Serializable.class or another class to which the body is assignable. MapMessage then this method will only return true if this parameter is set to
java.util.Map.class (or java.lang.Object.class). BytesMessage then this this method will only return true if this parameter is set to
byte[].class (or java.lang.Object.class). TextMessage, ObjectMessage, MapMessage or BytesMessage and the
message has no body, then the above does not apply and this method will return true irrespective of the value of this
parameter.Message (but not one of its subtypes) then this method will return true irrespective of
the value of this parameter.Copyright © 2021 JBoss by Red Hat. All rights reserved.