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

java.lang.Object
  extended byorg.huihoo.jfox.ms.jms.message.MessageImpl
All Implemented Interfaces:
javax.jms.Message, java.io.Serializable
Direct Known Subclasses:
BytesMessageImpl, MapMessageImpl, ObjectMessageImpl, StreamMessageImpl, TextMessageImpl

public class MessageImpl
extends java.lang.Object
implements javax.jms.Message, java.io.Serializable

This class implements the JMS Message. The message class is the underlying object for all the JMS message items. This message class provides the basic functionality for message processing including header items and properties.

Version:
Revision: 1.1 Date: 2002-12-01 22:09:17
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
MessageImpl()
           
 
Method Summary
 void acknowledge()
           
 void clearBody()
          Clears out the message body.
 void clearProperties()
          Clears a message's properties.
 boolean getBooleanProperty(java.lang.String name)
          Returns the value of the boolean property with the specified name.
 byte getByteProperty(java.lang.String name)
          Returns the value of the byte property with the specified name.
 double getDoubleProperty(java.lang.String name)
          Returns the value of the double property with the specified name.
 float getFloatProperty(java.lang.String name)
          Returns the value of the float property with the specified name.
 int getIntProperty(java.lang.String name)
          Returns the value of the int property with the specified name.
 java.lang.String getJMSCorrelationID()
          Gets the correlation ID for the message.
 byte[] getJMSCorrelationIDAsBytes()
          Gets the correlation ID as an array of bytes for the message.
 int getJMSDeliveryMode()
          Gets the DeliveryMode value specified for this message.
 javax.jms.Destination getJMSDestination()
          Gets the Destination object for this message.
 long getJMSExpiration()
          Gets the message's expiration value.
 java.lang.String getJMSMessageID()
          Gets the message ID.
 int getJMSPriority()
          Gets the message defaultPriority level.
 boolean getJMSRedelivered()
          Gets an indication of whether this message is being redelivered.
 javax.jms.Destination getJMSReplyTo()
          Gets the Destination object to which a reply to this message should be sent.
 long getJMSTimestamp()
          Gets the message timestamp.
 java.lang.String getJMSType()
          Gets the message type identifier supplied by the client when the message was sent.
 long getLongProperty(java.lang.String name)
          Returns the value of the long property with the specified name.
 java.lang.Object getObjectProperty(java.lang.String name)
          Returns the value of the Java object property with the specified name.
 java.util.Enumeration getPropertyNames()
          Returns an Enumeration of all the property names.
 short getShortProperty(java.lang.String name)
          Returns the value of the short property with the specified name.
 java.lang.String getStringProperty(java.lang.String name)
          Returns the value of the String property with the specified name.
 boolean isBodyModifiable()
          Return true if the message body is modifiable, else it is in read-only mode.
 boolean isPropertiesModifiable()
          Return true if the message properties are modifiable, else it is in read-only mode.
 boolean propertyExists(java.lang.String name)
          Indicates whether a property value exists.
 void setBodyModifiable(boolean state)
          Set the read only state of teh message body.
 void setBooleanProperty(java.lang.String name, boolean value)
          Sets a boolean property value with the specified name into the message.
 void setByteProperty(java.lang.String name, byte value)
          Sets a byte property value with the specified name into the message.
 void setDoubleProperty(java.lang.String name, double value)
          Sets a double property value with the specified name into the message.
 void setFloatProperty(java.lang.String name, float value)
          Sets a float property value with the specified name into the message.
 void setIntProperty(java.lang.String name, int value)
          Sets an int property value with the specified name into the message.
 void setJMSCorrelationID(java.lang.String correlationID)
          Sets the correlation ID for the message.
 void setJMSCorrelationIDAsBytes(byte[] correlationID)
          Sets the correlation ID as an array of bytes for the message.
 void setJMSDeliveryMode(int deliveryMode)
          Sets the DeliveryMode value for this message.
 void setJMSDestination(javax.jms.Destination destination)
          Sets the Destination object for this message.
 void setJMSExpiration(long expiration)
          Sets the message's expiration value.
 void setJMSMessageID(java.lang.String id)
          Sets the message ID.
 void setJMSPriority(int priority)
          Sets the defaultPriority level for this message.
 void setJMSRedelivered(boolean redelivered)
          Specifies whether this message is being redelivered.
 void setJMSReplyTo(javax.jms.Destination replyTo)
          Sets the Destination object to which a reply to this message should be sent.
 void setJMSTimestamp(long timestamp)
          Sets the message timestamp.
 void setJMSType(java.lang.String type)
          Sets the message type.
 void setLongProperty(java.lang.String name, long value)
          Sets a long property value with the specified name into the message.
 void setObjectProperty(java.lang.String name, java.lang.Object value)
          Sets a Java object property value with the specified name into the message.
 void setPropertiesModifiable(boolean state)
          Set the read only state of the message properties.
 void setShortProperty(java.lang.String name, short value)
          Sets a short property value with the specified name into the message.
 void setStringProperty(java.lang.String name, java.lang.String value)
          Sets a String property value with the specified name into the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageImpl

public MessageImpl()
Method Detail

getJMSMessageID

public java.lang.String getJMSMessageID()
                                 throws javax.jms.JMSException
Gets the message ID.

Specified by:
getJMSMessageID in interface javax.jms.Message
Returns:
messageID
Throws:
javax.jms.JMSException - if the JMS provider fails to get the message ID due to some internal error.
See Also:
Message.setJMSMessageID(String), MessageProducer.setDisableMessageID(boolean)

setJMSMessageID

public void setJMSMessageID(java.lang.String id)
                     throws javax.jms.JMSException
Sets the message ID.

Specified by:
setJMSMessageID in interface javax.jms.Message
Parameters:
id - the ID of the message
Throws:
javax.jms.JMSException - if the JMS provider fails to set the message ID due to some internal error.
See Also:
Message.getJMSMessageID()

getJMSTimestamp

public long getJMSTimestamp()
                     throws javax.jms.JMSException
Gets the message timestamp.

Specified by:
getJMSTimestamp in interface javax.jms.Message
Returns:
the message timestamp
Throws:
javax.jms.JMSException - if the JMS provider fails to get the timestamp due to some internal error.
See Also:
Message.setJMSTimestamp(long), MessageProducer.setDisableMessageTimestamp(boolean)

setJMSTimestamp

public void setJMSTimestamp(long timestamp)
                     throws javax.jms.JMSException
Sets the message timestamp.

JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

Specified by:
setJMSTimestamp in interface javax.jms.Message
Parameters:
timestamp - the timestamp for this message
Throws:
javax.jms.JMSException - if the JMS provider fails to set the timestamp due to some internal error.
See Also:
Message.getJMSTimestamp()

getJMSCorrelationIDAsBytes

public byte[] getJMSCorrelationIDAsBytes()
                                  throws javax.jms.JMSException
Gets the correlation ID as an array of bytes for the message.

The use of a byte[] value for JMSCorrelationID is non-portable.

Specified by:
getJMSCorrelationIDAsBytes in interface javax.jms.Message
Returns:
the correlation ID of a message as an array of bytes
Throws:
javax.jms.JMSException - if the JMS provider fails to get the correlation ID due to some internal error.
See Also:
Message.setJMSCorrelationID(String), Message.getJMSCorrelationID(), Message.setJMSCorrelationIDAsBytes(byte[])

setJMSCorrelationIDAsBytes

public void setJMSCorrelationIDAsBytes(byte[] correlationID)
                                throws javax.jms.JMSException
Sets the correlation ID as an array of bytes for the message.

The array is copied before the method returns, so future modifications to the array will not alter this message header.

The use of a byte[] value for JMSCorrelationID is non-portable.

Specified by:
setJMSCorrelationIDAsBytes in interface javax.jms.Message
Parameters:
correlationID - the correlation ID value as an array of bytes
Throws:
javax.jms.JMSException - if the JMS provider fails to set the correlation ID due to some internal error.
See Also:
Message.setJMSCorrelationID(String), Message.getJMSCorrelationID(), Message.getJMSCorrelationIDAsBytes()

getJMSCorrelationID

public java.lang.String getJMSCorrelationID()
                                     throws javax.jms.JMSException
Gets the correlation ID for the message.

This method is used to return correlation ID values that are either provider-specific message IDs or application-specific String values.

Specified by:
getJMSCorrelationID in interface javax.jms.Message
Returns:
the correlation ID of a message as a String
Throws:
javax.jms.JMSException - if the JMS provider fails to get the correlation ID due to some internal error.
See Also:
Message.setJMSCorrelationID(String), Message.getJMSCorrelationIDAsBytes(), Message.setJMSCorrelationIDAsBytes(byte[])

setJMSCorrelationID

public void setJMSCorrelationID(java.lang.String correlationID)
                         throws javax.jms.JMSException
Sets the correlation ID for the message.

Specified by:
setJMSCorrelationID in interface javax.jms.Message
Parameters:
correlationID - the message ID of a message being referred to
Throws:
javax.jms.JMSException - if the JMS provider fails to set the correlation ID due to some internal error.
See Also:
Message.getJMSCorrelationID(), Message.getJMSCorrelationIDAsBytes(), Message.setJMSCorrelationIDAsBytes(byte[])

getJMSReplyTo

public javax.jms.Destination getJMSReplyTo()
                                    throws javax.jms.JMSException
Gets the Destination object to which a reply to this message should be sent.

Specified by:
getJMSReplyTo in interface javax.jms.Message
Returns:
Destination to which to send a response to this message
Throws:
javax.jms.JMSException - if the JMS provider fails to get the JMSReplyTo destination due to some internal error.
See Also:
Message.setJMSReplyTo(Destination)

setJMSReplyTo

public void setJMSReplyTo(javax.jms.Destination replyTo)
                   throws javax.jms.JMSException
Sets the Destination object to which a reply to this message should be sent.

Specified by:
setJMSReplyTo in interface javax.jms.Message
Parameters:
replyTo - Destination to which to send a response to this message
Throws:
javax.jms.JMSException - if the JMS provider fails to set the JMSReplyTo destination due to some internal error.
See Also:
Message.getJMSReplyTo()

getJMSDestination

public javax.jms.Destination getJMSDestination()
                                        throws javax.jms.JMSException
Gets the Destination object for this message.

Specified by:
getJMSDestination in interface javax.jms.Message
Returns:
the destination of this message
Throws:
javax.jms.JMSException - if the JMS provider fails to get the destination due to some internal error.
See Also:
Message.setJMSDestination(Destination)

setJMSDestination

public void setJMSDestination(javax.jms.Destination destination)
                       throws javax.jms.JMSException
Sets the Destination object for this message.

JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

Specified by:
setJMSDestination in interface javax.jms.Message
Parameters:
destination - the destination for this message
Throws:
javax.jms.JMSException - if the JMS provider fails to set the destination due to some internal error.
See Also:
Message.getJMSDestination()

getJMSDeliveryMode

public int getJMSDeliveryMode()
                       throws javax.jms.JMSException
Gets the DeliveryMode value specified for this message.

Specified by:
getJMSDeliveryMode in interface javax.jms.Message
Returns:
the delivery mode for this message
Throws:
javax.jms.JMSException - if the JMS provider fails to get the delivery mode due to some internal error.
See Also:
Message.setJMSDeliveryMode(int), DeliveryMode

setJMSDeliveryMode

public void setJMSDeliveryMode(int deliveryMode)
                        throws javax.jms.JMSException
Sets the DeliveryMode value for this message.

JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

Specified by:
setJMSDeliveryMode in interface javax.jms.Message
Parameters:
deliveryMode - the delivery mode for this message
Throws:
javax.jms.JMSException - if the JMS provider fails to set the delivery mode due to some internal error.
See Also:
Message.getJMSDeliveryMode(), DeliveryMode

getJMSRedelivered

public boolean getJMSRedelivered()
                          throws javax.jms.JMSException
Gets an indication of whether this message is being redelivered.

If a client receives a message with the JMSRedelivered field set, it is likely, but not guaranteed, that this message was delivered earlier but that its receipt was not acknowledged at that time.

Specified by:
getJMSRedelivered in interface javax.jms.Message
Returns:
true if this message is being redelivered
Throws:
javax.jms.JMSException - if the JMS provider fails to get the redelivered state due to some internal error.
See Also:
Message.setJMSRedelivered(boolean)

setJMSRedelivered

public void setJMSRedelivered(boolean redelivered)
                       throws javax.jms.JMSException
Specifies whether this message is being redelivered.

This field is set at the time the message is delivered. This method can be used to change the value for a message that has been received.

Specified by:
setJMSRedelivered in interface javax.jms.Message
Parameters:
redelivered - an indication of whether this message is being redelivered
Throws:
javax.jms.JMSException - if the JMS provider fails to set the redelivered state due to some internal error.
See Also:
Message.getJMSRedelivered()

