|
Joram 5.2.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.client.jms.Message
public class Message
Implements the javax.jms.Message
interface.
A Joram message encapsulates a proprietary message which is also used for effective MOM transport facility.
Field Summary | |
---|---|
protected javax.jms.Destination |
jmsDest
The JMSDestination field. |
static org.objectweb.util.monolog.api.Logger |
logger
logger |
protected Message |
momMsg
|
boolean |
propertiesRO
true if the properties are read-only. |
protected boolean |
RObody
true if the message body is read-only. |
protected Session |
session
If the message is actually consumed, the session that consumes it, null otherwise. |
Fields inherited from interface javax.jms.Message |
---|
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
Constructor Summary | |
---|---|
protected |
Message()
Constructs a bright new Message . |
protected |
Message(Session session,
Message momMsg)
Instantiates a Message wrapping a consumed
MOM simple message. |
Method Summary | |
---|---|
void |
acknowledge()
API method. |
void |
clearBody()
API method. |
void |
clearProperties()
API method. |
static Message |
convertJMSMessage(javax.jms.Message jmsMsg)
Converts a non-Joram JMS message into a Joram message. |
boolean |
getBooleanProperty(java.lang.String name)
API method. |
byte |
getByteProperty(java.lang.String name)
API method. |
double |
getDoubleProperty(java.lang.String name)
API method. |
float |
getFloatProperty(java.lang.String name)
API method. |
int |
getIntProperty(java.lang.String name)
API method. |
java.lang.String |
getJMSCorrelationID()
Returns the message correlation identifier. |
byte[] |
getJMSCorrelationIDAsBytes()
API method. |
int |
getJMSDeliveryMode()
Returns true if the message is persistent. |
javax.jms.Destination |
getJMSDestination()
Returns the message destination. |
long |
getJMSExpiration()
Returns the message expiration time. |
java.lang.String |
getJMSMessageID()
Returns the message identifier. |
int |
getJMSPriority()
Returns the message priority. |
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()
Returns the message time stamp. |
java.lang.String |
getJMSType()
API method. |
long |
getLongProperty(java.lang.String name)
API method. |
Message |
getMomMsg()
|
java.lang.Object |
getObjectProperty(java.lang.String name)
API method. |
void |
getOptionalHeader(java.util.Hashtable h)
Copies all of the mappings from the optionalHeader of this message to the specified hashtable. |
void |
getProperties(java.util.Hashtable h)
Copies all of the mappings from the properties of this message to the specified hashtable. |
java.util.Enumeration |
getPropertyNames()
API method. |
short |
getShortProperty(java.lang.String name)
API method. |
java.lang.String |
getStringProperty(java.lang.String name)
API method. |
protected void |
prepare()
Method preparing the message for sending; resets header values, and serializes the body (done in subclasses). |
boolean |
propertyExists(java.lang.String name)
API method. |
void |
resetPropertiesRO()
Resets the read-only flag, in order to allow the modification of message properties. |
void |
setBooleanProperty(java.lang.String name,
boolean value)
API method. |
void |
setByteProperty(java.lang.String name,
byte value)
API method. |
void |
setDoubleProperty(java.lang.String name,
double value)
API method. |
void |
setFloatProperty(java.lang.String name,
float value)
API method. |
void |
setIntProperty(java.lang.String name,
int value)
API method. |
void |
setJMSCorrelationID(java.lang.String correlationID)
API method. |
void |
setJMSCorrelationIDAsBytes(byte[] correlationID)
API method. |
void |
setJMSDeliveryMode(int deliveryMode)
API method. |
void |
setJMSDestination(javax.jms.Destination dest)
Set the message destination. |
void |
setJMSExpiration(long expiration)
API method. |
void |
setJMSMessageID(java.lang.String id)
API method. |
void |
setJMSPriority(int priority)
API method. |
void |
setJMSRedelivered(boolean redelivered)
API method. |
void |
setJMSReplyTo(javax.jms.Destination replyTo)
API method. |
void |
setJMSTimestamp(long timestamp)
API method. |
void |
setJMSType(java.lang.String type)
API method. |
void |
setLongProperty(java.lang.String name,
long value)
API method. |
void |
setObjectProperty(java.lang.String name,
java.lang.Object value)
API method, sets a property value. |
void |
setReadOnly()
set message read-only |
void |
setShortProperty(java.lang.String name,
short value)
API method. |
void |
setStringProperty(java.lang.String name,
java.lang.String value)
API method. |
java.lang.String |
toString()
|
void |
toString(java.lang.StringBuffer strbuf)
|
static Message |
wrapMomMessage(Session session,
Message momMsg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static org.objectweb.util.monolog.api.Logger logger
protected Message momMsg
protected transient Session session
null
otherwise.
protected transient javax.jms.Destination jmsDest
protected boolean RObody
true
if the message body is read-only.
public boolean propertiesRO
true
if the properties are read-only.
Constructor Detail |
---|
protected Message()
Message
.
protected Message(Session session, Message momMsg)
Message
wrapping a consumed
MOM simple message.
session
- The consuming session.momMsg
- The MOM message to wrap.Method Detail |
---|
public static Message wrapMomMessage(Session session, Message momMsg) throws javax.jms.JMSException
javax.jms.JMSException
public void acknowledge() throws javax.jms.JMSException
acknowledge
in interface javax.jms.Message
javax.jms.IllegalStateException
- If the session is closed.
javax.jms.JMSException
- If the acknowledgement fails for any other
reason.public void clearBody() throws javax.jms.JMSException
clearBody
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public void setReadOnly()
public final java.lang.String getJMSMessageID() throws javax.jms.JMSException
getJMSMessageID
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setJMSMessageID(java.lang.String id) throws javax.jms.JMSException
setJMSMessageID
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final int getJMSPriority() throws javax.jms.JMSException
getJMSPriority
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setJMSPriority(int priority) throws javax.jms.JMSException
setJMSPriority
in interface javax.jms.Message
javax.jms.JMSException
- If the priority value is incorrect.public final javax.jms.Destination getJMSDestination() throws javax.jms.JMSException
Session.send()
, it can be overloaded
for received messages.
API method.
getJMSDestination
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setJMSDestination(javax.jms.Destination dest) throws javax.jms.JMSException
setJMSDestination
in interface javax.jms.Message
javax.jms.JMSException
- If the destination id not a Joram's one.public final long getJMSExpiration() throws javax.jms.JMSException
getJMSExpiration
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setJMSExpiration(long expiration) throws javax.jms.JMSException
setJMSExpiration
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final boolean getJMSRedelivered() throws javax.jms.JMSException
getJMSRedelivered
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setJMSRedelivered(boolean redelivered) throws javax.jms.JMSException
setJMSRedelivered
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final javax.jms.Destination getJMSReplyTo() throws javax.jms.JMSException
getJMSReplyTo
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setJMSReplyTo(javax.jms.Destination replyTo) throws javax.jms.JMSException
setJMSReplyTo
in interface javax.jms.Message
javax.jms.JMSException
- If the destination id not a Joram's one.public final long getJMSTimestamp() throws javax.jms.JMSException
getJMSTimestamp
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setJMSTimestamp(long timestamp) throws javax.jms.JMSException
setJMSTimestamp
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final java.lang.String getJMSCorrelationID() throws javax.jms.JMSException
getJMSCorrelationID
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setJMSCorrelationID(java.lang.String correlationID) throws javax.jms.JMSException
setJMSCorrelationID
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final byte[] getJMSCorrelationIDAsBytes() throws javax.jms.JMSException
getJMSCorrelationIDAsBytes
in interface javax.jms.Message
javax.jms.MessageFormatException
- In case of a problem while retrieving
the field.
javax.jms.JMSException
public final void setJMSCorrelationIDAsBytes(byte[] correlationID)
setJMSCorrelationIDAsBytes
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final int getJMSDeliveryMode() throws javax.jms.JMSException
true
if the message is persistent.
API method.
getJMSDeliveryMode
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setJMSDeliveryMode(int deliveryMode) throws javax.jms.JMSException
setJMSDeliveryMode
in interface javax.jms.Message
javax.jms.JMSException
- If the delivery mode is incorrect.public final java.lang.String getJMSType() throws javax.jms.JMSException
getJMSType
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setJMSType(java.lang.String type) throws javax.jms.JMSException
setJMSType
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public void getOptionalHeader(java.util.Hashtable h)
public final void clearProperties() throws javax.jms.JMSException
clearProperties
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void resetPropertiesRO() throws javax.jms.JMSException
javax.jms.JMSException
- Actually never thrown.public final boolean propertyExists(java.lang.String name) throws javax.jms.JMSException
propertyExists
in interface javax.jms.Message
name
- The property name.
javax.jms.JMSException
- Actually never thrown.public void getProperties(java.util.Hashtable h)
public final java.util.Enumeration getPropertyNames() throws javax.jms.JMSException
getPropertyNames
in interface javax.jms.Message
javax.jms.JMSException
- Actually never thrown.public final void setBooleanProperty(java.lang.String name, boolean value) throws javax.jms.JMSException
setBooleanProperty
in interface javax.jms.Message
name
- The property name.value
- The property value.
javax.jms.MessageNotWriteableException
- If the message is read-only.
javax.jms.JMSException
- If the property name is invalid.public final void setByteProperty(java.lang.String name, byte value) throws javax.jms.JMSException
setByteProperty
in interface javax.jms.Message
name
- The property name.value
- The property value.
javax.jms.MessageNotWriteableException
- If the message is read-only.
javax.jms.JMSException
- If the property name is invalid.public final void setShortProperty(java.lang.String name, short value) throws javax.jms.JMSException
setShortProperty
in interface javax.jms.Message
name
- The property name.value
- The property value.
javax.jms.MessageNotWriteableException
- If the message is read-only.
javax.jms.JMSException
- If the property name is invalid.public final void setIntProperty(java.lang.String name, int value) throws javax.jms.JMSException
setIntProperty
in interface javax.jms.Message
name
- The property name.value
- The property value.
javax.jms.MessageNotWriteableException
- If the message is read-only.
javax.jms.JMSException
- If the property name is invalid.public final void setLongProperty(java.lang.String name, long value) throws javax.jms.JMSException
setLongProperty
in interface javax.jms.Message
name
- The property name.value
- The property value.
javax.jms.MessageNotWriteableException
- If the message is read-only.
javax.jms.JMSException
- If the property name is invalid.public final void setFloatProperty(java.lang.String name, float value) throws javax.jms.JMSException
setFloatProperty
in interface javax.jms.Message
name
- The property name.value
- The property value.
javax.jms.MessageNotWriteableException
- If the message is read-only.
javax.jms.JMSException
- If the property name is invalid.public final void setDoubleProperty(java.lang.String name, double value) throws javax.jms.JMSException
setDoubleProperty
in interface javax.jms.Message
name
- The property name.value
- The property value.
javax.jms.MessageNotWriteableException
- If the message is read-only.
javax.jms.JMSException
- If the property name is invalid.public final void setStringProperty(java.lang.String name, java.lang.String value) throws javax.jms.JMSException
setStringProperty
in interface javax.jms.Message
name
- The property name.value
- The property value.
javax.jms.MessageNotWriteableException
- If the message is read-only.
javax.jms.JMSException
- If the property name is invalid.public final void setObjectProperty(java.lang.String name, java.lang.Object value) throws javax.jms.JMSException
setObjectProperty
in interface javax.jms.Message
name
- The property name.value
- The property value.
MessageROException
- If the message properties are read-only.
javax.jms.MessageFormatException
- If the value is not a Java primitive object.
java.lang.IllegalArgumentException
- If the key name is illegal (null or empty string).
javax.jms.MessageFormatException
- If the property type is invalid.
javax.jms.MessageNotWriteableException
- If the message is read-only.
javax.jms.JMSException
- If the property name is invalid, or if the
object is invalid.public final boolean getBooleanProperty(java.lang.String name) throws javax.jms.JMSException
getBooleanProperty
in interface javax.jms.Message
name
- The property name.
javax.jms.MessageFormatException
- If the property type is invalid.
javax.jms.JMSException
- If the name is invalid.public final byte getByteProperty(java.lang.String name) throws javax.jms.JMSException
getByteProperty
in interface javax.jms.Message
name
- The property name.
javax.jms.MessageFormatException
- If the property type is invalid.
javax.jms.JMSException
- If the name is invalid.public final short getShortProperty(java.lang.String name) throws javax.jms.JMSException
getShortProperty
in interface javax.jms.Message
name
- The property name.
javax.jms.MessageFormatException
- If the property type is invalid.
javax.jms.JMSException
- If the name is invalid.public final int getIntProperty(java.lang.String name) throws javax.jms.JMSException
getIntProperty
in interface javax.jms.Message
name
- The property name.
javax.jms.MessageFormatException
- If the property type is invalid.
javax.jms.JMSException
- If the name is invalid.public final long getLongProperty(java.lang.String name) throws javax.jms.JMSException
getLongProperty
in interface javax.jms.Message
name
- The property name.
javax.jms.MessageFormatException
- If the property type is invalid.
javax.jms.JMSException
- If the name is invalid.public final float getFloatProperty(java.lang.String name) throws javax.jms.JMSException
getFloatProperty
in interface javax.jms.Message
name
- The property name.
javax.jms.MessageFormatException
- If the property type is invalid.
javax.jms.JMSException
- If the name is invalid.public final double getDoubleProperty(java.lang.String name) throws javax.jms.JMSException
getDoubleProperty
in interface javax.jms.Message
name
- The property name.
javax.jms.MessageFormatException
- If the property type is invalid.
javax.jms.JMSException
- If the name is invalid.public final java.lang.String getStringProperty(java.lang.String name) throws javax.jms.JMSException
getStringProperty
in interface javax.jms.Message
name
- The property name.
javax.jms.MessageFormatException
- If the property type is invalid.
javax.jms.JMSException
- If the name is invalid.public final java.lang.Object getObjectProperty(java.lang.String name) throws javax.jms.JMSException
getObjectProperty
in interface javax.jms.Message
name
- The property name.
javax.jms.JMSException
- If the name is invalid.public static Message convertJMSMessage(javax.jms.Message jmsMsg) throws javax.jms.JMSException
javax.jms.JMSException
- If an error occurs while building the message.protected void prepare() throws javax.jms.JMSException
javax.jms.MessageFormatException
- If an error occurs while serializing.
javax.jms.JMSException
public Message getMomMsg()
public java.lang.String toString()
toString
in class java.lang.Object
public void toString(java.lang.StringBuffer strbuf)
|
Joram 5.2.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |