org.directwebremoting.jms
Class DwrMessage

java.lang.Object
  extended by org.directwebremoting.jms.DwrMessage
All Implemented Interfaces:
javax.jms.MapMessage, javax.jms.Message, javax.jms.ObjectMessage, javax.jms.TextMessage

public class DwrMessage
extends java.lang.Object
implements javax.jms.Message, javax.jms.MapMessage, javax.jms.TextMessage, javax.jms.ObjectMessage

An implementation of all the Message types rolled into one. This allows DWR to not know what type of Message the user wishes to work with and to make the decision at runtime depending on how they choose to cast us.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Field Summary
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Constructor Summary
DwrMessage()
          Default ctor
DwrMessage(Hub hub, MessageEvent message)
          Ctor for propagation from the DWR Hub.
DwrMessage(java.io.Serializable object)
          Ctor for setting up an ObjectMessage
DwrMessage(java.lang.String text)
          Ctor for setting up a TextMessage
 
Method Summary
 void acknowledge()
           
 void clearBody()
           
 void clearProperties()
           
 boolean getBoolean(java.lang.String name)
           
 boolean getBooleanProperty(java.lang.String name)
           
 byte getByte(java.lang.String name)
           
 byte getByteProperty(java.lang.String name)
           
 byte[] getBytes(java.lang.String name)
           
 char getChar(java.lang.String name)
           
 double getDouble(java.lang.String name)
           
 double getDoubleProperty(java.lang.String name)
           
 float getFloat(java.lang.String name)
           
 float getFloatProperty(java.lang.String name)
           
 int getInt(java.lang.String name)
           
 int getIntProperty(java.lang.String name)
           
 java.lang.String getJMSCorrelationID()
           
 byte[] getJMSCorrelationIDAsBytes()
           
 int getJMSDeliveryMode()
           
 javax.jms.Destination getJMSDestination()
           
 long getJMSExpiration()
           
 java.lang.String getJMSMessageID()
           
 int getJMSPriority()
           
 boolean getJMSRedelivered()
           
 javax.jms.Destination getJMSReplyTo()
           
 long getJMSTimestamp()
           
 java.lang.String getJMSType()
           
 long getLong(java.lang.String name)
           
 long getLongProperty(java.lang.String name)
           
 java.util.Enumeration<java.lang.String> getMapNames()
           
 java.io.Serializable getObject()
           
 java.lang.Object getObject(java.lang.String name)
           
 java.lang.Object getObjectProperty(java.lang.String name)
           
 java.util.Enumeration<java.lang.String> getPropertyNames()
           
 short getShort(java.lang.String name)
           
 short getShortProperty(java.lang.String name)
           
 java.lang.String getString(java.lang.String name)
           
 java.lang.String getStringProperty(java.lang.String name)
           
 java.lang.String getText()
           
 boolean itemExists(java.lang.String name)
           
 boolean propertyExists(java.lang.String name)
           
 void setBoolean(java.lang.String name, boolean value)
           
 void setBooleanProperty(java.lang.String name, boolean value)
           
 void setByte(java.lang.String name, byte value)
           
 void setByteProperty(java.lang.String name, byte value)
           
 void setBytes(java.lang.String name, byte[] value)
           
 void setBytes(java.lang.String name, byte[] value, int offset, int length)
           
 void setChar(java.lang.String name, char value)
           
 void setDouble(java.lang.String name, double value)
           
 void setDoubleProperty(java.lang.String name, double value)
           
 void setFloat(java.lang.String name, float value)
           
 void setFloatProperty(java.lang.String name, float value)
           
 void setInt(java.lang.String name, int value)
           
 void setIntProperty(java.lang.String name, int value)
           
 void setJMSCorrelationID(java.lang.String correlationID)
           
 void setJMSCorrelationIDAsBytes(byte[] correlationID)
           
 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)
           
 void setJMSReplyTo(javax.jms.Destination replyTo)
           
 void setJMSTimestamp(long timestamp)
           
 void setJMSType(java.lang.String type)
           
 void setLong(java.lang.String name, long value)
           
 void setLongProperty(java.lang.String name, long value)
           
 void setObject(java.io.Serializable object)
           
 void setObject(java.lang.String name, java.lang.Object value)
           
 void setObjectProperty(java.lang.String name, java.lang.Object value)
           
 void setShort(java.lang.String name, short value)
           
 void setShortProperty(java.lang.String name, short value)
           
 void setString(java.lang.String name, java.lang.String value)
           
 void setStringProperty(java.lang.String name, java.lang.String value)
           
 void setText(java.lang.String text)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DwrMessage

