Websphere MQ Everyplace

com.ibm.mqe.jms
Class MQeObjectMessage

java.lang.Object
  |
  +--com.ibm.mqe.jms.MQeMessage
        |
        +--com.ibm.mqe.jms.MQeObjectMessage
All Implemented Interfaces:
javax.jms.Message, javax.jms.ObjectMessage

public class MQeObjectMessage
extends MQeMessage
implements javax.jms.ObjectMessage

An ObjectMessage is used to send a message that contains a serializable Java object. It inherits from MQeMessage and adds a body containing a single Java reference. Only Serializable Java objects can be used. If a collection of Java objects must be sent, one of the collection classes provided in JDK 1.2 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 MQeMessage.clearBody() is called, the message can now be both read from and written to.

See Also:
BytesMessage, MapMessage, Message, ObjectMessage, StreamMessage, TextMessage

Field Summary
 
Fields inherited from class com.ibm.mqe.jms.MQeMessage
DEFAULT_DELIVERY_MODE
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Constructor Summary
MQeObjectMessage()
           
 
Method Summary
 java.io.Serializable getObject()
          Get the serializable object contained in the message body.
 void setObject(java.io.Serializable object)
          Set the serializable object containing this message's data.
 
Methods inherited from class com.ibm.mqe.jms.MQeMessage
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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
 

Constructor Detail

MQeObjectMessage

public MQeObjectMessage()
Method Detail

setObject

public void setObject(java.io.Serializable object)
               throws javax.jms.JMSException
Set the serializable object containing this message's data. The ObjectMessage contains a snapshot of the object at the time this method is called, and subsequent changes to the object have no effect on the ObjectMessage body.

Specified by:
setObject in interface javax.jms.ObjectMessage
Parameters:
object - the message's data
Throws:
javax.jms.JMSException - if JMS fails to set the message body due to some internal JMS error.
javax.jms.MessageFormatException - if object serialization fails
javax.jms.MessageNotWriteableException - if message in read-only mode.

getObject

public java.io.Serializable getObject()
                               throws javax.jms.JMSException
Get the serializable object contained in the message body. If no object has been set a null will be returned.

Specified by:
getObject in interface javax.jms.ObjectMessage
Returns:
the serializable object containing this message's data
Throws:
javax.jms.JMSException - if JMS fails to get the object due to some internal JMS error.
javax.jms.MessageFormatException - if object deserialization fails

Websphere MQ Everyplace