Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

javax::jms::MapMessage Class Reference

A MapMessage object is used to send a set of name-value pairs. More...

#include <javax_jms_MapMessage.h>

Inheritance diagram for javax::jms::MapMessage:

Inheritance graph
[legend]
Collaboration diagram for javax::jms::MapMessage:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  xmogDefaultFlags = xmog_base::GLOBAL, xmogMajorVersion = 3, xmogMinorVersion = 2, xmogPatchVersion = 9,
  xmogBuildNumber = 2047
}
typedef ::xmog_java_array_template<
::javax::jms::MapMessage
array1D
typedef ::xmog_java_array_template<
::xmog_java_array_template<
::javax::jms::MapMessage > > 
array2D

Public Member Functions

virtual bool getBoolean (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the boolean value with the specified name.
virtual jbyte getByte (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the byte value with the specified name.
virtual ::xmog_java_byte_array getBytes (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the byte array value with the specified name.
virtual jchar getChar (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the Unicode character value with the specified name.
virtual jdouble getDouble (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the double value with the specified name.
virtual jfloat getFloat (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the float value with the specified name.
virtual jint getInt (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the int value with the specified name.
virtual jlong getLong (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the long value with the specified name.
virtual ::java::util::Enumeration getMapNames (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns an Enumeration of all the names in the MapMessage object.
virtual ::java::lang::Object getObject (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the value of the object with the specified name.
virtual jshort getShort (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the short value with the specified name.
virtual ::java::lang::String getString (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the String value with the specified name.
virtual bool itemExists (const ::java::lang::String &name,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Indicates whether an item exists in this MapMessage object.
virtual void setBoolean (const ::java::lang::String &name, bool value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets a boolean value with the specified name into the Map.
virtual void setByte (const ::java::lang::String &name, jbyte value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets a byte value with the specified name into the Map.
virtual void setBytes (const ::java::lang::String &name, const ::xmog_java_byte_array &value, jint offset, jint length,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets a portion of the byte array value with the specified name into the Map.
virtual void setBytes (const ::java::lang::String &name, const ::xmog_java_byte_array &value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets a byte array value with the specified name into the Map.
virtual void setChar (const ::java::lang::String &name, jchar value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets a Unicode character value with the specified name into the Map.
virtual void setDouble (const ::java::lang::String &name, jdouble value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets a double value with the specified name into the Map.
virtual void setFloat (const ::java::lang::String &name, jfloat value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets a float value with the specified name into the Map.
virtual void setInt (const ::java::lang::String &name, jint value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets an int value with the specified name into the Map.
virtual void setLong (const ::java::lang::String &name, jlong value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets a long value with the specified name into the Map.
virtual void setObject (const ::java::lang::String &name, const ::java::lang::Object &value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets an object value with the specified name into the Map.
virtual void setShort (const ::java::lang::String &name, jshort value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets a short value with the specified name into the Map.
virtual void setString (const ::java::lang::String &name, const ::java::lang::String &value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets a String value with the specified name into the Map.

Detailed Description

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. They may also be read or written generically as objects. For instance, a call to MapMessage.setInt("foo", 6) is equivalent to MapMessage.setObject("foo", new Integer(6)). Both forms are provided, because the explicit form is convenient for static programming, and the object form is needed when types are not known at compile time.

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.

Author:
Mark Hapner

Rich Burridge


Member Function Documentation

virtual bool javax::jms::MapMessage::getBoolean const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Returns the boolean value with the specified name.

Parameters:
name the name of the boolean
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the boolean value with the specified name

virtual jbyte javax::jms::MapMessage::getByte const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Returns the byte value with the specified name.

Parameters:
name the name of the byte
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the byte value with the specified name

virtual ::xmog_java_byte_array javax::jms::MapMessage::getBytes const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns the byte array value with the specified name.

Parameters:
name the name of the byte array
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a copy of the byte array value with the specified name; if there is no item by this name, a null value is returned.

virtual jchar javax::jms::MapMessage::getChar const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Returns the Unicode character value with the specified name.

Parameters:
name the name of the Unicode character
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the Unicode character value with the specified name

virtual jdouble javax::jms::MapMessage::getDouble const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Returns the double value with the specified name.

Parameters:
name the name of the double
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the double value with the specified name

virtual jfloat javax::jms::MapMessage::getFloat const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Returns the float value with the specified name.

Parameters:
name the name of the float
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the float value with the specified name

virtual jint javax::jms::MapMessage::getInt const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Returns the int value with the specified name.

Parameters:
name the name of the int
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the int value with the specified name

virtual jlong javax::jms::MapMessage::getLong const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Returns the long value with the specified name.

Parameters:
name the name of the long
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the long value with the specified name

virtual ::java::util::Enumeration javax::jms::MapMessage::getMapNames ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns an Enumeration of all the names in the MapMessage object.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
an enumeration of all the names in this MapMessage

virtual ::java::lang::Object javax::jms::MapMessage::getObject const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns the value of the object with the specified name.

This method can be used to return, in objectified format, an object in the Java programming language ("Java object") that had been stored in the Map with the equivalent setObject method call, or its equivalent primitive settype method.

Note that byte values are returned as byte[], not Byte[].

Parameters:
name the name of the Java object
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a copy of the Java object value with the specified name, in objectified format (for example, if the object was set as an int, an Integer is returned); if there is no item by this name, a null value is returned

virtual jshort javax::jms::MapMessage::getShort const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Returns the short value with the specified name.

Parameters:
name the name of the short
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the short value with the specified name

virtual ::java::lang::String javax::jms::MapMessage::getString const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns the String value with the specified name.

Parameters:
name the name of the String
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the String value with the specified name; if there is no item by this name, a null value is returned

virtual bool javax::jms::MapMessage::itemExists const ::java::lang::String name,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Indicates whether an item exists in this MapMessage object.

Parameters:
name the name of the item to test
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
true if the item exists

virtual void javax::jms::MapMessage::setBoolean const ::java::lang::String name,
bool  value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets a boolean value with the specified name into the Map.

Parameters:
name the name of the boolean
value the boolean value to set in the Map
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setByte const ::java::lang::String name,
jbyte  value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets a byte value with the specified name into the Map.

Parameters:
name the name of the byte
value the byte value to set in the Map
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setBytes const ::java::lang::String name,
const ::xmog_java_byte_array value,
jint  offset,
jint  length,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets a portion of the byte array value with the specified name into the Map.

Parameters:
name the name of the byte array
value the byte array value to set in the Map
offset the initial offset within the byte array
length the number of bytes to use
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setBytes const ::java::lang::String name,
const ::xmog_java_byte_array value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets a byte array value with the specified name into the Map.

Parameters:
name the name of the byte array
value the byte array value to set in the Map; the array is copied so that the value for name will not be altered by future modifications
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setChar const ::java::lang::String name,
jchar  value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets a Unicode character value with the specified name into the Map.

Parameters:
name the name of the Unicode character
value the Unicode character value to set in the Map
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setDouble const ::java::lang::String name,
jdouble  value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets a double value with the specified name into the Map.

Parameters:
name the name of the double
value the double value to set in the Map
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setFloat const ::java::lang::String name,
jfloat  value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets a float value with the specified name into the Map.

Parameters:
name the name of the float
value the float value to set in the Map
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setInt const ::java::lang::String name,
jint  value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets an int value with the specified name into the Map.

Parameters:
name the name of the int
value the int value to set in the Map
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setLong const ::java::lang::String name,
jlong  value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets a long value with the specified name into the Map.

Parameters:
name the name of the long
value the long value to set in the Map
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setObject const ::java::lang::String name,
const ::java::lang::Object value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets an object value with the specified name into the Map.

This method works only for the objectified primitive object types (Integer, Double, Long ...), String objects, and byte arrays.

Parameters:
name the name of the Java object
value the Java object value to set in the Map
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setShort const ::java::lang::String name,
jshort  value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets a short value with the specified name into the Map.

Parameters:
name the name of the short
value the short value to set in the Map
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MapMessage::setString const ::java::lang::String name,
const ::java::lang::String value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets a String value with the specified name into the Map.

Parameters:
name the name of the String
value the String value to set in the Map
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:


The documentation for this class was generated from the following file:
Generated on Fri Jun 16 10:19:51 2006 for JMS Courier for C++ by  doxygen 1.4.1