Class ActiveMQTextMessage
java.lang.Object
org.apache.activemq.artemis.jms.client.ActiveMQMessage
org.apache.activemq.artemis.jms.client.ActiveMQTextMessage
- All Implemented Interfaces:
Message,TextMessage
- Direct Known Subclasses:
ActiveMQTextCompatibleMessage
ActiveMQ Artemis implementation of a JMS TextMessage.
-
Field Summary
FieldsFields inherited from class org.apache.activemq.artemis.jms.client.ActiveMQMessage
message, OLD_QUEUE_QUALIFIED_PREFIX, OLD_TEMP_QUEUE_QUALIFED_PREFIX, OLD_TEMP_TOPIC_QUALIFED_PREFIX, OLD_TOPIC_QUALIFIED_PREFIX, propertiesReadOnly, readOnly, replyToFields inherited from interface jakarta.jms.Message
DEFAULT_DELIVERY_DELAY, DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE -
Constructor Summary
ConstructorsConstructorDescriptionActiveMQTextMessage(TextMessage foreign, ClientSession session) A copy constructor for non-ActiveMQ Artemis JMS TextMessages.ActiveMQTextMessage(ClientMessage message, ClientSession session) ActiveMQTextMessage(ClientSession session) -
Method Summary
Modifier and TypeMethodDescriptionvoidClears out the message body.voidprotected <T> TgetBodyInternal(Class<T> c) getText()Gets the string containing this message's data.bytegetType()booleanFrom the specs:voidSets the string containing this message's data.Methods inherited from class org.apache.activemq.artemis.jms.client.ActiveMQMessage
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, waitCompletionOnStreamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface jakarta.jms.Message
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
-
Field Details
-
TYPE
public static final byte TYPE- See Also:
-
-
Constructor Details
-
ActiveMQTextMessage
-
ActiveMQTextMessage
-
ActiveMQTextMessage
A copy constructor for non-ActiveMQ Artemis JMS TextMessages.- Throws:
JMSException
-
-
Method Details
-
getType
public byte getType()- Overrides:
getTypein classActiveMQMessage
-
setText
Description copied from interface:TextMessageSets the string containing this message's data.- Specified by:
setTextin interfaceTextMessage- Parameters:
text- theStringcontaining the message's data- Throws:
JMSException- if the Jakarta Messaging provider fails to set the text due to some internal error.MessageNotWriteableException- if the message is in read-only mode.
-
getText
Description copied from interface:TextMessageGets the string containing this message's data. The default value is null.- Specified by:
getTextin interfaceTextMessage- Returns:
- the
Stringcontaining the message's data
-
clearBody
Description copied from interface:MessageClears out the message body. Clearing a message's body does not clear its header values or property entries.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.
- Specified by:
clearBodyin interfaceMessage- Overrides:
clearBodyin classActiveMQMessage- Throws:
JMSException- if the Jakarta Messaging provider fails to clear the message body due to some internal error.
-
doBeforeReceive
- Overrides:
doBeforeReceivein classActiveMQMessage- Throws:
ActiveMQException
-
getBodyInternal
- Overrides:
getBodyInternalin classActiveMQMessage
-
isBodyAssignableTo
Description copied from class:ActiveMQMessageFrom the specs:If the message is a
Message(but not one of its subtypes) then this method will returntrueirrespective of the value of this parameter.- Specified by:
isBodyAssignableToin interfaceMessage- Overrides:
isBodyAssignableToin classActiveMQMessage- Parameters:
c- The specified type
If the message is aTextMessagethen this method will only return true if this parameter is set toString.classor another type to which aStringis assignable.
If the message is aObjectMessagethen this method will only return true if this parameter is set tojava.io.Serializable.classor another class to which the body is assignable.
If the message is aMapMessagethen this method will only return true if this parameter is set tojava.util.Map.class(orjava.lang.Object.class).
If the message is aBytesMessagethen this this method will only return true if this parameter is set tobyte[].class(orjava.lang.Object.class).
If the message is aTextMessage,ObjectMessage,MapMessageorBytesMessageand the message has no body, then the above does not apply and this method will return true irrespective of the value of this parameter.
If the message is aMessage(but not one of its subtypes) then this method will return true irrespective of the value of this parameter.- Returns:
- whether the message body is capable of being assigned to the specified type
-