org.huihoo.jfox.ms.jms.message
Class ObjectMessageImpl

java.lang.Object
  extended byorg.huihoo.jfox.ms.jms.message.MessageImpl
      extended byorg.huihoo.jfox.ms.jms.message.ObjectMessageImpl
All Implemented Interfaces:
javax.jms.Message, javax.jms.ObjectMessage, java.io.Serializable

public class ObjectMessageImpl
extends MessageImpl
implements javax.jms.ObjectMessage, java.io.Serializable

This class provides an implementation of the JMS ObjectMessage. An ObjectMessage object is used to send a message that contains a serializable object in the Java programming language ("Java object"). It inherits from the Message interface and adds a body containing a single reference to an object. Only Serializable Java objects can be used.

Version:
Revision: 1.1 Date: 2002-12-08 11:25:10
Author:
Peter.Cheng
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Constructor Summary
ObjectMessageImpl()
          Default constructor
 
Method Summary
 void clearBody()
          Sets the object reference in the message to null and toggles the message to read/write state.
 java.io.Serializable getObject()
          Gets the serializable object containing this message's data.
 void setObject(java.io.Serializable object)
          Sets the serializable object containing this message's data.
 
Methods inherited from class org.huihoo.jfox.ms.jms.message.MessageImpl
acknowledge, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, isBodyModifiable, isPropertiesModifiable, propertyExists, setBodyModifiable, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setPropertiesModifiable, 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, 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

ObjectMessageImpl

public ObjectMessageImpl()
Default constructor

Method Detail

setObject

public void setObject(java.io.Serializable object)
               throws javax.jms.JMSException
Sets the serializable object containing this message's data. It is important to note that an ObjectMessage contains a snapshot of the object at the time setObject() is called; subsequent modifications of the object will 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 the JMS provider fails to set the object due to some internal error.
javax.jms.MessageFormatException - if object serialization fails.
javax.jms.MessageNotWriteableException - if the message is in read-only mode.
See Also:
ObjectMessage.setObject(Serializable)

getObject

public java.io.Serializable getObject()
                               throws javax.jms.JMSException
Gets 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 the JMS provider fails to get the object due to some internal error.
javax.jms.MessageFormatException - if object deserialization fails.
See Also:
ObjectMessage.getObject()

clearBody

public void clearBody()
               throws javax.jms.JMSException
Sets the object reference in the message to null and toggles the message to read/write state.

Specified by:
clearBody in interface javax.jms.Message
Overrides:
clearBody in class MessageImpl
Throws:
javax.jms.JMSException


Copyright © 2002-2003 Open Enterprise Foundation. All Rights Reserved.