org.jboss.messaging.ra
Class JBMMessage

java.lang.Object
  extended by org.jboss.messaging.ra.JBMMessage
All Implemented Interfaces:
javax.jms.Message
Direct Known Subclasses:
JBMBytesMessage, JBMMapMessage, JBMObjectMessage, JBMStreamMessage, JBMTextMessage

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

A wrapper for a message

Version:
$Revision: $
Author:
Adrian Brock, Jesper Pedersen

Field Summary
protected  javax.jms.Message message
          The message
protected  JBMSession session
          The session
 
Fields inherited from interface javax.jms.Message
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE
 
Constructor Summary
JBMMessage(javax.jms.Message message, JBMSession session)
          Create a new wrapper
 
Method Summary
 void acknowledge()
          Acknowledge
 void clearBody()
          Clear body
 void clearProperties()
          Clear properties
 boolean equals(java.lang.Object object)
          Check for equality
 boolean getBooleanProperty(java.lang.String name)
          Get property
 byte getByteProperty(java.lang.String name)
          Get property
 double getDoubleProperty(java.lang.String name)
          Get property
 float getFloatProperty(java.lang.String name)
          Get property
 int getIntProperty(java.lang.String name)
          Get property
 java.lang.String getJMSCorrelationID()
          Get correlation id
 byte[] getJMSCorrelationIDAsBytes()
          Get correlation id
 int getJMSDeliveryMode()
          Get delivery mode
 javax.jms.Destination getJMSDestination()
          Get destination
 long getJMSExpiration()
          Get expiration
 java.lang.String getJMSMessageID()
          Get message id
 int getJMSPriority()
          Get priority
 boolean getJMSRedelivered()
          Get redelivered status
 javax.jms.Destination getJMSReplyTo()
          Get reply to destination
 long getJMSTimestamp()
          Get timestamp
 java.lang.String getJMSType()
          Get type
 long getLongProperty(java.lang.String name)
          Get property
 java.lang.Object getObjectProperty(java.lang.String name)
          Get property
 java.util.Enumeration getPropertyNames()
          Get property names
 short getShortProperty(java.lang.String name)
          Get property
 java.lang.String getStringProperty(java.lang.String name)
          Get property
 int hashCode()
          Return the hash code
 boolean propertyExists(java.lang.String name)
          Do property exist
 void setBooleanProperty(java.lang.String name, boolean value)
          Set property
 void setByteProperty(java.lang.String name, byte value)
          Set property
 void setDoubleProperty(java.lang.String name, double value)
          Set property
 void setFloatProperty(java.lang.String name, float value)
          Set property
 void setIntProperty(java.lang.String name, int value)
          Set property
 void setJMSCorrelationID(java.lang.String correlationID)
          Set correlation id
 void setJMSCorrelationIDAsBytes(byte[] correlationID)
          Set correlation id
 void setJMSDeliveryMode(int deliveryMode)
          Set delivery mode
 void setJMSDestination(javax.jms.Destination destination)
          Set destination
 void setJMSExpiration(long expiration)
          Set expiration
 void setJMSMessageID(java.lang.String id)
          Set message id
 void setJMSPriority(int priority)
          Set priority
 void setJMSRedelivered(boolean redelivered)
          Set redelivered status
 void setJMSReplyTo(javax.jms.Destination replyTo)
          Set reply to
 void setJMSTimestamp(long timestamp)
          Set timestamp
 void setJMSType(java.lang.String type)
          Set type
 void setLongProperty(java.lang.String name, long value)
          Set property
 void setObjectProperty(java.lang.String name, java.lang.Object value)
          Set property
 void setShortProperty(java.lang.String name, short value)
          Set property
 void setStringProperty(java.lang.String name, java.lang.String value)
          Set property
 java.lang.String toString()
          Return string representation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

message

protected javax.jms.Message message
The message


session

protected JBMSession session
The session

Constructor Detail

JBMMessage

public JBMMessage(javax.jms.Message message,
                  JBMSession session)
Create a new wrapper

Parameters:
message - the message
session - the session
Method Detail

acknowledge

public void acknowledge()
                 throws javax.jms.JMSException
Acknowledge

Specified by:
acknowledge in interface javax.jms.Message
Throws:
javax.jms.JMSException - Thrown if an error occurs

clearBody

public void clearBody()
               throws javax.jms.JMSException
Clear body

Specified by:
clearBody in interface javax.jms.Message
Throws:
javax.jms.JMSException - Thrown if an error occurs

clearProperties

public void clearProperties()
                     throws javax.jms.JMSException
Clear properties

Specified by:
clearProperties in interface javax.jms.Message
Throws:
javax.jms.JMSException - Thrown if an error occurs

getBooleanProperty

public boolean getBooleanProperty(java.lang.String name)
                           throws javax.jms.JMSException
Get property

Specified by:
getBooleanProperty in interface javax.jms.Message
Parameters:
name - The name
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getByteProperty

public byte getByteProperty(java.lang.String name)
                     throws javax.jms.JMSException
Get property

Specified by:
getByteProperty in interface javax.jms.Message
Parameters:
name - The name
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getDoubleProperty

public double getDoubleProperty(java.lang.String name)
                         throws javax.jms.JMSException
Get property

Specified by:
getDoubleProperty in interface javax.jms.Message
Parameters:
name - The name
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getFloatProperty

public float getFloatProperty(java.lang.String name)
                       throws javax.jms.JMSException
Get property

Specified by:
getFloatProperty in interface javax.jms.Message
Parameters:
name - The name
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getIntProperty

public int getIntProperty(java.lang.String name)
                   throws javax.jms.JMSException
Get property

Specified by:
getIntProperty in interface javax.jms.Message
Parameters:
name - The name
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSCorrelationID

public java.lang.String getJMSCorrelationID()
                                     throws javax.jms.JMSException
Get correlation id

Specified by:
getJMSCorrelationID in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSCorrelationIDAsBytes

public byte[] getJMSCorrelationIDAsBytes()
                                  throws javax.jms.JMSException
Get correlation id

Specified by:
getJMSCorrelationIDAsBytes in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSDeliveryMode

public int getJMSDeliveryMode()
                       throws javax.jms.JMSException
Get delivery mode

Specified by:
getJMSDeliveryMode in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSDestination

public javax.jms.Destination getJMSDestination()
                                        throws javax.jms.JMSException
Get destination

Specified by:
getJMSDestination in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSExpiration

public long getJMSExpiration()
                      throws javax.jms.JMSException
Get expiration

Specified by:
getJMSExpiration in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSMessageID

public java.lang.String getJMSMessageID()
                                 throws javax.jms.JMSException
Get message id

Specified by:
getJMSMessageID in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSPriority

public int getJMSPriority()
                   throws javax.jms.JMSException
Get priority

Specified by:
getJMSPriority in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSRedelivered

public boolean getJMSRedelivered()
                          throws javax.jms.JMSException
Get redelivered status

Specified by:
getJMSRedelivered in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSReplyTo

public javax.jms.Destination getJMSReplyTo()
                                    throws javax.jms.JMSException
Get reply to destination

Specified by:
getJMSReplyTo in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSTimestamp

public long getJMSTimestamp()
                     throws javax.jms.JMSException
Get timestamp

Specified by:
getJMSTimestamp in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getJMSType

public java.lang.String getJMSType()
                            throws javax.jms.JMSException
Get type

Specified by:
getJMSType in interface javax.jms.Message
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getLongProperty

public long getLongProperty(java.lang.String name)
                     throws javax.jms.JMSException
Get property

Specified by:
getLongProperty in interface javax.jms.Message
Parameters:
name - The name
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String name)
                                   throws javax.jms.JMSException
Get property

Specified by:
getObjectProperty in interface javax.jms.Message
Parameters:
name - The name
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getPropertyNames

public java.util.Enumeration getPropertyNames()
                                       throws javax.jms.JMSException
Get property names

Specified by:
getPropertyNames in interface javax.jms.Message
Returns:
The values
Throws:
javax.jms.JMSException - Thrown if an error occurs

getShortProperty

public short getShortProperty(java.lang.String name)
                       throws javax.jms.JMSException
Get property

Specified by:
getShortProperty in interface javax.jms.Message
Parameters:
name - The name
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

getStringProperty

public java.lang.String getStringProperty(java.lang.String name)
                                   throws javax.jms.JMSException
Get property

Specified by:
getStringProperty in interface javax.jms.Message
Parameters:
name - The name
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

propertyExists

public boolean propertyExists(java.lang.String name)
                       throws javax.jms.JMSException
Do property exist

Specified by:
propertyExists in interface javax.jms.Message
Parameters:
name - The name
Returns:
The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setBooleanProperty

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

Specified by:
setBooleanProperty in interface javax.jms.Message
Parameters:
name - The name
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setByteProperty

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

Specified by:
setByteProperty in interface javax.jms.Message
Parameters:
name - The name
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setDoubleProperty

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

Specified by:
setDoubleProperty in interface javax.jms.Message
Parameters:
name - The name
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setFloatProperty

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

Specified by:
setFloatProperty in interface javax.jms.Message
Parameters:
name - The name
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setIntProperty

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

Specified by:
setIntProperty in interface javax.jms.Message
Parameters:
name - The name
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSCorrelationID

public void setJMSCorrelationID(java.lang.String correlationID)
                         throws javax.jms.JMSException
Set correlation id

Specified by:
setJMSCorrelationID in interface javax.jms.Message
Parameters:
correlationID - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSCorrelationIDAsBytes

public void setJMSCorrelationIDAsBytes(byte[] correlationID)
                                throws javax.jms.JMSException
Set correlation id

Specified by:
setJMSCorrelationIDAsBytes in interface javax.jms.Message
Parameters:
correlationID - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSDeliveryMode

public void setJMSDeliveryMode(int deliveryMode)
                        throws javax.jms.JMSException
Set delivery mode

Specified by:
setJMSDeliveryMode in interface javax.jms.Message
Parameters:
deliveryMode - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSDestination

public void setJMSDestination(javax.jms.Destination destination)
                       throws javax.jms.JMSException
Set destination

Specified by:
setJMSDestination in interface javax.jms.Message
Parameters:
destination - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSExpiration

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

Specified by:
setJMSExpiration in interface javax.jms.Message
Parameters:
expiration - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSMessageID

public void setJMSMessageID(java.lang.String id)
                     throws javax.jms.JMSException
Set message id

Specified by:
setJMSMessageID in interface javax.jms.Message
Parameters:
id - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSPriority

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

Specified by:
setJMSPriority in interface javax.jms.Message
Parameters:
priority - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSRedelivered

public void setJMSRedelivered(boolean redelivered)
                       throws javax.jms.JMSException
Set redelivered status

Specified by:
setJMSRedelivered in interface javax.jms.Message
Parameters:
redelivered - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSReplyTo

public void setJMSReplyTo(javax.jms.Destination replyTo)
                   throws javax.jms.JMSException
Set reply to

Specified by:
setJMSReplyTo in interface javax.jms.Message
Parameters:
replyTo - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSTimestamp

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

Specified by:
setJMSTimestamp in interface javax.jms.Message
Parameters:
timestamp - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setJMSType

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

Specified by:
setJMSType in interface javax.jms.Message
Parameters:
type - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setLongProperty

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

Specified by:
setLongProperty in interface javax.jms.Message
Parameters:
name - The name
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setObjectProperty

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

Specified by:
setObjectProperty in interface javax.jms.Message
Parameters:
name - The name
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setShortProperty

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

Specified by:
setShortProperty in interface javax.jms.Message
Parameters:
name - The name
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setStringProperty

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

Specified by:
setStringProperty in interface javax.jms.Message
Parameters:
name - The name
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

hashCode

public int hashCode()
Return the hash code

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code

equals

public boolean equals(java.lang.Object object)
Check for equality

Overrides:
equals in class java.lang.Object
Parameters:
object - The other object
Returns:
True / false

toString

public java.lang.String toString()
Return string representation

Overrides:
toString in class java.lang.Object
Returns:
The string


Copyright © 2006 JBoss Inc. All Rights Reserved.