org.jboss.jms.message
Class JBossMessage
java.lang.Object
org.jboss.messaging.core.impl.message.MessageSupport
org.jboss.jms.message.JBossMessage
- All Implemented Interfaces:
- java.io.Serializable, Message, Streamable
- Direct Known Subclasses:
- JBossBytesMessage, JBossMapMessage, JBossObjectMessage, JBossStreamMessage, JBossTextMessage
public class JBossMessage
- extends MessageSupport
- implements javax.jms.Message, java.io.Serializable
Implementation of a JMS Message
Note that the only reason this class is Serializable is so that messages
can be returned from JMX operations.
Java serialization is not used to serialize messages between client and server
in normal JMS operations
- Author:
- Ovidiu Feodorov, Tim Fox, Tyronne Wickramarathne
Partially ported from JBossMQ implementation originally written by:, Norbert Lataille (Norbert.Lataille@m4x.org), Hiram Chirino (Cojonudo14@hotmail.com), David Maplesden (David.Maplesden@orion.co.nz), Adrian Brock
$Id: JBossMessage.java 3755 2008-02-21 16:01:58Z timfox $
- See Also:
- Serialized Form
Fields inherited from interface javax.jms.Message |
DEFAULT_DELIVERY_MODE, DEFAULT_PRIORITY, DEFAULT_TIME_TO_LIVE |
Constructor Summary |
|
JBossMessage()
|
protected |
JBossMessage(JBossMessage other)
Create a new JBossMessage by making a shallow copy of another |
|
JBossMessage(long messageID)
|
|
JBossMessage(long messageID,
boolean reliable,
long expiration,
long timestamp,
byte priority,
java.util.Map headers,
byte[] payloadAsByteArray)
|
|
JBossMessage(javax.jms.Message foreign,
long messageID)
A copy constructor for non-JBoss Messaging JMS messages. |
Method Summary |
void |
acknowledge()
|
void |
clearBody()
|
void |
clearProperties()
|
void |
copyPayload(java.lang.Object payload)
|
static MessageProxy |
createThinDelegate(long deliveryId,
JBossMessage m,
int deliveryCount)
|
void |
doBeforeReceive()
|
void |
doBeforeSend()
|
JBossMessage |
doCopy()
|
static java.lang.String |
dump(JBossMessage m)
|
boolean |
getBooleanProperty(java.lang.String name)
|
byte |
getByteProperty(java.lang.String name)
|
java.lang.String |
getConnectionID()
|
double |
getDoubleProperty(java.lang.String name)
|
float |
getFloatProperty(java.lang.String name)
|
java.util.Map |
getHeaders()
|
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()
|
java.util.Map |
getJMSProperties()
|
boolean |
getJMSRedelivered()
|
javax.jms.Destination |
getJMSReplyTo()
|
long |
getJMSTimestamp()
|
java.lang.String |
getJMSType()
|
long |
getLongProperty(java.lang.String name)
|
java.lang.Object |
getObjectProperty(java.lang.String name)
|
javax.jms.Destination |
getOriginalSuckerDestination()
|
java.util.Enumeration |
getPropertyNames()
|
long |
getScheduledDeliveryTime()
|
short |
getShortProperty(java.lang.String name)
|
java.lang.String |
getStringProperty(java.lang.String name)
|
byte |
getType()
|
boolean |
isCorrelationIDBytes()
|
boolean |
isReference()
|
boolean |
propertyExists(java.lang.String name)
|
void |
read(java.io.DataInputStream in)
|
void |
setBooleanProperty(java.lang.String name,
boolean value)
|
void |
setByteProperty(java.lang.String name,
byte value)
|
void |
setConnectionID(java.lang.String connectionID)
|
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[] correlationID)
|
void |
setJMSDeliveryMode(int deliveryMode)
|
void |
setJMSDestination(javax.jms.Destination destination)
|
void |
setJMSExpiration(long expiration)
|
void |
setJMSMessageID(java.lang.String jmsMessageID)
|
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 |
setLongProperty(java.lang.String name,
long value)
|
void |
setMessageId(long messageID)
|
void |
setObjectProperty(java.lang.String name,
java.lang.Object value)
|
void |
setOriginalSuckerDestination(javax.jms.Destination destination)
|
void |
setShortProperty(java.lang.String name,
short value)
|
void |
setStringProperty(java.lang.String name,
java.lang.String value)
|
java.lang.String |
toString()
|
void |
write(java.io.DataOutputStream out)
|
Methods inherited from class org.jboss.messaging.core.impl.message.MessageSupport |
containsHeader, createReference, doWriteObject, equals, getExpiration, getHeader, getMessageID, getPayload, getPayloadAsByteArray, getPriority, getTimestamp, hashCode, isExpired, isPersisted, isReliable, putHeader, readPayload, removeHeader, setExpiration, setPayload, setPersisted, setPriority |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
TYPE
public static final byte TYPE
- See Also:
- Constant Field Values
JMS_JBOSS_SCHEDULED_DELIVERY_PROP_NAME
public static final java.lang.String JMS_JBOSS_SCHEDULED_DELIVERY_PROP_NAME
- See Also:
- Constant Field Values
JBOSS_MESSAGING_ORIG_DESTINATION
public static final java.lang.String JBOSS_MESSAGING_ORIG_DESTINATION
- See Also:
- Constant Field Values
JBOSS_MESSAGING_ORIG_MESSAGE_ID
public static final java.lang.String JBOSS_MESSAGING_ORIG_MESSAGE_ID
- See Also:
- Constant Field Values
JBOSS_MESSAGING_ORIG_DESTINATION_SUCKER
public static final java.lang.String JBOSS_MESSAGING_ORIG_DESTINATION_SUCKER
- See Also:
- Constant Field Values
JBOSS_MESSAGING_ACTUAL_EXPIRY_TIME
public static final java.lang.String JBOSS_MESSAGING_ACTUAL_EXPIRY_TIME
- See Also:
- Constant Field Values
JBOSS_MESSAGING_BRIDGE_MESSAGE_ID_LIST
public static final java.lang.String JBOSS_MESSAGING_BRIDGE_MESSAGE_ID_LIST
- See Also:
- Constant Field Values
connectionID
protected transient java.lang.String connectionID
JBossMessage
public JBossMessage()
JBossMessage
public JBossMessage(long messageID)
JBossMessage
public JBossMessage(long messageID,
boolean reliable,
long expiration,
long timestamp,
byte priority,
java.util.Map headers,
byte[] payloadAsByteArray)
JBossMessage
protected JBossMessage(JBossMessage other)
- Create a new JBossMessage by making a shallow copy of another
- Parameters:
other
- The message to make a shallow copy from
JBossMessage
public JBossMessage(javax.jms.Message foreign,
long messageID)
throws javax.jms.JMSException
- A copy constructor for non-JBoss Messaging JMS messages.
- Throws:
javax.jms.JMSException
createThinDelegate
public static MessageProxy createThinDelegate(long deliveryId,
JBossMessage m,
int deliveryCount)
dump
public static java.lang.String dump(JBossMessage m)
isReference
public boolean isReference()
- Overrides:
isReference
in class MessageSupport
getJMSMessageID
public java.lang.String getJMSMessageID()
setJMSMessageID
public void setJMSMessageID(java.lang.String jmsMessageID)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getJMSTimestamp
public long getJMSTimestamp()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setJMSTimestamp
public void setJMSTimestamp(long timestamp)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getJMSCorrelationIDAsBytes
public byte[] getJMSCorrelationIDAsBytes()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setJMSCorrelationIDAsBytes
public void setJMSCorrelationIDAsBytes(byte[] correlationID)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setJMSCorrelationID
public void setJMSCorrelationID(java.lang.String correlationID)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getJMSCorrelationID
public java.lang.String getJMSCorrelationID()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getJMSReplyTo
public javax.jms.Destination getJMSReplyTo()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setJMSReplyTo
public void setJMSReplyTo(javax.jms.Destination replyTo)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getJMSDestination
public javax.jms.Destination getJMSDestination()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setJMSDestination
public void setJMSDestination(javax.jms.Destination destination)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getHeaders
public java.util.Map getHeaders()
- Specified by:
getHeaders
in interface Message
- Overrides:
getHeaders
in class MessageSupport
- Returns:
- The message's headers
getOriginalSuckerDestination
public javax.jms.Destination getOriginalSuckerDestination()
setOriginalSuckerDestination
public void setOriginalSuckerDestination(javax.jms.Destination destination)
getJMSDeliveryMode
public int getJMSDeliveryMode()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setJMSDeliveryMode
public void setJMSDeliveryMode(int deliveryMode)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getJMSRedelivered
public boolean getJMSRedelivered()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setJMSRedelivered
public void setJMSRedelivered(boolean redelivered)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getJMSType
public java.lang.String getJMSType()
throws javax.jms.JMSException
- Returns:
- java.lang.String type
- Throws:
javax.jms.JMSException
setJMSType
public void setJMSType(java.lang.String type)
throws javax.jms.JMSException
- Parameters:
type
-
- Throws:
javax.jms.JMSException
getJMSExpiration
public long getJMSExpiration()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setJMSExpiration
public void setJMSExpiration(long expiration)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getJMSPriority
public int getJMSPriority()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setJMSPriority
public void setJMSPriority(int priority)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
clearProperties
public void clearProperties()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
clearBody
public void clearBody()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
propertyExists
public boolean propertyExists(java.lang.String name)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getBooleanProperty
public boolean getBooleanProperty(java.lang.String name)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getByteProperty
public byte getByteProperty(java.lang.String name)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getShortProperty
public short getShortProperty(java.lang.String name)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getIntProperty
public int getIntProperty(java.lang.String name)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getLongProperty
public long getLongProperty(java.lang.String name)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getFloatProperty
public float getFloatProperty(java.lang.String name)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getDoubleProperty
public double getDoubleProperty(java.lang.String name)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getStringProperty
public java.lang.String getStringProperty(java.lang.String name)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getObjectProperty
public java.lang.Object getObjectProperty(java.lang.String name)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getPropertyNames
public java.util.Enumeration getPropertyNames()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setBooleanProperty
public void setBooleanProperty(java.lang.String name,
boolean value)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setByteProperty
public void setByteProperty(java.lang.String name,
byte value)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setShortProperty
public void setShortProperty(java.lang.String name,
short value)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setIntProperty
public void setIntProperty(java.lang.String name,
int value)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setLongProperty
public void setLongProperty(java.lang.String name,
long value)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setFloatProperty
public void setFloatProperty(java.lang.String name,
float value)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setDoubleProperty
public void setDoubleProperty(java.lang.String name,
double value)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setStringProperty
public void setStringProperty(java.lang.String name,
java.lang.String value)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
setObjectProperty
public void setObjectProperty(java.lang.String name,
java.lang.Object value)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
doBeforeSend
public void doBeforeSend()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
doBeforeReceive
public void doBeforeReceive()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getType
public byte getType()
- Specified by:
getType
in interface Message
- Returns:
- the type of the message
copyPayload
public void copyPayload(java.lang.Object payload)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
getConnectionID
public java.lang.String getConnectionID()
setConnectionID
public void setConnectionID(java.lang.String connectionID)
toString
public java.lang.String toString()
- Overrides:
toString
in class MessageSupport
doCopy
public JBossMessage doCopy()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
acknowledge
public void acknowledge()
setMessageId
public void setMessageId(long messageID)
getScheduledDeliveryTime
public long getScheduledDeliveryTime()
getJMSProperties
public java.util.Map getJMSProperties()
isCorrelationIDBytes
public boolean isCorrelationIDBytes()
write
public void write(java.io.DataOutputStream out)
throws java.lang.Exception
- Specified by:
write
in interface Streamable
- Overrides:
write
in class MessageSupport
- Throws:
java.lang.Exception
read
public void read(java.io.DataInputStream in)
throws java.lang.Exception
- Specified by:
read
in interface Streamable
- Overrides:
read
in class MessageSupport
- Throws:
java.lang.Exception
Copyright © 2006 JBoss Inc. All Rights Reserved.