Websphere MQ Everyplace

com.ibm.mqe.jms
Class MQeMessage

java.lang.Object
  |
  +--com.ibm.mqe.jms.MQeMessage
All Implemented Interfaces:
javax.jms.Message
Direct Known Subclasses:
MQeBytesMessage, MQeMapMessage, MQeObjectMessage, MQeStreamMessage, MQeTextMessage

public abstract class MQeMessage
extends java.lang.Object
implements javax.jms.Message

The Message interface is the root interface of all JMS messages. It defines the JMS header and the acknowledge() method used for all messages.

JMS Messages are composed of the following parts:

A Message contains a built-in facility for supporting application defined property values. In effect, this provides a mechanism for adding application specific header fields to a message.

Properties allow an application, via message selectors, to have a JMS provider select/filter messages on its behalf using application-specific criteria.

Property names must obey the rules for a message selector identifier.

Property values can be boolean, byte, short, int, long, float, double, and String.

Property values are set prior to sending a message. When a client receives a message, its properties are in read-only mode. If a client attempts to set properties at this point, a MessageNotWriteableException is thrown. If clearProperties() is called, the properties can now be both read from and written to.

Message properties support the following conversion table. The marked cases must be supported. The unmarked cases must throw a JMSException. The String to primitive conversions may throw a runtime exception if the primitives valueOf() method does not accept it as a valid String representation of the primitive.

A value written as the row type can be read as the column type.

 |        | boolean byte short int long float double String
 |----------------------------------------------------------
 |boolean |    X                                       X
 |byte    |          X     X    X   X                  X
 |short   |                X    X   X                  X
 |int     |                     X   X                  X
 |long    |                         X                  X
 |float   |                               X     X      X
 |double  |                                     X      X
 |String  |    X     X     X    X   X     X     X      X
 |----------------------------------------------------------
 

In addition to the type-specific set/get methods for properties, JMS provides the setObjectProperty and getObjectProperty methods. These support the same set of property types using the objectified primitive values. Their purpose is to allow the decision of property type to made at execution time rather than at compile time. They support the same property value conversions.

The setObjectProperty method accepts values of class Boolean, Byte, Short, Integer, Long, Float, Double and String. An attempt to use any other class must throw a JMSException.

The getObjectProperty method only returns values of class Boolean, Byte, Short, Integer, Long, Float, Double and String.

The order of property values is not defined. To iterate through a message's property values, use getPropertyNames to retrieve a property name enumeration and then use the various property get methods to retrieve their values.

A message's properties are deleted by the clearProperties method. This leaves the message with an empty set of properties.

JMS reserves the `JMSX' property name prefix for JMS defined properties. The full set of these properties is defined in the Java Message Service specification. JMSXGroupID and JMSXGroupSeq are simply standard properties clients should use if they want to group messages. WebSphere MQ Everyplace also supports JMSXAppID, JMSXUserID, JMSXRcvTimestamp and JMSXDeliveryCount.

See Also:
MQeBytesMessage, MQeMapMessage, MQeObjectMessage, MQeStreamMessage, MQeTextMessage

Field Summary
static int DEFAULT_DELIVERY_MODE
          The default delivery mode value.
 
Fields inherited from interface javax.jms.Message
DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Constructor Summary
MQeMessage()
           
 
Method Summary
 void acknowledge()
          Acknowledge this and all previous messages received.
abstract  void clearBody()
          Clear the message body.
 void clearProperties()
          Clear a message's properties.
 boolean getBooleanProperty(java.lang.String name)
          Return the boolean property value with the given name.
 byte getByteProperty(java.lang.String name)
          Return the byte property value with the given name.
 double getDoubleProperty(java.lang.String name)
          Return the double property value with the given name.
 float getFloatProperty(java.lang.String name)
          Return the float property value with the given name.
 int getIntProperty(java.lang.String name)
          Return the integer property value with the given name.
 java.lang.String getJMSCorrelationID()
          Get the correlation ID for the message.
 byte[] getJMSCorrelationIDAsBytes()
          Get the correlation ID as an array of bytes for the message.
 int getJMSDeliveryMode()
          Get the delivery mode for this message.
 javax.jms.Destination getJMSDestination()
          Get the destination for this message.
 long getJMSExpiration()
          Get the message's expiration value.
 java.lang.String getJMSMessageID()
          Get the message ID.
 int getJMSPriority()
          Get the message priority.
 boolean getJMSRedelivered()
          Get an indication of whether this message is being redelivered.
 javax.jms.Destination getJMSReplyTo()
          Get where a reply to this message should be sent.
 long getJMSTimestamp()
          Get the message timestamp.
 java.lang.String getJMSType()
          Get the message type.
 long getLongProperty(java.lang.String name)
          Return the long property value with the given name.
 java.lang.Object getObjectProperty(java.lang.String name)
          Return the Java object property value with the given name.
 java.util.Enumeration getPropertyNames()
          Return an Enumeration of all the property names.
 short getShortProperty(java.lang.String name)
          Return the short property value with the given name.
 java.lang.String getStringProperty(java.lang.String name)
          Return the String property value with the given name.
 boolean propertyExists(java.lang.String name)
          Check if a property value exists.
 void setBooleanProperty(java.lang.String name, boolean value)
          Set a boolean property value with the given name.
 void setByteProperty(java.lang.String name, byte value)
          Set a byte property value with the given name.
 void setDoubleProperty(java.lang.String name, double value)
          Set a double property value with the given name.
 void setFloatProperty(java.lang.String name, float value)
          Set a float property value with the given name.
 void setIntProperty(java.lang.String name, int value)
          Set an integer property value with the given name.
 void setJMSCorrelationID(java.lang.String correlationID)
          Set the correlation ID for the message.
 void setJMSCorrelationIDAsBytes(byte[] correlationID)
          Set the correlation ID as an array of bytes for the message.
 void setJMSDeliveryMode(int deliveryMode)
          Set the delivery mode for this message.
 void setJMSDestination(javax.jms.Destination destination)
          Set the destination for this message.
 void setJMSExpiration(long expiration)
          Set the message's expiration value.
 void setJMSMessageID(java.lang.String id)
          Set the message ID.
 void setJMSPriority(int priority)
          Set the priority for this message.
 void setJMSRedelivered(boolean redelivered)
          Set to indicate whether this message is being redelivered.
 void setJMSReplyTo(javax.jms.Destination replyTo)
          Set where a reply to this message should be sent.
 void setJMSTimestamp(long timestamp)
          Set the message timestamp.
 void setJMSType(java.lang.String type)
          Set the message type.
 void setLongProperty(java.lang.String name, long value)
          Set a long property value with the given name.
 void setObjectProperty(java.lang.String name, java.lang.Object value)
          Set a Java object property value with the given name.
 void setShortProperty(java.lang.String name, short value)
          Set a short property value with the given name.
 void setStringProperty(java.lang.String name, java.lang.String value)
          Set a String property value with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DELIVERY_MODE

public static final int DEFAULT_DELIVERY_MODE
The default delivery mode value.

See Also:
Constant Field Values
Constructor Detail

MQeMessage

public MQeMessage()
Method Detail

getJMSMessageID

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

Specified by:
getJMSMessageID in interface javax.jms.Message
Returns:
the message ID
Throws:
javax.jms.JMSException - if JMS fails to get the message Id due to internal JMS error.

setJMSMessageID

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

Any value set using this method is ignored when the message is sent, but can be used to change the value in a received message.

Specified by:
setJMSMessageID in interface javax.jms.Message
Parameters:
id - the ID of the message
Throws:
javax.jms.JMSException - if JMS fails to set the message Id due to internal JMS error.

getJMSTimestamp

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

Specified by:
getJMSTimestamp in interface javax.jms.Message
Returns:
the message timestamp
Throws:
javax.jms.JMSException - if JMS fails to get the Timestamp due to internal JMS error.

setJMSTimestamp

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

Any value set using this method is ignored when the message is sent, but can be used to change the value in a received message.

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

getJMSCorrelationIDAsBytes

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

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 JMS fails to get correlationId due to some internal JMS error.

setJMSCorrelationIDAsBytes

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

Specified by:
setJMSCorrelationIDAsBytes in interface javax.jms.Message
Parameters:
correlationID - the correlation ID value as an array of bytes.
Throws:
javax.jms.JMSException - if JMS fails to set correlationId due to some internal JMS error.

setJMSCorrelationID

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

A client can use the JMSCorrelationID header field to link one message with another. A typically use is to link a response message with its request message.

Note that application specified values must not start with the "ID:" prefix, which is reserved for provider generated message ID values.

Specified by:
setJMSCorrelationID in interface javax.jms.Message
Parameters:
correlationID - the message ID of a message being referred to.
Throws:
javax.jms.JMSException - if JMS fails to set correlationId due to some internal JMS error.

getJMSCorrelationID

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

Specified by:
getJMSCorrelationID in interface javax.jms.Message
Returns:
the correlation ID of a message as a String.
Throws:
javax.jms.JMSException - if JMS fails to get correlationId due to some internal JMS error.

getJMSReplyTo

public javax.jms.Destination getJMSReplyTo()
                                    throws javax.jms.JMSException
Get where a reply to this message should be sent.

Specified by:
getJMSReplyTo in interface javax.jms.Message
Returns:
where to send a response to this message
Throws:
javax.jms.JMSException - if JMS fails to get ReplyTo Destination due to some internal JMS error.

setJMSReplyTo

public void setJMSReplyTo(javax.jms.Destination replyTo)
                   throws javax.jms.JMSException
Set where a reply to this message should be sent. If it is null no reply is expected.

Messages with a null replyTo value are called JMS datagrams. Datagrams may be a notification of some change in the sender (i.e. they signal a sender event) or they may just be some data the sender thinks is of interest. Messages with a replyTo value are typically expecting a response. A response may be optional, it is up to the client to decide. These messages are called JMS requests. A message sent in response to a request is called a reply.

Specified by:
setJMSReplyTo in interface javax.jms.Message
Parameters:
replyTo - where to send a response to this message
Throws:
javax.jms.JMSException - if JMS fails to set ReplyTo Destination due to some internal JMS error.

getJMSDestination

public javax.jms.Destination getJMSDestination()
                                        throws javax.jms.JMSException
Get the destination for this message.

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

setJMSDestination

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

Any value set using this method is ignored when the message is sent, but this method can be used to change the value in a received message.

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

getJMSDeliveryMode

public int getJMSDeliveryMode()
                       throws javax.jms.JMSException
Get the delivery mode for this message.

Specified by:
getJMSDeliveryMode in interface javax.jms.Message
Returns:
the delivery mode of this message.
Throws:
javax.jms.JMSException - if JMS fails to get JMS DeliveryMode due to some internal JMS error.

setJMSDeliveryMode

public void setJMSDeliveryMode(int deliveryMode)
                        throws javax.jms.JMSException
Set the delivery mode for this message.

Any value set using this method is ignored when the message is sent, but this method can be used to change the value in a received message.

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

getJMSRedelivered

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

If a client receives a message with the redelivered indicator set, it is likely, but not guaranteed, that this message was delivered to the client earlier but the client did not acknowledge its receipt at that earlier time.

Specified by:
getJMSRedelivered in interface javax.jms.Message
Returns:
set to true if this message is being redelivered.
Throws:
javax.jms.JMSException - if JMS fails to get JMS Redelivered flag due to some internal JMS error.

setJMSRedelivered

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

Any value set using this method is ignored when the message is sent, but this method can be used to change the value in a received message.

Specified by:
setJMSRedelivered in interface javax.jms.Message
Parameters:
redelivered - an indication of whether this message is being redelivered.
Throws:
javax.jms.JMSException - if JMS fails to set JMS Redelivered flag due to some internal JMS error.

getJMSType

public java.lang.String getJMSType()
                            throws javax.jms.JMSException
Get the message type.

Specified by:
getJMSType in interface javax.jms.Message
Returns:
the message type
Throws:
javax.jms.JMSException - if JMS fails to get JMS message type due to some internal JMS error.

setJMSType

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

JMS clients should assign a value to type whether the application makes use of it or not. This insures that it is properly set for those providers that require it.

Specified by:
setJMSType in interface javax.jms.Message
Parameters:
type - the class of message
Throws:
javax.jms.JMSException - if JMS fails to set JMS message type due to some internal JMS error.

getJMSExpiration

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

If the time-to-live is specified as zero, expiration is set to zero which indicates the message does not expire.

Specified by:
getJMSExpiration in interface javax.jms.Message
Returns:
the time the message expires. It 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 JMS fails to get JMS message expiration due to some internal JMS error.

setJMSExpiration

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

Any value set using this method is ignored when the message is sent, but this method can be used to change the value in a received message.

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

getJMSPriority

public int getJMSPriority()
                   throws javax.jms.JMSException
Get the message priority.

JMS defines a ten level priority value with 0 as the lowest priority and 9 as the highest. In addition, clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority.

Specified by:
getJMSPriority in interface javax.jms.Message
Returns:
the default message priority
Throws:
javax.jms.JMSException - if JMS fails to get JMS message priority due to some internal JMS error.

setJMSPriority

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

Any value set using this method is ignored when the message is sent, but this method can be used to change the value in a received message.

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

clearProperties

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

Specified by:
clearProperties in interface javax.jms.Message
Throws:
javax.jms.JMSException - if JMS fails to clear JMS message properties due to some internal JMS error.

propertyExists

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

Specified by:
propertyExists in interface javax.jms.Message
Parameters:
name - the name of the property to test
Returns:
true if the property does exist.
Throws:
javax.jms.JMSException - if JMS fails to check if property exists due to some internal JMS error.

getBooleanProperty

public boolean getBooleanProperty(java.lang.String name)
                           throws javax.jms.JMSException
Return the boolean property value with the given name.

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

getByteProperty

public byte getByteProperty(java.lang.String name)
                     throws javax.jms.JMSException,
                            java.lang.NumberFormatException
Return the byte property value with the given name.

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

getShortProperty

public short getShortProperty(java.lang.String name)
                       throws javax.jms.JMSException,
                              java.lang.NumberFormatException
Return the short property value with the given name.

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

getIntProperty

public int getIntProperty(java.lang.String name)
                   throws javax.jms.JMSException,
                          java.lang.NumberFormatException
Return the integer property value with the given name.

Specified by:
getIntProperty in interface javax.jms.Message
Parameters:
name - the name of the integer property
Returns:
the integer property value with the given name.
Throws:
javax.jms.JMSException - if JMS fails to get Property due to some internal JMS error.
javax.jms.MessageFormatException - if this type conversion is invalid.
java.lang.NumberFormatException

getLongProperty

public long getLongProperty(java.lang.String name)
                     throws javax.jms.JMSException,
                            java.lang.NumberFormatException
Return the long property value with the given name.

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

getFloatProperty

public float getFloatProperty(java.lang.String name)
                       throws javax.jms.JMSException,
                              java.lang.NullPointerException
Return the float property value with the given name.

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

getDoubleProperty

public double getDoubleProperty(java.lang.String name)
                         throws javax.jms.JMSException,
                                java.lang.NullPointerException
Return the double property value with the given name.

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

getStringProperty

public java.lang.String getStringProperty(java.lang.String name)
                                   throws javax.jms.JMSException
Return the String property value with the given name.

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

getObjectProperty

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

Note that this method can be used to return in objectified format, an object that had been stored as a property in the Message with the equivalent setObject method call, or it's equivalent primitive set 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 given name, in objectified format (ie. if it set as an int, then a Integer is returned). If there is no property by this name, a null value is returned.
Throws:
javax.jms.JMSException - if JMS fails to get Property due to some internal JMS error.

getPropertyNames

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

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

setBooleanProperty

public void setBooleanProperty(java.lang.String name,
                               boolean value)
                        throws javax.jms.JMSException
Set a boolean property value with the given name.

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

setByteProperty

public void setByteProperty(java.lang.String name,
                            byte value)
                     throws javax.jms.JMSException
Set a byte property value with the given name.

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

setShortProperty

public void setShortProperty(java.lang.String name,
                             short value)
                      throws javax.jms.JMSException
Set a short property value with the given name.

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

setIntProperty

public void setIntProperty(java.lang.String name,
                           int value)
                    throws javax.jms.JMSException
Set an integer property value with the given name.

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

setLongProperty

public void setLongProperty(java.lang.String name,
                            long value)
                     throws javax.jms.JMSException
Set a long property value with the given name.

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

setFloatProperty

public void setFloatProperty(java.lang.String name,
                             float value)
                      throws javax.jms.JMSException
Set a float property value with the given name.

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

setDoubleProperty

public void setDoubleProperty(java.lang.String name,
                              double value)
                       throws javax.jms.JMSException
Set a double property value with the given name.

Specified by:
setDoubleProperty in interface javax.jms.Message
Parameters:
name - the name of the double property
value - the double property value to set in the Message.
Throws:
javax.jms.JMSException - if JMS fails to set Property due to some internal JMS 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
Set a String property value with the given name.

Specified by:
setStringProperty in interface javax.jms.Message
Parameters:
name - the name of the String property
value - the String property value to set in the Message.
Throws:
javax.jms.JMSException - if JMS fails to set Property due to some internal JMS 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
Set a Java object property value with the given name.

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

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 in the Message.
Throws:
javax.jms.JMSException - if JMS fails to set Property due to some internal JMS error.
javax.jms.MessageFormatException - if object is invalid
javax.jms.MessageNotWriteableException - if properties are read-only

acknowledge

public void acknowledge()
                 throws javax.jms.JMSException
Acknowledge this and all previous messages received.

All JMS messages support the acknowledge() method for use when a client has specified that a JMS consumers messages are to be explicitly acknowledged. JMS defaults to implicit message acknowledgement. In this mode, calls to acknowledge() are ignored.

Specified by:
acknowledge in interface javax.jms.Message
Throws:
javax.jms.JMSException - if JMS fails to acknowledge due to some internal JMS error.

clearBody

public abstract void clearBody()
                        throws javax.jms.JMSException
Clear the message body. All other parts of the message are left untouched.

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

Websphere MQ Everyplace