JMSObjectMessage

public class JMSObjectMessage
extends JMSMessage
implements ObjectMessage
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.

Methods

clearBody

public void clearBody() throws JMSException;

Clears the message body. No other part of the message is changed.

Exceptions

getObject

public Serializable getObject() throws JMSException;

Get the Serializable Object containing this message's data. The default value is null.

Returns
Exceptions

setObject

public void setObject(Serializable object) throws JMSException;

Sets the Serializable object containing this message's data.

Parameters
Exceptions

toString

public String toString();

This method returns a String containing a formatted version of the Message.

Returns