getJMSType

public java.lang.String getJMSType()
                            throws javax.jms.JMSException
Gets the message type identifier supplied by the client when the message was sent.

Specified by:
getJMSType in interface javax.jms.Message
Returns:
the message type
Throws:
javax.jms.JMSException - if the JMS provider fails to get the message type due to some internal error.
See Also:
Message.setJMSType(String)

setJMSType

public void setJMSType(java.lang.String type)
                throws javax.jms.JMSException
Sets the message type.

Specified by:
setJMSType in interface javax.jms.Message
Parameters:
type - the message type
Throws:
javax.jms.JMSException - if the JMS provider fails to set the message type due to some internal error.
See Also:
Message.getJMSType()

getJMSExpiration

public long getJMSExpiration()
                      throws javax.jms.JMSException
Gets the message's expiration value.

Specified by:
getJMSExpiration in interface javax.jms.Message
Returns:
the time the message expires, which is the sum of the time-to-live value specified by the client and the GMT at the time of the send
Throws:
javax.jms.JMSException - if the JMS provider fails to get the message expiration due to some internal error.
See Also:
Message.setJMSExpiration(long)

setJMSExpiration

public void setJMSExpiration(long expiration)
                      throws javax.jms.JMSException
Sets the message's expiration value.

JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

Specified by:
setJMSExpiration in interface javax.jms.Message
Parameters:
expiration - the message's expiration time
Throws:
javax.jms.JMSException - if the JMS provider fails to set the message expiration due to some internal error.
See Also:
Message.getJMSExpiration()

getJMSPriority

public int getJMSPriority()
                   throws javax.jms.JMSException
Gets the message defaultPriority level.

The JMS API defines ten levels of defaultPriority value, with 0 as the lowest defaultPriority and 9 as the highest. In addition, clients should consider priorities 0-4 as gradations of normal defaultPriority and priorities 5-9 as gradations of expedited defaultPriority.

Specified by:
getJMSPriority in interface javax.jms.Message
Returns:
the default message defaultPriority
Throws:
javax.jms.JMSException - if the JMS provider fails to get the message defaultPriority due to some internal error.
See Also:
Message.setJMSPriority(int)

setJMSPriority

public void setJMSPriority(int priority)
                    throws javax.jms.JMSException
Sets the defaultPriority level for this message.

JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.

Specified by:
setJMSPriority in interface javax.jms.Message
Parameters:
priority - the defaultPriority of this message
Throws:
javax.jms.JMSException - if the JMS provider fails to set the message defaultPriority due to some internal error.
See Also:
Message.getJMSPriority()

clearProperties

public void clearProperties()
                     throws javax.jms.JMSException
Clears a message's properties.

Specified by:
clearProperties in interface javax.jms.Message
Throws:
javax.jms.JMSException - if an error occurs while clearing the properties.
See Also:
Message.clearProperties()

propertyExists

public boolean propertyExists(java.lang.String name)
                       throws javax.jms.JMSException
Indicates whether a property value exists.

Specified by:
propertyExists in interface javax.jms.Message
Throws:
javax.jms.JMSException - if an error occurs while clearing the properties.
See Also:
Message.propertyExists(String)

getBooleanProperty

public boolean getBooleanProperty(java.lang.String name)
                           throws javax.jms.JMSException
Returns the value of the boolean property with the specified name.

Specified by:
getBooleanProperty in interface javax.jms.Message
Parameters:
name - the name of the boolean property
Returns:
the boolean property value for the specified name
Throws:
javax.jms.JMSException - if the JMS provider fails to get the property value due to some internal error.
MessageFormatException - if this type conversion is invalid.

getByteProperty

public byte getByteProperty(java.lang.String name)
                     throws javax.jms.JMSException
Returns the value of the byte property with the specified name.

Specified by:
getByteProperty in interface javax.jms.Message
Parameters:
name - the name of the byte property
Returns:
the byte property value for the specified name
Throws:
javax.jms.JMSException - if the JMS provider fails to get the property value due to some internal error.
MessageFormatException - if this type conversion is invalid.

getShortProperty

public short getShortProperty(java.lang.String name)
                       throws javax.jms.JMSException
Returns the value of the short property with the specified name.

Specified by:
getShortProperty in interface javax.jms.Message
Parameters:
name - the name of the short property
Returns:
the short property value for the specified name
Throws:
javax.jms.JMSException - if the JMS provider fails to get the property value due to some internal error.
MessageFormatException - if this type conversion is invalid.

