public final class ObjectMessage extends Message implements jakarta.jms.ObjectMessage
jakarta.jms.ObjectMessage interface.
An ObjectMessage object is used to send a message that contains a unique serializable Java object. It inherits from the Message interface and adds a body containing a single reference to an object.
When a client receives an ObjectMessage, 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.
| Constructor and Description |
|---|
ObjectMessage()
Instantiates a bright new
ObjectMessage. |
ObjectMessage(Session session,
org.objectweb.joram.shared.messages.Message momMsg)
Instantiates an
ObjectMessage wrapping a
consumed MOM message containing an object. |
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
getEffectiveBody(Class<T> c)
Get message body
|
Serializable |
getObject()
API method.
|
void |
setObject(Serializable object)
API method.
|
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, wrapMomMessageclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacknowledge, 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, setStringPropertyObjectMessage()
ObjectMessage.ObjectMessage(Session session, org.objectweb.joram.shared.messages.Message momMsg)
ObjectMessage wrapping a
consumed MOM message containing an object.session - The consuming session.momMsg - The MOM message to wrap.public void setObject(Serializable object) throws jakarta.jms.JMSException
setObject in interface jakarta.jms.ObjectMessageobject - the message's data.jakarta.jms.MessageNotWriteableException - When trying to set an object if
the message body is read-only.jakarta.jms.MessageFormatException - If object serialization fails.jakarta.jms.JMSExceptionpublic Serializable getObject() throws jakarta.jms.MessageFormatException
getObject in interface jakarta.jms.ObjectMessagejakarta.jms.MessageFormatException - In case of a problem when getting the
body.protected <T> T getEffectiveBody(Class<T> c) throws jakarta.jms.JMSException
MessagegetEffectiveBody in class Messagec - The type to which the message body will be assigned.jakarta.jms.JMSException - if the JMS provider fails to return a value due to some internal error.Copyright © 2023 ScalAgent D.T.. All rights reserved.