public DwrMessage()
Default ctor


DwrMessage

public DwrMessage(java.lang.String text)
Ctor for setting up a TextMessage


DwrMessage

public DwrMessage(java.io.Serializable object)
Ctor for setting up an ObjectMessage


DwrMessage

public DwrMessage(Hub hub,
                  MessageEvent message)
Ctor for propagation from the DWR Hub.

Method Detail

acknowledge

public void acknowledge()
Specified by:
acknowledge in interface javax.jms.Message

clearBody

public void clearBody()
Specified by:
clearBody in interface javax.jms.Message

clearProperties

public void clearProperties()
Specified by:
clearProperties in interface javax.jms.Message

getPropertyNames

public java.util.Enumeration<java.lang.String> getPropertyNames()
Specified by:
getPropertyNames in interface javax.jms.Message

propertyExists

public boolean propertyExists(java.lang.String name)
Specified by:
propertyExists in interface javax.jms.Message

getBooleanProperty

public boolean getBooleanProperty(java.lang.String name)
Specified by:
getBooleanProperty in interface javax.jms.Message

getByteProperty

public byte getByteProperty(java.lang.String name)
Specified by:
getByteProperty in interface javax.jms.Message

getDoubleProperty

public double getDoubleProperty(java.lang.String name)
Specified by:
getDoubleProperty in interface javax.jms.Message

getFloatProperty

public float getFloatProperty(java.lang.String name)
Specified by:
getFloatProperty in interface javax.jms.Message

getIntProperty

public int getIntProperty(java.lang.String name)
Specified by:
getIntProperty in interface javax.jms.Message

getLongProperty

public long getLongProperty(java.lang.String name)
Specified by:
getLongProperty in interface javax.jms.Message

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String name)
Specified by:
getObjectProperty in interface javax.jms.Message

getShortProperty

public short getShortProperty(java.lang.String name)
Specified by:
getShortProperty in interface javax.jms.Message

getStringProperty

public java.lang.String getStringProperty(java.lang.String name)
Specified by:
getStringProperty in interface javax.jms.Message

setBooleanProperty

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

setByteProperty

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

setDoubleProperty

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

setFloatProperty

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

setIntProperty

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

setLongProperty

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

setObjectProperty

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

setShortProperty

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

setStringProperty

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

getJMSCorrelationID

public java.lang.String getJMSCorrelationID()
Specified by:
getJMSCorrelationID in interface javax.jms.Message

getJMSCorrelationIDAsBytes

public byte[] getJMSCorrelationIDAsBytes()
Specified by:
getJMSCorrelationIDAsBytes in interface javax.jms.Message

getJMSDeliveryMode

public int getJMSDeliveryMode()
Specified by:
getJMSDeliveryMode in interface javax.jms.Message

getJMSDestination

public javax.jms.Destination getJMSDestination()
Specified by:
getJMSDestination in interface javax.jms.Message

getJMSExpiration

public long getJMSExpiration()
Specified by:
getJMSExpiration in interface javax.jms.Message

getJMSMessageID

public java.lang.String getJMSMessageID()
Specified by:
getJMSMessageID in interface javax.jms.Message

getJMSPriority

public int getJMSPriority()
Specified by:
getJMSPriority in interface javax.jms.Message

getJMSRedelivered

public boolean getJMSRedelivered()
Specified by:
getJMSRedelivered in interface javax.jms.Message

getJMSReplyTo

public javax.jms.Destination getJMSReplyTo()
Specified by:
getJMSReplyTo in interface javax.jms.Message

getJMSTimestamp

public long getJMSTimestamp()
Specified by:
getJMSTimestamp in interface javax.jms.Message

getJMSType

public java.lang.String getJMSType()
Specified by:
getJMSType in interface javax.jms.Message

setJMSCorrelationID

public void setJMSCorrelationID(java.lang.String correlationID)
Specified by:
setJMSCorrelationID in interface javax.jms.Message

setJMSCorrelationIDAsBytes

public void setJMSCorrelationIDAsBytes(byte[] correlationID)
Specified by:
setJMSCorrelationIDAsBytes in interface javax.jms.Message

setJMSDeliveryMode

public void setJMSDeliveryMode(int deliveryMode)
Specified by:
setJMSDeliveryMode in interface javax.jms.Message

setJMSDestination

public void setJMSDestination(javax.jms.Destination destination)
Specified by:
setJMSDestination in interface javax.jms.Message

setJMSExpiration

public void setJMSExpiration(long expiration)
Specified by:
setJMSExpiration in interface javax.jms.Message

setJMSMessageID

public void setJMSMessageID(java.lang.String messageId)
Specified by:
setJMSMessageID in interface javax.jms.Message

setJMSPriority

public void setJMSPriority(int priority)
Specified by:
setJMSPriority in interface javax.jms.Message

setJMSRedelivered

public void setJMSRedelivered(boolean redelivered)
Specified by:
setJMSRedelivered in interface javax.jms.Message

setJMSReplyTo

public void setJMSReplyTo(javax.jms.Destination replyTo)
Specified by:
setJMSReplyTo in interface javax.jms.Message

setJMSTimestamp

public void setJMSTimestamp(long timestamp)
Specified by:
setJMSTimestamp in interface javax.jms.Message

setJMSType

public void setJMSType(java.lang.String type)
Specified by:
setJMSType in interface javax.jms.Message

getMapNames

public java.util.Enumeration<java.lang.String> getMapNames()
Specified by:
getMapNames in interface javax.jms.MapMessage

itemExists

public boolean itemExists(java.lang.String name)
Specified by:
itemExists in interface javax.jms.MapMessage

getBoolean

public boolean getBoolean(java.lang.String name)
Specified by:
getBoolean in interface javax.jms.MapMessage

getByte

public byte getByte(java.lang.String name)
Specified by:
getByte in interface javax.jms.MapMessage

getBytes

public byte[] getBytes(java.lang.String name)
Specified by:
getBytes in interface javax.jms.MapMessage

getChar

public char getChar(java.lang.String name)
Specified by:
getChar in interface javax.jms.MapMessage

getDouble

public double getDouble(java.lang.String name)
Specified by:
getDouble in interface javax.jms.MapMessage

getFloat

public float getFloat(java.lang.String name)
Specified by:
getFloat in interface javax.jms.MapMessage

getInt

public int getInt(java.lang.String name)
Specified by:
getInt in interface javax.jms.MapMessage

getLong

public long getLong(java.lang.String name)
Specified by:
getLong in interface javax.jms.MapMessage

getShort

public short getShort(java.lang.String name)
Specified by:
getShort in interface javax.jms.MapMessage

getString

public java.lang.String getString(java.lang.String name)
Specified by:
getString in interface javax.jms.MapMessage

getObject

public java.lang.Object getObject(java.lang.String name)
Specified by:
getObject in interface javax.jms.MapMessage

setBoolean

public void setBoolean(java.lang.String name,
                       boolean value)
Specified by:
setBoolean in interface javax.jms.MapMessage

setByte

public void setByte(java.lang.String name,
                    byte value)
Specified by:
setByte in interface javax.jms.MapMessage

setBytes

public void setBytes(java.lang.String name,
                     byte[] value)
Specified by:
setBytes in interface javax.jms.MapMessage

setBytes

public void setBytes(java.lang.String name,
                     byte[] value,
                     int offset,
                     int length)
Specified by:
setBytes in interface javax.jms.MapMessage

setChar

public void setChar(java.lang.String name,
                    char value)
Specified by:
setChar in interface javax.jms.MapMessage

setDouble

public void setDouble(java.lang.String name,
                      double value)
Specified by:
setDouble in interface javax.jms.MapMessage

setFloat

public void setFloat(java.lang.String name,
                     float value)
Specified by:
setFloat in interface javax.jms.MapMessage

setInt

public void setInt(java.lang.String name,
                   int value)
Specified by:
setInt in interface javax.jms.MapMessage

setLong

public void setLong(java.lang.String name,
                    long value)
Specified by:
setLong in interface javax.jms.MapMessage

setObject

public void setObject(java.lang.String name,
                      java.lang.Object value)
Specified by:
setObject in interface javax.jms.MapMessage

setShort

public void setShort(java.lang.String name,
                     short value)
Specified by:
setShort in interface javax.jms.MapMessage

setString

public void setString(java.lang.String name,
                      java.lang.String value)
Specified by:
setString in interface javax.jms.MapMessage

getText

public java.lang.String getText()
Specified by:
getText in interface javax.jms.TextMessage

setText

public void setText(java.lang.String text)
Specified by:
setText in interface javax.jms.TextMessage

getObject

public java.io.Serializable getObject()
Specified by:
getObject in interface javax.jms.ObjectMessage

setObject

public void setObject(java.io.Serializable object)
Specified by:
setObject in interface javax.jms.ObjectMessage

Copyright 2008