|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.huihoo.jfox.ms.jms.message.MessageImpl
This class implements the JMS Message. The message class is the underlying object for all the JMS message items. This message class provides the basic functionality for message processing including header items and properties.
| Field Summary |
| Fields inherited from interface javax.jms.Message |
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
| Constructor Summary | |
MessageImpl()
|
|
| Method Summary | |
void |
acknowledge()
|
void |
clearBody()
Clears out the message body. |
void |
clearProperties()
Clears a message's properties. |
boolean |
getBooleanProperty(java.lang.String name)
Returns the value of the boolean property with the
specified name. |
byte |
getByteProperty(java.lang.String name)
Returns the value of the byte property with the specified
name. |
double |
getDoubleProperty(java.lang.String name)
Returns the value of the double property with the
specified name. |
float |
getFloatProperty(java.lang.String name)
Returns the value of the float property with the
specified name. |
int |
getIntProperty(java.lang.String name)
Returns the value of the int property with the specified
name. |
java.lang.String |
getJMSCorrelationID()
Gets the correlation ID for the message. |
byte[] |
getJMSCorrelationIDAsBytes()
Gets the correlation ID as an array of bytes for the message. |
int |
getJMSDeliveryMode()
Gets the DeliveryMode value specified for this message. |
javax.jms.Destination |
getJMSDestination()
Gets the Destination object for this message. |
long |
getJMSExpiration()
Gets the message's expiration value. |
java.lang.String |
getJMSMessageID()
Gets the message ID. |
int |
getJMSPriority()
Gets the message defaultPriority level. |
boolean |
getJMSRedelivered()
Gets an indication of whether this message is being redelivered. |
javax.jms.Destination |
getJMSReplyTo()
Gets the Destination object to which a reply to this
message should be sent. |
long |
getJMSTimestamp()
Gets the message timestamp. |
java.lang.String |
getJMSType()
Gets the message type identifier supplied by the client when the message was sent. |
long |
getLongProperty(java.lang.String name)
Returns the value of the long property with the specified
name. |
java.lang.Object |
getObjectProperty(java.lang.String name)
Returns the value of the Java object property with the specified name. |
java.util.Enumeration |
getPropertyNames()
Returns an Enumeration of all the property names.
|
short |
getShortProperty(java.lang.String name)
Returns the value of the short property with the
specified name. |
java.lang.String |
getStringProperty(java.lang.String name)
Returns the value of the String property with the
specified name. |
boolean |
isBodyModifiable()
Return true if the message body is modifiable, else it is in read-only mode. |
boolean |
isPropertiesModifiable()
Return true if the message properties are modifiable, else it is in read-only mode. |
boolean |
propertyExists(java.lang.String name)
Indicates whether a property value exists. |
void |
setBodyModifiable(boolean state)
Set the read only state of teh message body. |
void |
setBooleanProperty(java.lang.String name,
boolean value)
Sets a boolean property value with the specified name
into the message. |
void |
setByteProperty(java.lang.String name,
byte value)
Sets a byte property value with the specified name into
the message. |
void |
setDoubleProperty(java.lang.String name,
double value)
Sets a double property value with the specified name into
the message. |
void |
setFloatProperty(java.lang.String name,
float value)
Sets a float property value with the specified name into
the message. |
void |
setIntProperty(java.lang.String name,
int value)
Sets an int property value with the specified name into
the message. |
void |
setJMSCorrelationID(java.lang.String correlationID)
Sets the correlation ID for the message. |
void |
setJMSCorrelationIDAsBytes(byte[] correlationID)
Sets the correlation ID as an array of bytes for the message. |
void |
setJMSDeliveryMode(int deliveryMode)
Sets the DeliveryMode value for this message.
|
void |
setJMSDestination(javax.jms.Destination destination)
Sets the Destination object for this message.
|
void |
setJMSExpiration(long expiration)
Sets the message's expiration value. |
void |
setJMSMessageID(java.lang.String id)
Sets the message ID. |
void |
setJMSPriority(int priority)
Sets the defaultPriority level for this message. |
void |
setJMSRedelivered(boolean redelivered)
Specifies whether this message is being redelivered. |
void |
setJMSReplyTo(javax.jms.Destination replyTo)
Sets the Destination object to which a reply to this
message should be sent. |
void |
setJMSTimestamp(long timestamp)
Sets the message timestamp. |
void |
setJMSType(java.lang.String type)
Sets the message type. |
void |
setLongProperty(java.lang.String name,
long value)
Sets a long property value with the specified name into
the message. |
void |
setObjectProperty(java.lang.String name,
java.lang.Object value)
Sets a Java object property value with the specified name into the message. |
void |
setPropertiesModifiable(boolean state)
Set the read only state of the message properties. |
void |
setShortProperty(java.lang.String name,
short value)
Sets a short property value with the specified name into
the message. |
void |
setStringProperty(java.lang.String name,
java.lang.String value)
Sets a String property value with the specified name into
the message. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MessageImpl()
| Method Detail |
public java.lang.String getJMSMessageID()
throws javax.jms.JMSException
getJMSMessageID in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to get the message ID due to
some internal error.Message.setJMSMessageID(String),
MessageProducer.setDisableMessageID(boolean)
public void setJMSMessageID(java.lang.String id)
throws javax.jms.JMSException
setJMSMessageID in interface javax.jms.Messageid - the ID of the message
javax.jms.JMSException - if the JMS provider fails to set the message ID due to
some internal error.Message.getJMSMessageID()
public long getJMSTimestamp()
throws javax.jms.JMSException
getJMSTimestamp in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to get the timestamp due to
some internal error.Message.setJMSTimestamp(long),
MessageProducer.setDisableMessageTimestamp(boolean)
public void setJMSTimestamp(long timestamp)
throws javax.jms.JMSException
JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.
setJMSTimestamp in interface javax.jms.Messagetimestamp - the timestamp for this message
javax.jms.JMSException - if the JMS provider fails to set the timestamp due to
some internal error.Message.getJMSTimestamp()
public byte[] getJMSCorrelationIDAsBytes()
throws javax.jms.JMSException
The use of a byte[] value for JMSCorrelationID
is non-portable.
getJMSCorrelationIDAsBytes in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to get the correlation ID due
to some internal error.Message.setJMSCorrelationID(String),
Message.getJMSCorrelationID(),
Message.setJMSCorrelationIDAsBytes(byte[])
public void setJMSCorrelationIDAsBytes(byte[] correlationID)
throws javax.jms.JMSException
The array is copied before the method returns, so future modifications to the array will not alter this message header.
The use of a byte[] value for JMSCorrelationID
is non-portable.
setJMSCorrelationIDAsBytes in interface javax.jms.MessagecorrelationID - the correlation ID value as an array of bytes
javax.jms.JMSException - if the JMS provider fails to set the correlation ID due
to some internal error.Message.setJMSCorrelationID(String),
Message.getJMSCorrelationID(),
Message.getJMSCorrelationIDAsBytes()
public java.lang.String getJMSCorrelationID()
throws javax.jms.JMSException
This method is used to return correlation ID values that are either
provider-specific message IDs or application-specific String
values.
getJMSCorrelationID in interface javax.jms.MessageString
javax.jms.JMSException - if the JMS provider fails to get the correlation ID due
to some internal error.Message.setJMSCorrelationID(String),
Message.getJMSCorrelationIDAsBytes(),
Message.setJMSCorrelationIDAsBytes(byte[])
public void setJMSCorrelationID(java.lang.String correlationID)
throws javax.jms.JMSException
setJMSCorrelationID in interface javax.jms.MessagecorrelationID - the message ID of a message being referred to
javax.jms.JMSException - if the JMS provider fails to set the correlation ID due
to some internal error.Message.getJMSCorrelationID(),
Message.getJMSCorrelationIDAsBytes(),
Message.setJMSCorrelationIDAsBytes(byte[])
public javax.jms.Destination getJMSReplyTo()
throws javax.jms.JMSException
Destination object to which a reply to this
message should be sent.
getJMSReplyTo in interface javax.jms.MessageDestination to which to send a response to this
message
javax.jms.JMSException - if the JMS provider fails to get the JMSReplyTo
destination due to some internal error.Message.setJMSReplyTo(Destination)
public void setJMSReplyTo(javax.jms.Destination replyTo)
throws javax.jms.JMSException
Destination object to which a reply to this
message should be sent.
setJMSReplyTo in interface javax.jms.MessagereplyTo - Destination to which to send a response to
this message
javax.jms.JMSException - if the JMS provider fails to set the JMSReplyTo
destination due to some internal error.Message.getJMSReplyTo()
public javax.jms.Destination getJMSDestination()
throws javax.jms.JMSException
Destination object for this message.
getJMSDestination in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to get the destination due to
some internal error.Message.setJMSDestination(Destination)
public void setJMSDestination(javax.jms.Destination destination)
throws javax.jms.JMSException
Destination object for this message.
JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.
setJMSDestination in interface javax.jms.Messagedestination - the destination for this message
javax.jms.JMSException - if the JMS provider fails to set the destination due to
some internal error.Message.getJMSDestination()
public int getJMSDeliveryMode()
throws javax.jms.JMSException
DeliveryMode value specified for this message.
getJMSDeliveryMode in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to get the delivery mode due to
some internal error.Message.setJMSDeliveryMode(int),
DeliveryMode
public void setJMSDeliveryMode(int deliveryMode)
throws javax.jms.JMSException
DeliveryMode value for this message.
JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.
setJMSDeliveryMode in interface javax.jms.MessagedeliveryMode - the delivery mode for this message
javax.jms.JMSException - if the JMS provider fails to set the delivery mode due to
some internal error.Message.getJMSDeliveryMode(),
DeliveryMode
public boolean getJMSRedelivered()
throws javax.jms.JMSException
If a client receives a message with the JMSRedelivered
field set, it is likely, but not guaranteed, that this message was
delivered earlier but that its receipt was not acknowledged at that
time.
getJMSRedelivered in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to get the redelivered state
due to some internal error.Message.setJMSRedelivered(boolean)
public void setJMSRedelivered(boolean redelivered)
throws javax.jms.JMSException
This field is set at the time the message is delivered. This method can be used to change the value for a message that has been received.
setJMSRedelivered in interface javax.jms.Messageredelivered - an indication of whether this message is being redelivered
javax.jms.JMSException - if the JMS provider fails to set the redelivered state
due to some internal error.Message.getJMSRedelivered()
public java.lang.String getJMSType()
throws javax.jms.JMSException
getJMSType in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to get the message type due to
some internal error.Message.setJMSType(String)
public void setJMSType(java.lang.String type)
throws javax.jms.JMSException
setJMSType in interface javax.jms.Messagetype - the message type
javax.jms.JMSException - if the JMS provider fails to set the message type due to
some internal error.Message.getJMSType()
public long getJMSExpiration()
throws javax.jms.JMSException
getJMSExpiration in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to get the message expiration
due to some internal error.Message.setJMSExpiration(long)
public void setJMSExpiration(long expiration)
throws javax.jms.JMSException
JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.
setJMSExpiration in interface javax.jms.Messageexpiration - the message's expiration time
javax.jms.JMSException - if the JMS provider fails to set the message expiration
due to some internal error.Message.getJMSExpiration()
public int getJMSPriority()
throws javax.jms.JMSException
The JMS API defines ten levels of defaultPriority value, with 0 as the lowest defaultPriority and 9 as the highest. In addition, clients should consider priorities 0-4 as gradations of normal defaultPriority and priorities 5-9 as gradations of expedited defaultPriority.
getJMSPriority in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to get the message
defaultPriority due to some internal error.Message.setJMSPriority(int)
public void setJMSPriority(int priority)
throws javax.jms.JMSException
JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received.
setJMSPriority in interface javax.jms.Messagepriority - the defaultPriority of this message
javax.jms.JMSException - if the JMS provider fails to set the message
defaultPriority due to some internal error.Message.getJMSPriority()
public void clearProperties()
throws javax.jms.JMSException
clearProperties in interface javax.jms.Messagejavax.jms.JMSException - if an error occurs while clearing the properties.Message.clearProperties()
public boolean propertyExists(java.lang.String name)
throws javax.jms.JMSException
propertyExists in interface javax.jms.Messagejavax.jms.JMSException - if an error occurs while clearing the properties.Message.propertyExists(String)
public boolean getBooleanProperty(java.lang.String name)
throws javax.jms.JMSException
boolean property with the
specified name.
getBooleanProperty in interface javax.jms.Messagename - the name of the boolean property
boolean property value for the specified name
javax.jms.JMSException - if the JMS provider fails to get the property value due
to some internal error.
MessageFormatException - if this type conversion is invalid.
public byte getByteProperty(java.lang.String name)
throws javax.jms.JMSException
byte property with the specified
name.
getByteProperty in interface javax.jms.Messagename - the name of the byte property
byte property value for the specified name
javax.jms.JMSException - if the JMS provider fails to get the property value due
to some internal error.
MessageFormatException - if this type conversion is invalid.
public short getShortProperty(java.lang.String name)
throws javax.jms.JMSException
short property with the
specified name.
getShortProperty in interface javax.jms.Messagename - the name of the short property
short property value for the specified name
javax.jms.JMSException - if the JMS provider fails to get the property value due
to some internal error.
MessageFormatException - if this type conversion is invalid.
public int getIntProperty(java.lang.String name)
throws javax.jms.JMSException
int property with the specified
name.
getIntProperty in interface javax.jms.Messagename - the name of the int property
int property value for the specified name
javax.jms.JMSException - if the JMS provider fails to get the property value due
to some internal error.
MessageFormatException - if this type conversion is invalid.
public long getLongProperty(java.lang.String name)
throws javax.jms.JMSException
long property with the specified
name.
getLongProperty in interface javax.jms.Messagename - the name of the long property
long property value for the specified name
javax.jms.JMSException - if the JMS provider fails to get the property value due
to some internal error.
MessageFormatException - if this type conversion is invalid.
public float getFloatProperty(java.lang.String name)
throws javax.jms.JMSException
float property with the
specified name.
getFloatProperty in interface javax.jms.Messagename - the name of the float property
float property value for the specified name
javax.jms.JMSException - if the JMS provider fails to get the property value due
to some internal error.
MessageFormatException - if this type conversion is invalid.
public double getDoubleProperty(java.lang.String name)
throws javax.jms.JMSException
double property with the
specified name.
getDoubleProperty in interface javax.jms.Messagename - the name of the double property
double property value for the specified name
javax.jms.JMSException - if the JMS provider fails to get the property value due
to some internal error.
MessageFormatException - if this type conversion is invalid.
public java.lang.String getStringProperty(java.lang.String name)
throws javax.jms.JMSException
String property with the
specified name.
getStringProperty in interface javax.jms.Messagename - the name of the String property
String property value for the specified name;
if there is no property by this name, a null value is returned
javax.jms.JMSException - if the JMS provider fails to get the property value due
to some internal error.
MessageFormatException - if this type conversion is invalid.
public java.lang.Object getObjectProperty(java.lang.String name)
throws javax.jms.JMSException
This method can be used to return, in objectified format, an object that
has been stored as a property in the message with the equivalent
setObjectProperty method call, or its equivalent primitive
set type Property method.
getObjectProperty in interface javax.jms.Messagename - the name of the Java object property
int, an Integer is returned); if
there is no property by this name, a null value is returned
javax.jms.JMSException - if the JMS provider fails to get the property value due
to some internal error.
public java.util.Enumeration getPropertyNames()
throws javax.jms.JMSException
Enumeration of all the property names.
Note that JMS standard header fields are not considered properties and are not returned in this enumeration.
getPropertyNames in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to get the property names due
to some internal error.
public void setBooleanProperty(java.lang.String name,
boolean value)
throws javax.jms.JMSException
boolean property value with the specified name
into the message.
setBooleanProperty in interface javax.jms.Messagename - the name of the boolean propertyvalue - the boolean property value to set
javax.jms.JMSException - if the JMS provider fails to set the property due to some
internal error.
javax.jms.MessageNotWriteableException - if properties are read-only
public void setByteProperty(java.lang.String name,
byte value)
throws javax.jms.JMSException
byte property value with the specified name into
the message.
setByteProperty in interface javax.jms.Messagename - the name of the byte propertyvalue - the byte property value to set
javax.jms.JMSException - if the JMS provider fails to set the property due to some
internal error.
javax.jms.MessageNotWriteableException - if properties are read-only
public void setShortProperty(java.lang.String name,
short value)
throws javax.jms.JMSException
short property value with the specified name into
the message.
setShortProperty in interface javax.jms.Messagename - the name of the short propertyvalue - the short property value to set
javax.jms.JMSException - if the JMS provider fails to set the property due to some
internal error.
javax.jms.MessageNotWriteableException - if properties are read-only
public void setIntProperty(java.lang.String name,
int value)
throws javax.jms.JMSException
int property value with the specified name into
the message.
setIntProperty in interface javax.jms.Messagename - the name of the int propertyvalue - the int property value to set
javax.jms.JMSException - if the JMS provider fails to set the property due to some
internal error.
javax.jms.MessageNotWriteableException - if properties are read-only
public void setLongProperty(java.lang.String name,
long value)
throws javax.jms.JMSException
long property value with the specified name into
the message.
setLongProperty in interface javax.jms.Messagename - the name of the long propertyvalue - the long property value to set
javax.jms.JMSException - if the JMS provider fails to set the property due to some
internal error.
javax.jms.MessageNotWriteableException - if properties are read-only
public void setFloatProperty(java.lang.String name,
float value)
throws javax.jms.JMSException
float property value with the specified name into
the message.
setFloatProperty in interface javax.jms.Messagename - the name of the float propertyvalue - the float property value to set
javax.jms.JMSException - if the JMS provider fails to set the property due to some
internal error.
javax.jms.MessageNotWriteableException - if properties are read-only
public void setDoubleProperty(java.lang.String name,
double value)
throws javax.jms.JMSException
double property value with the specified name into
the message.
setDoubleProperty in interface javax.jms.Messagename - the name of the double propertyvalue - the double property value to set
javax.jms.JMSException - if the JMS provider fails to set the property due to some
internal error.
javax.jms.MessageNotWriteableException - if properties are read-only
public void setStringProperty(java.lang.String name,
java.lang.String value)
throws javax.jms.JMSException
String property value with the specified name into
the message.
setStringProperty in interface javax.jms.Messagename - the name of the String propertyvalue - the String property value to set
javax.jms.JMSException - if the JMS provider fails to set the property due to some
internal error.
javax.jms.MessageNotWriteableException - if properties are read-only
public void setObjectProperty(java.lang.String name,
java.lang.Object value)
throws javax.jms.JMSException
Note that this method works only for the objectified primitive object
types (Integer,Double,Long
...) and String objects.
setObjectProperty in interface javax.jms.Messagename - the name of the Java object propertyvalue - the Java object property value to set
javax.jms.JMSException - if the JMS provider fails to set the property due to some
internal error.
MessageFormatException - if the object is invalid
javax.jms.MessageNotWriteableException - if properties are read-only
public void acknowledge()
throws javax.jms.JMSException
acknowledge in interface javax.jms.Messagejavax.jms.JMSExceptionMessage.acknowledge()
public void clearBody()
throws javax.jms.JMSException
If this message body was read-only, calling this method leaves the message body in the same state as an empty body in a newly created message.
clearBody in interface javax.jms.Messagejavax.jms.JMSException - if the JMS provider fails to clear the message body due
to some internal error.public void setPropertiesModifiable(boolean state)
state - false if the message properties are read-only, true if the
message properties can be modified.public boolean isPropertiesModifiable()
public void setBodyModifiable(boolean state)
state - false if the message body are read-only, true if the message
body can be modified.public boolean isBodyModifiable()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||