com.ibm.jms

Class JMSObjectMessage

  1. java.lang.Object
  2. extended bycom.ibm.jms.JMSMessage
  3. extended bycom.ibm.jms.JMSObjectMessage
All implemented interfaces:
java.io.Serializable, javax.jms.Message, javax.jms.ObjectMessage

  1. public class JMSObjectMessage
  2. extends JMSMessage
  3. implements javax.jms.ObjectMessage
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.

To create an object message please call Session.createObjectMessage(). Do not call the default constructor.

See Also:
Serialized Form

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
sccsid
The SCCSID which is expanded when the file is extracted from CMVC
Fields inherited from class com.ibm.jms.JMSMessage
CHARSET_PROPERTY, ENCODING_PROPERTY
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE

Constructor Summary

Constructor and Description
JMSObjectMessage()
Deprecated.

Method Summary

Modifier and Type Method and Description
  1. java.io.Serializable
getObject()
Get the serializable Object containing this message's data.
  1. void
setObject(java.io.Serializable object)
Sets the serializable Object containing this message's data.
Methods inherited from class com.ibm.jms.JMSMessage
acknowledge, clearBody, 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, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.jms.Message
acknowledge, clearBody, 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

Field Detail

sccsid

  1. public static final java.lang.String sccsid
The SCCSID which is expanded when the file is extracted from CMVC
See Also:

Constructor Detail

JMSObjectMessage

  1. @Deprecated
  2. public JMSObjectMessage( )
Deprecated.

To create an object message please call Session.createObjectMessage().

Do not call this default constructor.

Method Detail

getObject

  1. public java.io.Serializable getObject( )
  2. throws javax.jms.JMSException
Get the serializable Object containing this message's data. The default value is null.
Specified by:
getObject in interface javax.jms.ObjectMessage
Returns:
the serializable Object containing this message's data
Throws:
javax.jms.JMSException - if an internal error occurs

setObject

  1. public void setObject(java.io.Serializable object)
  2. throws javax.jms.JMSException
Sets the serializable Object containing this message's data.
Specified by:
setObject in interface javax.jms.ObjectMessage
Parameters:
object - the message's data
Throws:
javax.jms.JMSException - if the message is not writable or if some internal error occurs
javax.jms.MessageFormatException - if object serialization fails