Oracle® Streams Advanced Queuing Java API Reference
10g Release 2 (10.2)

B14291-01


oracle.jms
Class AQjmsMapMessage

java.lang.Object
  extended byoracle.jms.AQjmsMessage
      extended byoracle.jms.AQjmsMapMessage

All Implemented Interfaces:
MapMessage, Message

public class AQjmsMapMessage
extends AQjmsMessage
implements MapMessage

This is an Oracle class which implements javax.jms.MapMessage.


Field Summary

Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE

Method Summary
void clearBody()
Clears out the message body.
void clearProperties()
Clears a message's properties.
boolean getBoolean(java.lang.String name)
Returns, as a boolean, the value to which the specified name is mapped.
byte getByte(java.lang.String name)
Returns, as a byte, the value to which the specified name is mapped.
byte[] getBytes(java.lang.String name)
Returns the byte[] value to which the specified name is mapped.
char getChar(java.lang.String name)
Returns the Unicode character value to which the specified name is mapped.
double getDouble(java.lang.String name)
Returns, as a double, the value to which the specified name is mapped.
float getFloat(java.lang.String name)
Returns, as a float, the value to which the specified name is mapped.
int getInt(java.lang.String name)
Returns, as an int, the value to which the specified name is mapped.
long getLong(java.lang.String name)
Returns, as a long, the value to which the specified name is mapped.
java.util.Enumeration getMapNames()
Returns an Enumeration of all mapped names.
java.lang.Object getObject(java.lang.String name)
Returns, as a Java object, the value to which the specified name is mapped.
short getShort(java.lang.String name)
Returns, as a short, the value to which the specified name is mapped.
java.lang.String getString(java.lang.String name)
Returns, as a String, the value to which the specified name is mapped.
boolean itemExists(java.lang.String name)
Checks if a mapping exists for the specified name (i.e., if name maps to some item).
void setBoolean(java.lang.String name, boolean value)
Maps the specified name to the specified boolean value.
void setByte(java.lang.String name, byte value)
Maps the specified name to the specified byte value.
void setBytes(java.lang.String name, byte[] value)
Maps the specified name to the specified byte array value.
void setBytes(java.lang.String name, byte[] value, int offset, int length)
Maps the specified name to the specified portion of a byte array.
void setChar(java.lang.String name, char value)
Maps the specified name to the specified Unicode character value.
void setDouble(java.lang.String name, double value)
Maps the specified name to the specified double value.
void setFloat(java.lang.String name, float value)
Maps the specified name to the specified float value.
void setInt(java.lang.String name, int value)
Maps the specified name to the specified int value.
void setLong(java.lang.String name, long value)
Maps the specified name to the specified long value.
void setObject(java.lang.String name, java.lang.Object value)
Maps the specified name to the specified Java object value.
void setShort(java.lang.String name, short value)
Maps the specified name to the specified short value.
void setString(java.lang.String name, java.lang.String value)
Maps the specified name to the specified String value.

Methods inherited from class oracle.jms.AQjmsMessage
acknowledge, getAttempts, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSMessageIDAsBytes, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getSenderID, getShortProperty, getStringProperty, getUserPropertyNames, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setSenderID, setShortProperty, setStringProperty

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface javax.jms.Message
acknowledge, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty

Method Detail

clearProperties

public void clearProperties()
                     throws JMSException
Clears a message's properties.
Specified by:
clearProperties in interface Message
Overrides:
clearProperties in class AQjmsMessage
Throws:
JMSException - if the message properties are not cleared due to some error.

setBoolean

public void setBoolean(java.lang.String name,
                       boolean value)
                throws JMSException
Maps the specified name to the specified boolean value. The value can be retrieved by calling the getBoolean(java.lang.String) method with a name that is equal to the original name.
Specified by:
setBoolean in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

setByte

public void setByte(java.lang.String name,
                    byte value)
             throws JMSException
Maps the specified name to the specified byte value. The value can be retrieved by calling the getByte(java.lang.String) method with a name that is equal to the original name.
Specified by:
setByte in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

setShort

public void setShort(java.lang.String name,
                     short value)
              throws JMSException
Maps the specified name to the specified short value. The value can be retrieved by calling the getShort(java.lang.String) method with a name that is equal to the original name.
Specified by:
setShort in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

setChar

public void setChar(java.lang.String name,
                    char value)
             throws JMSException
Maps the specified name to the specified Unicode character value. The value can be retrieved by calling the getChar(java.lang.String) method with a name that is equal to the original name.
Specified by:
setChar in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

setDouble

public void setDouble(java.lang.String name,
                      double value)
               throws JMSException
Maps the specified name to the specified double value. The value can be retrieved by calling the getDouble(java.lang.String) method with a name that is equal to the original name.
Specified by:
setDouble in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

setFloat

public void setFloat(java.lang.String name,
                     float value)
              throws JMSException
Maps the specified name to the specified float value. The value can be retrieved by calling the getFloat(java.lang.String) method with a name that is equal to the original name.
Specified by:
setFloat in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

setInt

public void setInt(java.lang.String name,
                   int value)
            throws JMSException
Maps the specified name to the specified int value. The value can be retrieved by calling the getInt(java.lang.String) method with a name that is equal to the original name.
Specified by:
setInt in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

setLong

public void setLong(java.lang.String name,
                    long value)
             throws JMSException
Maps the specified name to the specified long value. The value can be retrieved by calling the getLong(java.lang.String) method with a name that is equal to the original name.
Specified by:
setLong in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

setString

public void setString(java.lang.String name,
                      java.lang.String value)
               throws JMSException
Maps the specified name to the specified String value. The value can be retrieved by calling the getString(java.lang.String) method with a name that is equal to the original name.
Specified by:
setString in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name (may be null)
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

setObject

public void setObject(java.lang.String name,
                      java.lang.Object value)
               throws JMSException
Maps the specified name to the specified Java object value. The value can be retrieved by calling the getObject(java.lang.String) method with a name that is equal to the original name. Note that the JMS specification does not explicitly define how a null value is to be treated, and different JMS implementations handle it differently. OJMS treats null as an invalid value.
Specified by:
setObject in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name - must be an objectified primitive (e.g., an Integer), a String, or a byte array
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageFormatException - if value is null or is neither an objectified primitive, a String, nor a byte array.
MessageNotWriteableException - if this message is in read-only mode.

setBytes

public void setBytes(java.lang.String name,
                     byte[] value)
              throws JMSException
Maps the specified name to the specified byte array value. The value can be retrieved by calling the getBytes(java.lang.String) method with a name that is equal to the original name.
Specified by:
setBytes in interface MapMessage
Parameters:
name - the name to use as a key
value - the value to associate with the specified name
Throws:
JMSException - if the name/value pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

setBytes

public void setBytes(java.lang.String name,
                     byte[] value,
                     int offset,
                     int length)
              throws JMSException
Maps the specified name to the specified portion of a byte array. The resulting portion can be retrieved by calling the getBytes(java.lang.String) method with a name that is equal to the original name.
Specified by:
setBytes in interface MapMessage
Parameters:
name - the name to use as a key
value - the source array
offset - the initial offset within the source array
length - the number of bytes to use from the source array
Throws:
JMSException - if the name/portion pair is not mapped due to some error.
java.lang.IllegalArgumentException - if the name is null or is an empty string.
MessageNotWriteableException - if this message is in read-only mode.

getBoolean

public boolean getBoolean(java.lang.String name)
                   throws JMSException
Returns, as a boolean, the value to which the specified name is mapped.
Specified by:
getBoolean in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the value associated with name, converted (if needed) to a boolean
Throws:
JMSException - if the value is not retrieved due to some error.
MessageFormatException - if the conversion is invalid.

getByte

public byte getByte(java.lang.String name)
             throws JMSException
Returns, as a byte, the value to which the specified name is mapped.
Specified by:
getByte in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the value associated with name, converted (if needed) to a byte
Throws:
JMSException - if the value is not retrieved due to some error.
MessageFormatException - if the conversion is invalid.

getBytes

public byte[] getBytes(java.lang.String name)
                throws JMSException
