|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.jms.JMSMessage | +--com.ibm.jms.JMSObjectMessage
An ObjectMessage is used to send a message that contains a serializable
Java Object. It inherits from JMSMessage
and adds a body containing a single Serializable Java Object.
If more than one Java Object must be sent, one of the Collection classes can be used.
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 then be both read from and written to.
Field Summary |
Fields inherited from interface javax.jms.Message |
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
Method Summary | |
void |
clearBody()
Clears the message body. |
java.io.Serializable |
getObject()
Get the serializable Object containing this message's data. |
void |
setObject(java.io.Serializable object)
Sets the serializable Object containing this message's data. |
java.lang.String |
toString()
This method returns a String containing a formatted version of the Message. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.jms.Message |
acknowledge, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty |
Method Detail |
public void clearBody() throws javax.jms.JMSException
clearBody
in interface javax.jms.Message
clearBody
in class JMSMessage
javax.jms.JMSException
- if the action fails to due to some internal JMS error.public java.io.Serializable getObject() throws javax.jms.JMSException
getObject
in interface javax.jms.ObjectMessage
javax.jms.JMSException
- with reason
MQJMS_E_DESERIALISE_FAILED
java.io.InvalidClassException
- if something is wrong with a class used by serialization.public void setObject(java.io.Serializable object) throws javax.jms.JMSException
setObject
in interface javax.jms.ObjectMessage
object
- the message's data
javax.jms.JMSException
- with reasons
javax.jms.MessageFormatException
- if object serialization failspublic java.lang.String toString()
toString
in class JMSMessage
|
(c) Copyright IBM Corp. 2005. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |