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
DEFAULT_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, 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, propertyExists, resetMessageID, saveToOutputStream, setBooleanProperty, setByteProperty, setClientAcknowledge, setDoubleProperty, setEnable1xPrefixes, setFloatProperty, setIndividualAcknowledge, setInputStream, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDeliveryTime, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setOutputStream, setShortProperty, setStringProperty, toString, waitCompletionOnStream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
acknowledge, 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, setStringProperty
public static final byte TYPE
public ActiveMQTextMessage(ClientSession session)
public ActiveMQTextMessage(ClientMessage message, ClientSession session)
public ActiveMQTextMessage(TextMessage foreign, ClientSession session) throws JMSException
JMSException
public byte getType()
getType
in class ActiveMQMessage
public void setText(String text) throws JMSException
TextMessage
setText
in interface TextMessage
text
- the String
containing the message's dataJMSException
- 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()
TextMessage
getText
in interface TextMessage
String
containing the message's datapublic void clearBody() throws JMSException
Message
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 Message
clearBody
in class ActiveMQMessage
JMSException
- if the JMS provider fails to clear the message
body due to some internal error.public void doBeforeReceive() throws ActiveMQException
doBeforeReceive
in class ActiveMQMessage
ActiveMQException
protected <T> T getBodyInternal(Class<T> c)
getBodyInternal
in class ActiveMQMessage
public boolean isBodyAssignableTo(Class c)
Message
getBody
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 Message
isBodyAssignableTo
in class ActiveMQMessage
c
- 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 © 2018 JBoss by Red Hat. All rights reserved.