getIntProperty

public int getIntProperty(java.lang.String name)
                   throws javax.jms.JMSException
Returns the value of the int property with the specified name.

Specified by:
getIntProperty in interface javax.jms.Message
Parameters:
name - the name of the int property
Returns:
the int property value for the specified name
Throws:
javax.jms.JMSException - if the JMS provider fails to get the property value due to some internal error.
MessageFormatException - if this type conversion is invalid.

getLongProperty

public long getLongProperty(java.lang.String name)
                     throws javax.jms.JMSException
Returns the value of the long property with the specified name.

Specified by:
getLongProperty in interface javax.jms.Message
Parameters:
name - the name of the long property
Returns:
the long property value for the specified name
Throws:
javax.jms.JMSException - if the JMS provider fails to get the property value due to some internal error.
MessageFormatException - if this type conversion is invalid.

getFloatProperty

public float getFloatProperty(java.lang.String name)
                       throws javax.jms.JMSException
Returns the value of the float property with the specified name.

Specified by:
getFloatProperty in interface javax.jms.Message
Parameters:
name - the name of the float property
Returns:
the float property value for the specified name
Throws:
javax.jms.JMSException - if the JMS provider fails to get the property value due to some internal error.
MessageFormatException - if this type conversion is invalid.

getDoubleProperty

public double getDoubleProperty(java.lang.String name)
                         throws javax.jms.JMSException
Returns the value of the double property with the specified name.

Specified by:
getDoubleProperty in interface javax.jms.Message
Parameters:
name - the name of the double property
Returns:
the double property value for the specified name
Throws:
javax.jms.JMSException - if the JMS provider fails to get the property value due to some internal error.
MessageFormatException - if this type conversion is invalid.

getStringProperty

public java.lang.String getStringProperty(java.lang.String name)
                                   throws javax.jms.JMSException
Returns the value of the String property with the specified name.

Specified by:
getStringProperty in interface javax.jms.Message
Parameters:
name - the name of the String property
Returns:
the String property value for the specified name; if there is no property by this name, a null value is returned
Throws:
javax.jms.JMSException - if the JMS provider fails to get the property value due to some internal error.
MessageFormatException - if this type conversion is invalid.

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String name)
                                   throws javax.jms.JMSException
Returns the value of the Java object property with the specified name.

This method can be used to return, in objectified format, an object that has been stored as a property in the message with the equivalent setObjectProperty method call, or its equivalent primitive set type Property method.

Specified by:
getObjectProperty in interface javax.jms.Message
Parameters:
name - the name of the Java object property
Returns:
the Java object property value with the specified name, in objectified format (for example, if the property was set as an int, an Integer is returned); if there is no property by this name, a null value is returned
Throws:
javax.jms.JMSException - if the JMS provider fails to get the property value due to some internal error.

getPropertyNames

public java.util.Enumeration getPropertyNames()
                                       throws javax.jms.JMSException
Returns an Enumeration of all the property names.

Note that JMS standard header fields are not considered properties and are not returned in this enumeration.

Specified by:
getPropertyNames in interface javax.jms.Message
Returns:
an enumeration of all the names of property values
Throws:
javax.jms.JMSException - if the JMS provider fails to get the property names due to some internal error.

setBooleanProperty

public void setBooleanProperty(java.lang.String name,
                               boolean value)
                        throws javax.jms.JMSException
Sets a boolean property value with the specified name into the message.

Specified by:
setBooleanProperty in interface javax.jms.Message
Parameters:
name - the name of the boolean property
value - the boolean property value to set
Throws:
javax.jms.JMSException - if the JMS provider fails to set the property due to some internal error.
javax.jms.MessageNotWriteableException - if properties are read-only

setByteProperty

public void setByteProperty(java.lang.String name,
                            byte value)
                     throws javax.jms.JMSException
Sets a byte property value with the specified name into the message.

Specified by:
setByteProperty in interface javax.jms.Message
Parameters:
name - the name of the byte property
value - the byte property value to set
Throws:
javax.jms.JMSException - if the JMS provider fails to set the property due to some internal error.
javax.jms.MessageNotWriteableException - if properties are read-only

setShortProperty

public void setShortProperty(java.lang.String name,
                             short value)
                      throws javax.jms.JMSException