Returns the byte[] value to which the specified name is mapped.
Specified by:
getBytes in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the byte[] value associated with name, or null if name is not mapped to any value
Throws:
JMSException - if the value is not retrieved due to some error.
MessageFormatException - if name is mapped to some value other than a byte[].

getChar

public char getChar(java.lang.String name)
             throws JMSException
Returns the Unicode character value to which the specified name is mapped.
Specified by:
getChar in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the char value associated with name
Throws:
JMSException - if the value is not retrieved due to some error.
MessageFormatException - if name is mapped to some value other than a char.

getDouble

public double getDouble(java.lang.String name)
                 throws JMSException
Returns, as a double, the value to which the specified name is mapped.
Specified by:
getDouble in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the value associated with name, converted (if needed) to a double
Throws:
JMSException - if the value is not retrieved due to some error.
MessageFormatException - if the conversion is invalid.

getFloat

public float getFloat(java.lang.String name)
               throws JMSException
Returns, as a float, the value to which the specified name is mapped.
Specified by:
getFloat in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the value associated with name, converted (if needed) to a float
Throws:
JMSException - if the value is not retrieved due to some error.
MessageFormatException - if the conversion is invalid.

getInt

public int getInt(java.lang.String name)
           throws JMSException
Returns, as an int, the value to which the specified name is mapped.
Specified by:
getInt in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the value associated with name, converted (if needed) to an int
Throws:
JMSException - if the value is not retrieved due to some error.
MessageFormatException - if the conversion is invalid.

getLong

public long getLong(java.lang.String name)
             throws JMSException
Returns, as a long, the value to which the specified name is mapped.
Specified by:
getLong in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the value associated with name, converted (if needed) to a long
Throws:
JMSException - if the value is not retrieved due to some error.
MessageFormatException - if the conversion is invalid.

getMapNames

public java.util.Enumeration getMapNames()
                                  throws JMSException
Returns an Enumeration of all mapped names.
Specified by:
getMapNames in interface MapMessage
Returns:
the enumeration
Throws:
JMSException - if the enumeration is not retrieved due to some error.

getObject

public java.lang.Object getObject(java.lang.String name)
                           throws JMSException
Returns, as a Java object, the value to which the specified name is mapped. Note that this method can be used to return, in objectified format, a value to which name has been mapped with the setObject method or the format's equivalent primitive settype method.
Specified by:
getObject in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the value associated with name, converted (if needed) to objectified format (e.g., int is converted to Integer), or null if name is not mapped to any value
Throws:
JMSException - if the value is not retrieved due to some error.

getShort

public short getShort(java.lang.String name)
               throws JMSException
Returns, as a short, the value to which the specified name is mapped.
Specified by:
getShort in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the value associated with name, converted (if needed) to a short
Throws:
JMSException - if the value is not retrieved due to some error.
MessageFormatException - if the conversion is invalid.

getString

public java.lang.String getString(java.lang.String name)
                           throws JMSException
Returns, as a String, the value to which the specified name is mapped.
Specified by:
getString in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
the value associated with name, converted (if needed) to a String, or null if name is not mapped to any value
Throws:
JMSException - if the value is not retrieved due to some error.
MessageFormatException - if the conversion is invalid.

itemExists

public boolean itemExists(java.lang.String name)
                   throws JMSException
Checks if a mapping exists for the specified name (i.e., if name maps to some item). Note that this method will return true even if the name is mapped to a null value.
Specified by:
itemExists in interface MapMessage
Parameters:
name - the name to use as a key
Returns:
true iff a value is associated with the specified name
Throws:
JMSException - if the mapping's existence is not checked due to some error.

clearBody

public void clearBody()
               throws JMSException
Clears out the message body. All other parts of the message are left untouched.
Specified by:
clearBody in interface Message
Overrides:
clearBody in class AQjmsMessage
Throws:
JMSException - if the message body is not cleared due to some error.

Oracle® Streams Advanced Queuing Java API Reference
10g Release 2 (10.2)

B14291-01


Copyright © 2003, 2005, Oracle. All rights reserved.