Package org.objectweb.joram.client.jms
Class TextMessage
- java.lang.Object
-
- org.objectweb.joram.client.jms.Message
-
- org.objectweb.joram.client.jms.TextMessage
-
- All Implemented Interfaces:
Message,TextMessage
public final class TextMessage extends Message implements TextMessage
Implements thejavax.jms.TextMessageinterface.
-
-
Field Summary
-
Fields inherited from class org.objectweb.joram.client.jms.Message
jmsDest, logger, momMsg, propertiesRO, RObody, session
-
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_DELAY, DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
-
-
Constructor Summary
Constructors Constructor Description TextMessage()Instantiates a bright newTextMessage.TextMessage(Session session, org.objectweb.joram.shared.messages.Message momMsg)Instantiates aTextMessagewrapping a consumed MOM message containing a text.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> TgetEffectiveBody(Class<T> c)Get message bodyStringgetText()API method.voidsetText(String text)API method.-
Methods inherited from class org.objectweb.joram.client.jms.Message
acknowledge, clearBody, clearProperties, convertJMSMessage, dumpBody, dumpBody, getBody, getBooleanProperty, getByteProperty, getCompressedMinSize, getCompressionLevel, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDeliveryTime, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getMomMsg, getObjectProperty, getProperties, getPropertyNames, getRawBody, getShortProperty, getStringProperty, isBodyAssignableTo, isCompressed, prepare, prepareJMSMessage, propertyExists, resetPropertiesRO, setBooleanProperty, setByteProperty, setCompressedMinSize, setCompressionLevel, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDeliveryTime, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty, toString, toString, wrapMomMessage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.jms.Message
acknowledge, clearBody, clearProperties, getBody, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDeliveryTime, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, isBodyAssignableTo, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDeliveryTime, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty
-
-
-
-
Constructor Detail
-
TextMessage
TextMessage()
Instantiates a bright newTextMessage.
-
TextMessage
TextMessage(Session session, org.objectweb.joram.shared.messages.Message momMsg)
Instantiates aTextMessagewrapping a consumed MOM message containing a text.- Parameters:
session- The consuming session.momMsg- The MOM message to wrap.
-
-
Method Detail
-
setText
public void setText(String text) throws MessageNotWriteableException, MessageFormatException
API method. Sets a String as the body of the message.- Specified by:
setTextin interfaceTextMessage- Parameters:
text- the String containing the message's data.- Throws:
MessageNotWriteableException- When trying to set the text if the message body is read-only.MessageFormatException- If the text serialization fails.
-
getText
public String getText() throws JMSException
API method. Returns the text body of the message, null if none.- Specified by:
getTextin interfaceTextMessage- Returns:
- the String containing this message's data.
- Throws:
JMSException- In case of a problem when getting the body.
-
getEffectiveBody
protected <T> T getEffectiveBody(Class<T> c) throws JMSException
Description copied from class:MessageGet message body- Overrides:
getEffectiveBodyin classMessage- Parameters:
c- The type to which the message body will be assigned.- Returns:
- message body
- Throws:
JMSException- if the JMS provider fails to return a value due to some internal error.
-
-