Joram ${version}

org.objectweb.joram.client.jms
Class Message

java.lang.Object
  extended byorg.objectweb.joram.client.jms.Message
All Implemented Interfaces:
javax.jms.Message
Direct Known Subclasses:
BytesMessage, MapMessage, ObjectMessage, StreamMessage, TextMessage

public class Message
extends java.lang.Object
implements javax.jms.Message

Implements the javax.jms.Message interface.

A Joram message wraps a proprietary MOM message which is actually the effective MOM transport facility for the JMS operations.


Field Summary
protected  Message momMsg
          The wrapped MOM message.
protected  Session sess
          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
 
Method Summary
 void acknowledge()
          API method.
 void clearBody()
          API method.
 void clearProperties()
          API method.
 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()
          API method.
 byte[] getJMSCorrelationIDAsBytes()
          API method.
 int getJMSDeliveryMode()
          API method.
 javax.jms.Destination getJMSDestination()
          API method.
 long getJMSExpiration()
          API method.
 java.lang.String getJMSMessageID()
          API method.
 int getJMSPriority()
          API method.
 boolean getJMSRedelivered()
          API method.
 javax.jms.Destination getJMSReplyTo()
          API method.
 long getJMSTimestamp()
          API method.
 java.lang.String getJMSType()
          API method.
 long getLongProperty(java.lang.String name)
          API method.
 java.lang.Object getObjectProperty(java.lang.String name)
          API method.
 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 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)
          API method.
 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.
 void setShortProperty(java.lang.String name, short value)
          API method.
 void setStringProperty(java.lang.String name, java.lang.String value)
          API method.
static Message wrapMomMessage(Session sess, Message momMsg)
          Wraps a given MOM message in the appropriate Joram message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

momMsg

protected Message momMsg
The wrapped MOM message.


sess

protected Session sess
If the message is actually consumed, the session that consumes it, null otherwise.

Method Detail

acknowledge

public void acknowledge()
                 throws javax.jms.JMSException
API method.

Specified by:
acknowledge in interface javax.jms.Message
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException - If the acknowledgement fails for any other reason.

clearBody

public void clearBody()
               throws javax.jms.JMSException
API method.

Specified by:
clearBody in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

clearProperties

public void clearProperties()
                     throws javax.jms.JMSException
API method.

Specified by:
clearProperties in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

propertyExists

public boolean propertyExists(java.lang.String name)
                       throws javax.jms.JMSException
API method.

Specified by:
propertyExists in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getPropertyNames

public java.util.Enumeration getPropertyNames()
                                       throws javax.jms.JMSException
API method.

Specified by:
getPropertyNames in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

setJMSMessageID

public void setJMSMessageID(java.lang.String id)
                     throws javax.jms.JMSException
API method.

Specified by:
setJMSMessageID in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

setJMSPriority

public void setJMSPriority(int priority)
                    throws javax.jms.JMSException
API method.

Specified by:
setJMSPriority in interface javax.jms.Message
Throws:
javax.jms.JMSException - If the priority value is incorrect.

setJMSDestination

public void setJMSDestination(javax.jms.Destination dest)
                       throws javax.jms.JMSException
API method.

Specified by:
setJMSDestination in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

setJMSExpiration

public void setJMSExpiration(long expiration)
                      throws javax.jms.JMSException
API method.

Specified by:
setJMSExpiration in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

setJMSRedelivered

public void setJMSRedelivered(boolean redelivered)
                       throws javax.jms.JMSException
API method.

Specified by:
setJMSRedelivered in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

setJMSReplyTo

public void setJMSReplyTo(javax.jms.Destination replyTo)
                   throws javax.jms.JMSException
API method.

Specified by:
setJMSReplyTo in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

setJMSTimestamp

public void setJMSTimestamp(long timestamp)
                     throws javax.jms.JMSException
API method.

Specified by:
setJMSTimestamp in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

setJMSCorrelationID

public void setJMSCorrelationID(java.lang.String correlationID)
                         throws javax.jms.JMSException
API method.

Specified by:
setJMSCorrelationID in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

setJMSCorrelationIDAsBytes

public void setJMSCorrelationIDAsBytes(byte[] correlationID)
API method.

