org.jboss.messaging.core.message.impl
Class MessageImpl
java.lang.Object
org.jboss.messaging.core.message.impl.MessageImpl
- All Implemented Interfaces:
- Message
- Direct Known Subclasses:
- ClientMessageImpl, ServerMessageImpl
public abstract class MessageImpl
- extends java.lang.Object
- implements Message
A concrete implementation of a message
All messages handled by JBM core are of this type
- Version:
- $Revision: 2740 $
$Id: MessageSupport.java 2740 2007-05-30 11:36:28Z timfox $
- Author:
- Ovidiu Feodorov, Tim Fox, Clebert Suconic, Andy Taylor
Method Summary |
boolean |
containsProperty(SimpleString key)
|
boolean |
containsProperty(java.lang.String key)
|
void |
decode(MessagingBuffer buffer)
|
void |
decodeBody(MessagingBuffer buffer)
|
void |
decodeProperties(MessagingBuffer buffer)
|
void |
encode(MessagingBuffer buffer)
|
void |
encodeBody(MessagingBuffer buffer)
|
void |
encodeBody(MessagingBuffer buffer,
long start,
int size)
|
void |
encodeProperties(MessagingBuffer buffer)
|
MessagingBuffer |
getBody()
|
java.io.InputStream |
getBodyInputStream()
Get the InputStream used on a message that will be sent over a producer |
int |
getBodySize()
|
SimpleString |
getDestination()
|
int |
getEncodeSize()
|
long |
getExpiration()
|
long |
getMessageID()
|
byte |
getPriority()
|
TypedProperties |
getProperties()
|
int |
getPropertiesEncodeSize()
|
java.lang.Object |
getProperty(SimpleString key)
|
java.lang.Object |
getProperty(java.lang.String key)
|
java.util.Set<SimpleString> |
getPropertyNames()
|
long |
getTimestamp()
|
byte |
getType()
|
boolean |
isDurable()
|
boolean |
isExpired()
|
void |
putBooleanProperty(SimpleString key,
boolean value)
|
void |
putBooleanProperty(java.lang.String key,
boolean value)
|
void |
putByteProperty(SimpleString key,
byte value)
|
void |
putByteProperty(java.lang.String key,
byte value)
|
void |
putBytesProperty(SimpleString key,
byte[] value)
|
void |
putBytesProperty(java.lang.String key,
byte[] value)
|
void |
putDoubleProperty(SimpleString key,
double value)
|
void |
putDoubleProperty(java.lang.String key,
double value)
|
void |
putFloatProperty(SimpleString key,
float value)
|
void |
putFloatProperty(java.lang.String key,
float value)
|
void |
putIntProperty(SimpleString key,
int value)
|
void |
putIntProperty(java.lang.String key,
int value)
|
void |
putLongProperty(SimpleString key,
long value)
|
void |
putLongProperty(java.lang.String key,
long value)
|
void |
putShortProperty(SimpleString key,
short value)
|
void |
putShortProperty(java.lang.String key,
short value)
|
void |
putStringProperty(SimpleString key,
SimpleString value)
|
void |
putStringProperty(java.lang.String key,
java.lang.String value)
|
void |
putTypedProperties(TypedProperties otherProps)
|
java.lang.Object |
removeProperty(SimpleString key)
|
java.lang.Object |
removeProperty(java.lang.String key)
|
void |
setBody(MessagingBuffer body)
|
void |
setBodyInputStream(java.io.InputStream bodyInputStream)
Set the InputStream used on a message that will be sent over a producer |
void |
setDestination(SimpleString destination)
|
void |
setDurable(boolean durable)
|
void |
setExpiration(long expiration)
|
void |
setPriority(byte priority)
|
void |
setTimestamp(long timestamp)
|
java.util.Map<java.lang.String,java.lang.Object> |
toMap()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HDR_ACTUAL_EXPIRY_TIME
public static final SimpleString HDR_ACTUAL_EXPIRY_TIME
HDR_ORIGINAL_DESTINATION
public static final SimpleString HDR_ORIGINAL_DESTINATION
HDR_ORIG_MESSAGE_ID
public static final SimpleString HDR_ORIG_MESSAGE_ID
HDR_GROUP_ID
public static final SimpleString HDR_GROUP_ID
HDR_SCHEDULED_DELIVERY_TIME
public static final SimpleString HDR_SCHEDULED_DELIVERY_TIME
HDR_DUPLICATE_DETECTION_ID
public static final SimpleString HDR_DUPLICATE_DETECTION_ID
HDR_ROUTE_TO_IDS
public static final SimpleString HDR_ROUTE_TO_IDS
HDR_FROM_CLUSTER
public static final SimpleString HDR_FROM_CLUSTER
HDR_LAST_VALUE_NAME
public static final SimpleString HDR_LAST_VALUE_NAME
messageID
protected long messageID
type
protected byte type
durable
protected boolean durable
MessageImpl
protected MessageImpl()
MessageImpl
protected MessageImpl(byte type,
boolean durable,
long expiration,
long timestamp,
byte priority,
MessagingBuffer body)
- overridden by the client message, we need access to the connection so we can create the appropriate MessagingBuffer.
- Parameters:
type
- durable
- expiration
- timestamp
- priority
- body
-
MessageImpl
protected MessageImpl(MessageImpl other)
MessageImpl
protected MessageImpl(Message other)
MessageImpl
protected MessageImpl(long messageID)
encode
public void encode(MessagingBuffer buffer)
- Specified by:
encode
in interface Message
getEncodeSize
public int getEncodeSize()
- Specified by:
getEncodeSize
in interface Message
getPropertiesEncodeSize
public int getPropertiesEncodeSize()
- Specified by:
getPropertiesEncodeSize
in interface Message
getBodySize
public int getBodySize()
- Specified by:
getBodySize
in interface Message
encodeProperties
public void encodeProperties(MessagingBuffer buffer)
- Specified by:
encodeProperties
in interface Message
encodeBody
public void encodeBody(MessagingBuffer buffer)
- Specified by:
encodeBody
in interface Message
encodeBody
public void encodeBody(MessagingBuffer buffer,
long start,
int size)
- Specified by:
encodeBody
in interface Message
decode
public void decode(MessagingBuffer buffer)
- Specified by:
decode
in interface Message
decodeProperties
public void decodeProperties(MessagingBuffer buffer)
- Specified by:
decodeProperties
in interface Message
decodeBody
public void decodeBody(MessagingBuffer buffer)
- Specified by:
decodeBody
in interface Message
getMessageID
public long getMessageID()
- Specified by:
getMessageID
in interface Message
getDestination
public SimpleString getDestination()
- Specified by:
getDestination
in interface Message
setDestination
public void setDestination(SimpleString destination)
- Specified by:
setDestination
in interface Message
getType
public byte getType()
- Specified by:
getType
in interface Message
isDurable
public boolean isDurable()
- Specified by:
isDurable
in interface Message
setDurable
public void setDurable(boolean durable)
- Specified by:
setDurable
in interface Message
getExpiration
public long getExpiration()
- Specified by:
getExpiration
in interface Message
setExpiration
public void setExpiration(long expiration)
- Specified by:
setExpiration
in interface Message
getTimestamp
public long getTimestamp()
- Specified by:
getTimestamp
in interface Message
setTimestamp
public void setTimestamp(long timestamp)
- Specified by:
setTimestamp
in interface Message
getPriority
public byte getPriority()
- Specified by:
getPriority
in interface Message
setPriority
public void setPriority(byte priority)
- Specified by:
setPriority
in interface Message
isExpired
public boolean isExpired()
- Specified by:
isExpired
in interface Message
getBodyInputStream
public java.io.InputStream getBodyInputStream()
- Description copied from interface:
Message
- Get the InputStream used on a message that will be sent over a producer
- Specified by:
getBodyInputStream
in interface Message
- Returns:
- the bodyInputStream
setBodyInputStream
public void setBodyInputStream(java.io.InputStream bodyInputStream)
- Description copied from interface:
Message
- Set the InputStream used on a message that will be sent over a producer
- Specified by:
setBodyInputStream
in interface Message
- Parameters:
bodyInputStream
- the bodyInputStream to set
toMap
public java.util.Map<java.lang.String,java.lang.Object> toMap()
- Specified by:
toMap
in interface Message
putBooleanProperty
public void putBooleanProperty(SimpleString key,
boolean value)
- Specified by:
putBooleanProperty
in interface Message
putByteProperty
public void putByteProperty(SimpleString key,
byte value)
- Specified by:
putByteProperty
in interface Message
putBytesProperty
public void putBytesProperty(SimpleString key,
byte[] value)
- Specified by:
putBytesProperty
in interface Message
putShortProperty
public void putShortProperty(SimpleString key,
short value)
- Specified by:
putShortProperty
in interface Message
putIntProperty
public void putIntProperty(SimpleString key,
int value)
- Specified by:
putIntProperty
in interface Message
putLongProperty
public void putLongProperty(SimpleString key,
long value)
- Specified by:
putLongProperty
in interface Message
putFloatProperty
public void putFloatProperty(SimpleString key,
float value)
- Specified by:
putFloatProperty
in interface Message
putDoubleProperty
public void putDoubleProperty(SimpleString key,
double value)
- Specified by:
putDoubleProperty
in interface Message
putStringProperty
public void putStringProperty(SimpleString key,
SimpleString value)
- Specified by:
putStringProperty
in interface Message
putBooleanProperty
public void putBooleanProperty(java.lang.String key,
boolean value)
- Specified by:
putBooleanProperty
in interface Message
putByteProperty
public void putByteProperty(java.lang.String key,
byte value)
- Specified by:
putByteProperty
in interface Message
putBytesProperty
public void putBytesProperty(java.lang.String key,
byte[] value)
- Specified by:
putBytesProperty
in interface Message
putShortProperty
public void putShortProperty(java.lang.String key,
short value)
- Specified by:
putShortProperty
in interface Message
putIntProperty
public void putIntProperty(java.lang.String key,
int value)
- Specified by:
putIntProperty
in interface Message
putLongProperty
public void putLongProperty(java.lang.String key,
long value)
- Specified by:
putLongProperty
in interface Message
putFloatProperty
public void putFloatProperty(java.lang.String key,
float value)
- Specified by:
putFloatProperty
in interface Message
putDoubleProperty
public void putDoubleProperty(java.lang.String key,
double value)
- Specified by:
putDoubleProperty
in interface Message
putStringProperty
public void putStringProperty(java.lang.String key,
java.lang.String value)
- Specified by:
putStringProperty
in interface Message
putTypedProperties
public void putTypedProperties(TypedProperties otherProps)
- Specified by:
putTypedProperties
in interface Message
getProperty
public java.lang.Object getProperty(SimpleString key)
- Specified by:
getProperty
in interface Message
getProperty
public java.lang.Object getProperty(java.lang.String key)
- Specified by:
getProperty
in interface Message
removeProperty
public java.lang.Object removeProperty(SimpleString key)
- Specified by:
removeProperty
in interface Message
removeProperty
public java.lang.Object removeProperty(java.lang.String key)
- Specified by:
removeProperty
in interface Message
containsProperty
public boolean containsProperty(SimpleString key)
- Specified by:
containsProperty
in interface Message
containsProperty
public boolean containsProperty(java.lang.String key)
- Specified by:
containsProperty
in interface Message
getPropertyNames
public java.util.Set<SimpleString> getPropertyNames()
- Specified by:
getPropertyNames
in interface Message
getProperties
public TypedProperties getProperties()
- Specified by:
getProperties
in interface Message
getBody
public MessagingBuffer getBody()
- Specified by:
getBody
in interface Message
setBody
public void setBody(MessagingBuffer body)
- Specified by:
setBody
in interface Message
Copyright © 2006 JBoss Inc. All Rights Reserved.