org.mockejb.jms
Class MessageImpl

java.lang.Object
  extended byorg.mockejb.jms.MessageImpl
All Implemented Interfaces:
javax.jms.Message
Direct Known Subclasses:
BytesMessageImpl, MapMessageImpl, ObjectMessageImpl, StreamMessageImpl, TextMessageImpl

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

Message implementation.

Author:
Dimitar Gospodinov
See Also:
Message

Field Summary
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Constructor Summary
MessageImpl()
          Constructs empty message.
MessageImpl(javax.jms.Message msg)
          Constructs new MessageImpl by copying all header fields and properties from the specified message msg
 
Method Summary
 void acknowledge()
          Does nothing.
 void clearBody()
           
 void clearProperties()
           
 boolean getBooleanProperty(java.lang.String name)
           
 byte getByteProperty(java.lang.String name)
           
 double getDoubleProperty(java.lang.String name)
           
 float getFloatProperty(java.lang.String name)
           
 int getIntProperty(java.lang.String name)
           
 java.lang.String getJMSCorrelationID()
           
 byte[] getJMSCorrelationIDAsBytes()
          Not supported.
 int getJMSDeliveryMode()
           
 javax.jms.Destination getJMSDestination()
           
 long getJMSExpiration()
           
 java.lang.String getJMSMessageID()
           
 int getJMSPriority()
           
 boolean getJMSRedelivered()
          Always returns false
 javax.jms.Destination getJMSReplyTo()
           
 long getJMSTimestamp()
           
 java.lang.String getJMSType()
           
 long getLongProperty(java.lang.String name)
           
 java.lang.Object getObjectProperty(java.lang.String name)
           
 java.util.Enumeration getPropertyNames()
           
 short getShortProperty(java.lang.String name)
           
 java.lang.String getStringProperty(java.lang.String name)
           
 boolean propertyExists(java.lang.String propertyName)
           
 void setBooleanProperty(java.lang.String name, boolean value)
           
 void setByteProperty(java.lang.String name, byte value)
           
 void setDoubleProperty(java.lang.String name, double value)
           
 void setFloatProperty(java.lang.String name, float value)
           
 void setIntProperty(java.lang.String name, int value)
           
 void setJMSCorrelationID(java.lang.String correlationId)
           
 void setJMSCorrelationIDAsBytes(byte[] arg0)
          Not supported.
 void setJMSDeliveryMode(int deliveryMode)
           
 void setJMSDestination(javax.jms.Destination destination)
           
 void setJMSExpiration(long expiration)
           
 void setJMSMessageID(java.lang.String messageId)
           
 void setJMSPriority(int priority)
           
 void setJMSRedelivered(boolean redelivered)
          Does nothing.
 void setJMSReplyTo(javax.jms.Destination replyTo)
           
 void setJMSTimestamp(long timestamp)
           
 void setJMSType(java.lang.String type)
           
 void setLongProperty(java.lang.String name, long value)
           
 void setObjectProperty(java.lang.String name, java.lang.Object value)
           
 void setPropertiesNotWriteable()
           
 void setShortProperty(java.lang.String name, short value)
           
 void setStringProperty(java.lang.String name, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageImpl

public MessageImpl()
Constructs empty message.


MessageImpl

public MessageImpl(javax.jms.Message msg)
            throws javax.jms.JMSException
Constructs new MessageImpl by copying all header fields and properties from the specified message msg

Parameters:
msg -
Method Detail

getJMSMessageID

public java.lang.String getJMSMessageID()
                                 throws javax.jms.JMSException
Specified by:
getJMSMessageID in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSMessageID()

setJMSMessageID

public void setJMSMessageID(java.lang.String messageId)
                     throws javax.jms.JMSException
Specified by:
setJMSMessageID in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSMessageID(java.lang.String)

getJMSTimestamp

public long getJMSTimestamp()
                     throws javax.jms.JMSException
Specified by:
getJMSTimestamp in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSTimestamp()

setJMSTimestamp

public void setJMSTimestamp(long timestamp)
                     throws javax.jms.JMSException
Specified by:
setJMSTimestamp in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSTimestamp(long)

getJMSCorrelationIDAsBytes

public byte[] getJMSCorrelationIDAsBytes()
                                  throws javax.jms.JMSException
Not supported.

Specified by:
getJMSCorrelationIDAsBytes in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSCorrelationIDAsBytes()

setJMSCorrelationIDAsBytes

public void setJMSCorrelationIDAsBytes(byte[] arg0)
                                throws javax.jms.JMSException
Not supported.

Specified by:
setJMSCorrelationIDAsBytes in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSCorrelationIDAsBytes(byte[])

setJMSCorrelationID

public void setJMSCorrelationID(java.lang.String correlationId)
                         throws javax.jms.JMSException
Specified by:
setJMSCorrelationID in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSCorrelationID(java.lang.String)

getJMSCorrelationID

public java.lang.String getJMSCorrelationID()
                                     throws javax.jms.JMSException
Specified by:
getJMSCorrelationID in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSCorrelationID()

getJMSReplyTo

public javax.jms.Destination getJMSReplyTo()
                                    throws javax.jms.JMSException
Specified by:
getJMSReplyTo in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSReplyTo()

setJMSReplyTo

public void setJMSReplyTo(javax.jms.Destination replyTo)
                   throws javax.jms.JMSException
Specified by:
setJMSReplyTo in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSReplyTo(javax.jms.Destination)

getJMSDestination

public javax.jms.Destination getJMSDestination()
                                        throws javax.jms.JMSException
Specified by:
getJMSDestination in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSDestination()

setJMSDestination

public void setJMSDestination(javax.jms.Destination destination)
                       throws javax.jms.JMSException
Specified by:
setJMSDestination in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSDestination(javax.jms.Destination)

getJMSDeliveryMode

public int getJMSDeliveryMode()
                       throws javax.jms.JMSException
Specified by:
getJMSDeliveryMode in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSDeliveryMode()

setJMSDeliveryMode

public void setJMSDeliveryMode(int deliveryMode)
                        throws javax.jms.JMSException
Specified by:
setJMSDeliveryMode in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSDeliveryMode(int)

getJMSRedelivered

public boolean getJMSRedelivered()
                          throws javax.jms.JMSException
Always returns false

Specified by:
getJMSRedelivered in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSRedelivered()

setJMSRedelivered

public void setJMSRedelivered(boolean redelivered)
                       throws javax.jms.JMSException
Does nothing.

Specified by:
setJMSRedelivered in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSRedelivered(boolean)

getJMSType

public java.lang.String getJMSType()
                            throws javax.jms.JMSException
Specified by:
getJMSType in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSType()

setJMSType

public void setJMSType(java.lang.String type)
                throws javax.jms.JMSException
Specified by:
setJMSType in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSType(java.lang.String)

getJMSExpiration

public long getJMSExpiration()
                      throws javax.jms.JMSException
Specified by:
getJMSExpiration in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSExpiration()

setJMSExpiration

public void setJMSExpiration(long expiration)
                      throws javax.jms.JMSException
Specified by:
setJMSExpiration in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSExpiration(long)

getJMSPriority

public int getJMSPriority()
                   throws javax.jms.JMSException
Specified by:
getJMSPriority in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getJMSPriority()

setJMSPriority

public void setJMSPriority(int priority)
                    throws javax.jms.JMSException
Specified by:
setJMSPriority in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setJMSPriority(int)

clearProperties

public void clearProperties()
                     throws javax.jms.JMSException
Specified by:
clearProperties in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.clearProperties()

propertyExists

public boolean propertyExists(java.lang.String propertyName)
                       throws javax.jms.JMSException
Specified by:
propertyExists in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.propertyExists(java.lang.String)

getBooleanProperty

public boolean getBooleanProperty(java.lang.String name)
                           throws javax.jms.JMSException
Specified by:
getBooleanProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getBooleanProperty(java.lang.String)

getByteProperty

public byte getByteProperty(java.lang.String name)
                     throws javax.jms.JMSException
Specified by:
getByteProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getByteProperty(java.lang.String)

getShortProperty

public short getShortProperty(java.lang.String name)
                       throws javax.jms.JMSException
Specified by:
getShortProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getShortProperty(java.lang.String)

getIntProperty

public int getIntProperty(java.lang.String name)
                   throws javax.jms.JMSException
Specified by:
getIntProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getIntProperty(java.lang.String)

getLongProperty

public long getLongProperty(java.lang.String name)
                     throws javax.jms.JMSException
Specified by:
getLongProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getLongProperty(java.lang.String)

getFloatProperty

public float getFloatProperty(java.lang.String name)
                       throws javax.jms.JMSException
Specified by:
getFloatProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getFloatProperty(java.lang.String)

getDoubleProperty

public double getDoubleProperty(java.lang.String name)
                         throws javax.jms.JMSException
Specified by:
getDoubleProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getDoubleProperty(java.lang.String)

getStringProperty

public java.lang.String getStringProperty(java.lang.String name)
                                   throws javax.jms.JMSException
Specified by:
getStringProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getStringProperty(java.lang.String)

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String name)
                                   throws javax.jms.JMSException
Specified by:
getObjectProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getObjectProperty(java.lang.String)

getPropertyNames

public java.util.Enumeration getPropertyNames()
                                       throws javax.jms.JMSException
Specified by:
getPropertyNames in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.getPropertyNames()

setBooleanProperty

public void setBooleanProperty(java.lang.String name,
                               boolean value)
                        throws javax.jms.JMSException
Specified by:
setBooleanProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setBooleanProperty(java.lang.String, boolean)

setByteProperty

public void setByteProperty(java.lang.String name,
                            byte value)
                     throws javax.jms.JMSException
Specified by:
setByteProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setByteProperty(java.lang.String, byte)

setShortProperty

public void setShortProperty(java.lang.String name,
                             short value)
                      throws javax.jms.JMSException
Specified by:
setShortProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setShortProperty(java.lang.String, short)

setIntProperty

public void setIntProperty(java.lang.String name,
                           int value)
                    throws javax.jms.JMSException
Specified by:
setIntProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setIntProperty(java.lang.String, int)

setLongProperty

public void setLongProperty(java.lang.String name,
                            long value)
                     throws javax.jms.JMSException
Specified by:
setLongProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setLongProperty(java.lang.String, long)

setFloatProperty

public void setFloatProperty(java.lang.String name,
                             float value)
                      throws javax.jms.JMSException
Specified by:
setFloatProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setFloatProperty(java.lang.String, float)

setDoubleProperty

public void setDoubleProperty(java.lang.String name,
                              double value)
                       throws javax.jms.JMSException
Specified by:
setDoubleProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setDoubleProperty(java.lang.String, double)

setStringProperty

public void setStringProperty(java.lang.String name,
                              java.lang.String value)
                       throws javax.jms.JMSException
Specified by:
setStringProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setStringProperty(java.lang.String, java.lang.String)

setObjectProperty

public void setObjectProperty(java.lang.String name,
                              java.lang.Object value)
                       throws javax.jms.JMSException
Specified by:
setObjectProperty in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.setObjectProperty(java.lang.String, java.lang.Object)

acknowledge

public void acknowledge()
                 throws javax.jms.JMSException
Does nothing.

Specified by:
acknowledge in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.acknowledge()

clearBody

public void clearBody()
               throws javax.jms.JMSException
Specified by:
clearBody in interface javax.jms.Message
Throws:
javax.jms.JMSException
See Also:
Message.clearBody()

setPropertiesNotWriteable

public void setPropertiesNotWriteable()