Specified by:
setJMSCorrelationIDAsBytes in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

setJMSType

public void setJMSType(java.lang.String type)
                throws javax.jms.JMSException
API method.

Specified by:
setJMSType in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

setJMSDeliveryMode

public void setJMSDeliveryMode(int deliveryMode)
                        throws javax.jms.JMSException
API method.

Specified by:
setJMSDeliveryMode in interface javax.jms.Message
Throws:
javax.jms.JMSException - If the delivery mode is incorrect.

getJMSMessageID

public java.lang.String getJMSMessageID()
                                 throws javax.jms.JMSException
API method.

Specified by:
getJMSMessageID in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getJMSPriority

public int getJMSPriority()
                   throws javax.jms.JMSException
API method.

Specified by:
getJMSPriority in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getJMSDeliveryMode

public int getJMSDeliveryMode()
                       throws javax.jms.JMSException
API method.

Specified by:
getJMSDeliveryMode in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getJMSDestination

public javax.jms.Destination getJMSDestination()
                                        throws javax.jms.JMSException
API method.

Specified by:
getJMSDestination in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getJMSExpiration

public long getJMSExpiration()
                      throws javax.jms.JMSException
API method.

Specified by:
getJMSExpiration in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getJMSRedelivered

public boolean getJMSRedelivered()
                          throws javax.jms.JMSException
API method.

Specified by:
getJMSRedelivered in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getJMSReplyTo

public javax.jms.Destination getJMSReplyTo()
                                    throws javax.jms.JMSException
API method.

Specified by:
getJMSReplyTo in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getJMSTimestamp

public long getJMSTimestamp()
                     throws javax.jms.JMSException
API method.

Specified by:
getJMSTimestamp in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getJMSType

public java.lang.String getJMSType()
                            throws javax.jms.JMSException
API method.

Specified by:
getJMSType in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getJMSCorrelationID

public java.lang.String getJMSCorrelationID()
                                     throws javax.jms.JMSException
API method.

Specified by:
getJMSCorrelationID in interface javax.jms.Message
Throws:
javax.jms.JMSException - Actually never thrown.

getJMSCorrelationIDAsBytes

public byte[] getJMSCorrelationIDAsBytes()
                                  throws javax.jms.JMSException
API method.

Specified by:
getJMSCorrelationIDAsBytes in interface javax.jms.Message
Throws:
javax.jms.MessageFormatException - In case of a problem while retrieving the field.
javax.jms.JMSException

setBooleanProperty

public void setBooleanProperty(java.lang.String name,
                               boolean value)
                        throws javax.jms.JMSException
API method.

Specified by:
setBooleanProperty in interface javax.jms.Message
Throws:
javax.jms.MessageNotWriteableException - If the message is read-only.
javax.jms.JMSException - If the property name is invalid.

setByteProperty

public void setByteProperty(java.lang.String name,
                            byte value)
                     throws javax.jms.JMSException
API method.

Specified by:
setByteProperty in interface javax.jms.Message
Throws:
javax.jms.MessageNotWriteableException - If the message is read-only.
javax.jms.JMSException - If the property name is invalid.

setDoubleProperty

public void setDoubleProperty(java.lang.String name,
                              double value)
                       throws javax.jms.JMSException
API method.

Specified by:
setDoubleProperty in interface javax.jms.Message
Throws:
javax.jms.MessageNotWriteableException - If the message is read-only.
javax.jms.JMSException - If the property name is invalid.

setFloatProperty

public void setFloatProperty(java.lang.String name,
                             float value)
                      throws javax.jms.JMSException
API method.

Specified by:
setFloatProperty in interface javax.jms.Message
Throws:
javax.jms.MessageNotWriteableException - If the message is read-only.
javax.jms.JMSException - If the property name is invalid.

setIntProperty

public void setIntProperty(java.lang.String name,
                           int value)
                    throws javax.jms.JMSException
API method.

Specified by:
setIntProperty in interface javax.jms.Message
Throws:
javax.jms.MessageNotWriteableException - If the message is read-only.
javax.jms.JMSException - If the property name is invalid.

setLongProperty

public void setLongProperty(java.lang.String name,
                            long value)
                     throws javax.jms.JMSException
API method.

Specified by:
setLongProperty in interface javax.jms.Message
Throws:
javax.jms.MessageNotWriteableException - If the message is read-only.
javax.jms.JMSException - If the property name is invalid.

setObjectProperty

public void setObjectProperty(java.lang.String name,
                              java.lang.Object value)
                       throws javax.jms.JMSException
API method.

Specified by:
setObjectProperty in interface javax.jms.Message
Throws:
javax.jms.MessageNotWriteableException - If the message is read-only.
javax.jms.JMSException - If the property name is invalid, or if the object is invalid.

setShortProperty

public void setShortProperty(java.lang.String name,
                             short value)
                      throws javax.jms.JMSException
API method.

Specified by:
setShortProperty in interface javax.jms.Message
Throws:
javax.jms.MessageNotWriteableException - If the message is read-only.
javax.jms.JMSException - If the property name is invalid.

setStringProperty

public void setStringProperty(java.lang.String name,
                              java.lang.String value)
                       throws javax.jms.JMSException
API method.

Specified by:
setStringProperty in interface javax.jms.Message
Throws:
javax.jms.MessageNotWriteableException - If the message is read-only.
javax.jms.JMSException - If the property name is invalid.

getBooleanProperty

public boolean getBooleanProperty(java.lang.String name)
                           throws javax.jms.JMSException
API method.

Specified by:
getBooleanProperty in interface javax.jms.Message
Throws:
javax.jms.MessageFormatException - If the property type is invalid.
javax.jms.JMSException - If the name is invalid.

getByteProperty

public byte getByteProperty(java.lang.String name)
                     throws javax.jms.JMSException
API method.

Specified by:
getByteProperty in interface javax.jms.Message
Throws:
javax.jms.MessageFormatException - If the property type is invalid.
javax.jms.JMSException - If the name is invalid.

getDoubleProperty

public double getDoubleProperty(java.lang.String name)
                         throws javax.jms.JMSException
API method.

Specified by:
getDoubleProperty in interface javax.jms.Message
Throws:
javax.jms.MessageFormatException - If the property type is invalid.
javax.jms.JMSException - If the name is invalid.

getFloatProperty

public float getFloatProperty(java.lang.String name)
                       throws javax.jms.JMSException
API method.

Specified by:
getFloatProperty in interface javax.jms.Message
Throws:
javax.jms.MessageFormatException - If the property type is invalid.
javax.jms.JMSException - If the name is invalid.

getIntProperty

public int getIntProperty(java.lang.String name)
                   throws javax.jms.JMSException
API method.

Specified by:
getIntProperty in interface javax.jms.Message
Throws:
javax.jms.MessageFormatException - If the property type is invalid.
javax.jms.JMSException - If the name is invalid.

getLongProperty

public long getLongProperty(java.lang.String name)
                     throws javax.jms.JMSException
API method.

Specified by:
getLongProperty in interface javax.jms.Message
Throws:
javax.jms.MessageFormatException - If the property type is invalid.
javax.jms.JMSException - If the name is invalid.

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String name)
                                   throws javax.jms.JMSException
API method.

Specified by:
getObjectProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException - If the name is invalid.

getShortProperty

public short getShortProperty(java.lang.String name)
                       throws javax.jms.JMSException
API method.

Specified by:
getShortProperty in interface javax.jms.Message
Throws:
javax.jms.MessageFormatException - If the property type is invalid.
javax.jms.JMSException - If the name is invalid.

getStringProperty

public java.lang.String getStringProperty(java.lang.String name)
                                   throws javax.jms.JMSException
API method.

Specified by:
getStringProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException - If the name is invalid.

wrapMomMessage

public static Message wrapMomMessage(Session sess,
                                     Message momMsg)
                              throws javax.jms.JMSException
Wraps a given MOM message in the appropriate Joram message.

This method is actually called by a session consuming a MOM message for wrapping it in a Joram message before handing it to the consumer.

Throws:
javax.jms.JMSException - If an error occurs while building the message.

prepare

protected void prepare()
                throws java.lang.Exception
Method preparing the message for sending; resets header values, and serializes the body (done in subclasses).

Throws:
java.lang.Exception - If an error occurs while serializing.

Joram ${version}

Copyright © 2005 Scalagent - All rights reserved