| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A MapMessage object is used to send a set of name-value pairs.
The names are String objects, and the values are primitive
data types in the Java programming language. The names must have a value that
is not null, and not an empty string. The entries can be accessed
sequentially or randomly by name. The order of the entries is undefined.
MapMessage inherits from the Message interface
and adds a message body that contains a Map.
The primitive types can be read or written explicitly using methods for each type.
When a client receives a MapMessage, 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 now be both read from and
written to.
MapMessage objects 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 primitive's 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 char int long float double String byte[] |---------------------------------------------------------------------- |boolean | X X |byte | X X X X X |short | X X X X |char | 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 |byte[] | X |----------------------------------------------------------------------
Attempting to read a null value as a primitive type must be treated
as calling the primitive's corresponding valueOf(String)
conversion method with a null value. Since char does not
support a String conversion, attempting to read a null value
as a char must throw a NullPointerException.
| Constructor Summary | |
MapMessage()
A MapMessage object is used to send a set of name-value pairs.
|
|
| Method Summary | |
Number
|
getByte(name)
Returns the Number representing the integer value of the specified name
|
|
getBytes(name)
Returns the byte array with the specified name |
String
|
getChar(name)
Returns the String representing the Unicode character of the specified name
|
Number
|
getDouble(name)
Returns the Number representing the double value of the specified name.
|
Number
|
getFloat(name)
Returns the Number representing the float value of the specified name
|
Number
|
getLong(name)
Returns the Number representing the long value
of the specified name.
|
|
getMapNames()
Returns the array of names in the map message. |
|
getObject(name)
Returns the object value of the specified name. |
Number
|
getShort(name)
Returns the Number representing the short value of the specified name
|
String
|
getString(name)
Returns the String value of the specified name
|
Boolean
|
itemExists(name)
Returns the Boolean value indicating whether or not specified
name exists on the map.
|
|
setBoolean(name, value)
Sets the boolean value with the specified name
|
|
setByte(name, value)
Sets the Number representing the byte value with the specified name in the map message.
|
|
setBytes(name, value, offset, length)
Sets the byte array with the specified name in the map message. |
|
setBytes(name, value, offset, length)
Sets the byte array with the specified name in the map message. |
|
setChar(name, value)
Sets the String representing the unicode character with the specified name in the map message.
|
|
setDouble(name, value)
Sets the Number representing the double value with the specified
name in the map message.
|
|
setFloat(name, value)
Sets the Number representing the float value with the specified
name in the map message.
|
|
setInt(name, value)
Sets the Number representing the integer value with the specified name in the map message.
|
|
setLong(name, value)
Sets the Number representing the long value
with the specified name in the map message.
|
|
setObject(name, value)
Sets the object value with the specified name in the map message. |
|
setShort(name, value)
Sets the Number representing the short value with the specified name in the map message.
|
|
setString(name, value)
Sets the String value with the specified name in the map message.
|
| Constructor Detail |
MapMessage()
MapMessage object is used to send a set of name-value pairs.
The names are String objects, and the values are primitive
data types in the Java programming language. The names must have a value that
is not null, and not an empty string. The entries can be accessed
sequentially or randomly by name. The order of the entries is undefined.
MapMessage inherits from the Message interface
and adds a message body that contains a Map.
The primitive types can be read or written explicitly using methods for each type.
When a client receives a MapMessage, 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 now be both read from and
written to.
MapMessage objects 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 primitive's 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 char int long float double String byte[] |---------------------------------------------------------------------- |boolean | X X |byte | X X X X X |short | X X X X |char | 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 |byte[] | X |----------------------------------------------------------------------
Attempting to read a null value as a primitive type must be treated
as calling the primitive's corresponding valueOf(String)
conversion method with a null value. Since char does not
support a String conversion, attempting to read a null value
as a char must throw a NullPointerException.
| Method Detail |
Number getByte(name)
Number representing the integer value of the specified name
name - the name of the Number
Number integer value with the specified name.
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
getBytes(name)
name - the name of the String
byte array
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
String getChar(name)
String representing the Unicode character of the specified name
name - the name of the Number
String representing the Unicode character of the specified name
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
Number getDouble(name)
Number representing the double value of the specified name.
name - the name of the Number
Number double value with the specified name.
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
Number getFloat(name)
Number representing the float value of the specified name
name - the name of the Number
Number float value with the specified name.
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
Number getLong(name)
Number representing the long value
of the specified name.
NOTE: Javascript does not support 64 bit long integer natively. The maximum integer value supported by the Number type ranges from -9,007,199,254,740,992 (-2^53) to 9,007,199,254,740,992 (2^53).
name - the name of the Number
Number long value with the specified name.
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
getMapNames()
the {Array} of names from the map message.
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
getObject(name)
name - the name of the object value
object value with the specified name.
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
Number getShort(name)
Number representing the short value of the specified name
name - the name of the Number
Number short value with the specified name.
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
String getString(name)
String value of the specified name
name - the name of the String
String value with the specified name.
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
Boolean itemExists(name)
Boolean value indicating whether or not specified
name exists on the map.
name - the name to check
Boolean value
JMSException if the JMS provider fails to read the message
due to some internal error.
MessageFormatException if this type conversion is invalid.
setBoolean(name, value)
boolean value with the specified name
name - the name of the value
value - {Boolean} value
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setByte(name, value)
Number representing the byte value with the specified name in the map message.
name - the name of the value
value - {Number} representing byte value
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setBytes(name, value, offset, length)
name - the name of the value
value - byte array
offset - {Number} offset the initial offset within the byte array
length - {Number} len the number of bytes to use
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setBytes(name, value, offset, length)
name - the name of the value
value - byte array
offset - {Number} offset the initial offset within the byte array
length - {Number} len the number of bytes to use
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setChar(name, value)
String representing the unicode character with the specified name in the map message.
name - the name of the value
value - {String} representing unicode character
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setDouble(name, value)
Number representing the double value with the specified
name in the map message.
name - the name of the value
value - {Number} representing double value
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setFloat(name, value)
Number representing the float value with the specified
name in the map message.
name - the name of the value
value - {Number} representing float value
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setInt(name, value)
Number representing the integer value with the specified name in the map message.
name - the name of the value
value - {Number} representing integer value
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setLong(name, value)
Number representing the long value
with the specified name in the map message.
* NOTE: Javascript does not support 64 bit long integer natively. The maximum integer value supported by the Number type ranges from -9,007,199,254,740,992 (-2^53) to 9,007,199,254,740,992 (2^53).
name - the name of the value
value - {Number} representing long value
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setObject(name, value)
name - the name of the value
value - object
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setShort(name, value)
Number representing the short value with the specified name in the map message.
name - the name of the value
value - {Number} representing short value
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.
setString(name, value)
String value with the specified name in the map message.
name - the name of the value
value - {String} value
JMSException if the JMS provider fails to read the message
due to some internal error.
IllegalArgumentException if the name is null or if the name is
an empty string.
MessageNotWriteableException if the message is in read-only
mode.