Sets a short property value with the specified name into the message.

Specified by:
setShortProperty in interface javax.jms.Message
Parameters:
name - the name of the short property
value - the short property value to set
Throws:
javax.jms.JMSException - if the JMS provider fails to set the property due to some internal error.
javax.jms.MessageNotWriteableException - if properties are read-only

setIntProperty

public void setIntProperty(java.lang.String name,
                           int value)
                    throws javax.jms.JMSException
Sets an int property value with the specified name into the message.

Specified by:
setIntProperty in interface javax.jms.Message
Parameters:
name - the name of the int property
value - the int property value to set
Throws:
javax.jms.JMSException - if the JMS provider fails to set the property due to some internal error.
javax.jms.MessageNotWriteableException - if properties are read-only

setLongProperty

public void setLongProperty(java.lang.String name,
                            long value)
                     throws javax.jms.JMSException
Sets a long property value with the specified name into the message.

Specified by:
setLongProperty in interface javax.jms.Message
Parameters:
name - the name of the long property
value - the long property value to set
Throws:
javax.jms.JMSException - if the JMS provider fails to set the property due to some internal error.
javax.jms.MessageNotWriteableException - if properties are read-only

setFloatProperty

public void setFloatProperty(java.lang.String name,
                             float value)
                      throws javax.jms.JMSException
Sets a float property value with the specified name into the message.

Specified by:
setFloatProperty in interface javax.jms.Message
Parameters:
name - the name of the float property
value - the float property value to set
Throws:
javax.jms.JMSException - if the JMS provider fails to set the property due to some internal error.
javax.jms.MessageNotWriteableException - if properties are read-only

setDoubleProperty

public void setDoubleProperty(java.lang.String name,
                              double value)
                       throws javax.jms.JMSException
Sets a double property value with the specified name into the message.

Specified by:
setDoubleProperty in interface javax.jms.Message
Parameters:
name - the name of the double property
value - the double property value to set
Throws:
javax.jms.JMSException - if the JMS provider fails to set the property due to some internal error.
javax.jms.MessageNotWriteableException - if properties are read-only

setStringProperty

public void setStringProperty(java.lang.String name,
                              java.lang.String value)
                       throws javax.jms.JMSException
Sets a String property value with the specified name into the message.

Specified by:
setStringProperty in interface javax.jms.Message
Parameters:
name - the name of the String property
value - the String property value to set
Throws:
javax.jms.JMSException - if the JMS provider fails to set the property due to some internal error.
javax.jms.MessageNotWriteableException - if properties are read-only

setObjectProperty

public void setObjectProperty(java.lang.String name,
                              java.lang.Object value)
                       throws javax.jms.JMSException
Sets a Java object property value with the specified name into the message.

Note that this method works only for the objectified primitive object types (Integer,Double,Long ...) and String objects.

Specified by:
setObjectProperty in interface javax.jms.Message
Parameters:
name - the name of the Java object property
value - the Java object property value to set
Throws:
javax.jms.JMSException - if the JMS provider fails to set the property due to some internal error.
MessageFormatException - if the object is invalid
javax.jms.MessageNotWriteableException - if properties are read-only

acknowledge

public void acknowledge()
                 throws javax.jms.JMSException
Specified by:
acknowledge in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.acknowledge()

clearBody

public void clearBody()
               throws javax.jms.JMSException
Clears out the message body. Clearing a message's body does not clear its header values or property entries.

If this message body was read-only, calling this method leaves the message body in the same state as an empty body in a newly created message.

Specified by:
clearBody in interface javax.jms.Message
Throws:
javax.jms.JMSException - if the JMS provider fails to clear the message body due to some internal error.

setPropertiesModifiable

public void setPropertiesModifiable(boolean state)
Set the read only state of the message properties.

Parameters:
state - false if the message properties are read-only, true if the message properties can be modified.

isPropertiesModifiable

public boolean isPropertiesModifiable()
Return true if the message properties are modifiable, else it is in read-only mode.

Returns:
true if message properties can be modified, false if not

setBodyModifiable

public void setBodyModifiable(boolean state)
Set the read only state of teh message body.

Parameters:
state - false if the message body are read-only, true if the message body can be modified.

isBodyModifiable

public boolean isBodyModifiable()
Return true if the message body is modifiable, else it is in read-only mode.

Returns:
true if message body can be modified, false if not


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