|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jmscts.jms.message.BasicMessage | +--org.exolab.jmscts.jms.message.BasicMapMessage
This class provides a basic implementation of the javax.jms.MapMessage interface.
MapMessage
Fields inherited from interface javax.jms.Message |
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
Constructor Summary | |
BasicMapMessage()
Construct a new BasicMapMessage |
Method Summary | |
void |
clearBody()
Clear out the message body. |
boolean |
getBoolean(java.lang.String name)
Return the boolean value with the given name |
byte |
getByte(java.lang.String name)
Return the byte value with the given name |
byte[] |
getBytes(java.lang.String name)
Return the byte array value with the given name |
char |
getChar(java.lang.String name)
Return the Unicode character value with the given name |
double |
getDouble(java.lang.String name)
Return the double value with the given name |
float |
getFloat(java.lang.String name)
Return the float value with the given name |
int |
getInt(java.lang.String name)
Return the integer value with the given name |
long |
getLong(java.lang.String name)
Return the long value with the given name |
java.util.Enumeration |
getMapNames()
Return an Enumeration of all the Map message's names. |
java.lang.Object |
getObject(java.lang.String name)
Return the Java object value with the given name |
short |
getShort(java.lang.String name)
Return the short value with the given name |
java.lang.String |
getString(java.lang.String name)
Return the String value with the given name |
boolean |
itemExists(java.lang.String name)
Check if an item exists in this MapMessage |
void |
setBoolean(java.lang.String name,
boolean value)
Set a boolean value with the given name, into the Map |
void |
setByte(java.lang.String name,
byte value)
Set a byte value with the given name, into the Map |
void |
setBytes(java.lang.String name,
byte[] value)
Set a byte array value with the given name, into the Map |
void |
setBytes(java.lang.String name,
byte[] value,
int offset,
int length)
Set a portion of the byte array value with the given name, into the Map |
void |
setChar(java.lang.String name,
char value)
Set a Unicode character value with the given name, into the Map |
void |
setDouble(java.lang.String name,
double value)
Set a double value with the given name, into the Map |
void |
setFloat(java.lang.String name,
float value)
Set a float value with the given name, into the Map |
void |
setInt(java.lang.String name,
int value)
Set an integer value with the given name, into the Map |
void |
setLong(java.lang.String name,
long value)
Set a long value with the given name, into the Map |
void |
setObject(java.lang.String name,
java.lang.Object value)
Set a Java object value with the given name, into the Map |
void |
setShort(java.lang.String name,
short value)
Set a short value with the given name, into the Map |
void |
setString(java.lang.String name,
java.lang.String value)
Set a String value with the given name, into the Map |
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, clearProperties, 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 |
Constructor Detail |
public BasicMapMessage()
BasicMapMessage
Method Detail |
public boolean getBoolean(java.lang.String name) throws javax.jms.MessageFormatException
getBoolean
in interface javax.jms.MapMessage
name
- the name of the booleanjavax.jms.MessageFormatException
- if the type conversion is invalidpublic byte getByte(java.lang.String name) throws javax.jms.MessageFormatException
getByte
in interface javax.jms.MapMessage
name
- the name of the bytejavax.jms.MessageFormatException
- if the type conversion is invalidpublic short getShort(java.lang.String name) throws javax.jms.MessageFormatException
getShort
in interface javax.jms.MapMessage
name
- the name of the shortjavax.jms.MessageFormatException
- if the type conversion is invalidpublic char getChar(java.lang.String name) throws javax.jms.MessageFormatException
getChar
in interface javax.jms.MapMessage
name
- the name of the Unicode characterjavax.jms.MessageFormatException
- if the type conversion is invalidpublic int getInt(java.lang.String name) throws javax.jms.MessageFormatException
getInt
in interface javax.jms.MapMessage
name
- the name of the integerjavax.jms.MessageFormatException
- if the type conversion is invalidpublic long getLong(java.lang.String name) throws javax.jms.MessageFormatException
getLong
in interface javax.jms.MapMessage
name
- the name of the longjavax.jms.MessageFormatException
- if the type conversion is invalidpublic float getFloat(java.lang.String name) throws javax.jms.MessageFormatException
getFloat
in interface javax.jms.MapMessage
name
- the name of the floatjavax.jms.MessageFormatException
- if the type conversion is invalidpublic double getDouble(java.lang.String name) throws javax.jms.MessageFormatException
getDouble
in interface javax.jms.MapMessage
name
- the name of the doublejavax.jms.MessageFormatException
- if the type conversion is invalidpublic java.lang.String getString(java.lang.String name) throws javax.jms.MessageFormatException
getString
in interface javax.jms.MapMessage
name
- the name of the Stringjavax.jms.MessageFormatException
- if the type conversion is invalidpublic byte[] getBytes(java.lang.String name) throws javax.jms.MessageFormatException
getBytes
in interface javax.jms.MapMessage
name
- the name of the byte arrayjavax.jms.MessageFormatException
- if the type conversion is invalidpublic java.lang.Object getObject(java.lang.String name) throws javax.jms.JMSException
Note that this method can be used to return in objectified format,
an object that had been stored in the Map with the equivalent
setObject
method call, or it's equivalent primitive
set
getObject
in interface javax.jms.MapMessage
name
- the name of the Java objectjavax.jms.JMSException
- if JMS fails to read the message due to some
internal JMS error
public java.util.Enumeration getMapNames()
getMapNames
in interface javax.jms.MapMessage
public void setBoolean(java.lang.String name, boolean value) throws javax.jms.MessageNotWriteableException
setBoolean
in interface javax.jms.MapMessage
name
- the name of the booleanvalue
- the boolean value to set in the Mapjavax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setByte(java.lang.String name, byte value) throws javax.jms.MessageNotWriteableException
setByte
in interface javax.jms.MapMessage
name
- the name of the bytevalue
- the byte value to set in the Mapjavax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setShort(java.lang.String name, short value) throws javax.jms.MessageNotWriteableException
setShort
in interface javax.jms.MapMessage
name
- the name of the shortvalue
- the short value to set in the Mapjavax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setChar(java.lang.String name, char value) throws javax.jms.MessageNotWriteableException
setChar
in interface javax.jms.MapMessage
name
- the name of the Unicode charactervalue
- the Unicode character value to set in the Mapjavax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setInt(java.lang.String name, int value) throws javax.jms.MessageNotWriteableException
setInt
in interface javax.jms.MapMessage
name
- the name of the integervalue
- the integer value to set in the Mapjavax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setLong(java.lang.String name, long value) throws javax.jms.MessageNotWriteableException
setLong
in interface javax.jms.MapMessage
name
- the name of the longvalue
- the long value to set in the Mapjavax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setFloat(java.lang.String name, float value) throws javax.jms.MessageNotWriteableException
setFloat
in interface javax.jms.MapMessage
name
- the name of the floatvalue
- the float value to set in the Mapjavax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setDouble(java.lang.String name, double value) throws javax.jms.MessageNotWriteableException
setDouble
in interface javax.jms.MapMessage
name
- the name of the doublevalue
- the double value to set in the Mapjavax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setString(java.lang.String name, java.lang.String value) throws javax.jms.MessageNotWriteableException
setString
in interface javax.jms.MapMessage
name
- the name of the Stringvalue
- the String value to set in the Mapjavax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setBytes(java.lang.String name, byte[] value) throws javax.jms.MessageNotWriteableException
setBytes
in interface javax.jms.MapMessage
name
- the name of the byte arrayvalue
- the byte array value to set in the Map. The array is
copied so the value for name will not be altered by future
modifications.javax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setBytes(java.lang.String name, byte[] value, int offset, int length) throws javax.jms.MessageNotWriteableException
setBytes
in interface javax.jms.MapMessage
name
- the name of the byte arrayvalue
- the byte array value to set in the Map.offset
- the initial offset within the byte array.length
- the number of bytes to use.javax.jms.MessageNotWriteableException
- if the message is in read-only modepublic void setObject(java.lang.String name, java.lang.Object value) throws javax.jms.MessageFormatException, javax.jms.MessageNotWriteableException
Note that this method only works for the objectified primitive object types (Integer, Double, Long ...), String's and byte arrays.
setObject
in interface javax.jms.MapMessage
name
- the name of the Java objectvalue
- the Java object value to set in the Mapjavax.jms.MessageFormatException
- if object is invalidjavax.jms.MessageNotWriteableException
- if message in read-only mode.public boolean itemExists(java.lang.String name)
itemExists
in interface javax.jms.MapMessage
name
- the name of the item to testpublic void clearBody() throws javax.jms.JMSException
clearBody
in interface javax.jms.Message
clearBody
in class BasicMessage
javax.jms.JMSException
- if the body can't be cleared
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |