public abstract class MessageImpl extends Object implements MessageInternal
| Modifier and Type | Field and Description |
|---|---|
protected SimpleString |
address |
static int |
BODY_OFFSET |
protected ResetLimitWrappedHornetQBuffer |
bodyBuffer |
protected HornetQBuffer |
buffer |
static int |
BUFFER_HEADER_SPACE |
protected boolean |
bufferValid |
protected boolean |
durable |
protected long |
expiration
GMT milliseconds at which this message expires.
|
static SimpleString |
HDR_BRIDGE_DUPLICATE_ID |
static SimpleString |
HDR_ROUTE_TO_IDS |
protected long |
messageID |
protected byte |
priority |
protected TypedProperties |
properties |
protected long |
timestamp |
protected byte |
type |
BYTES_TYPE, DEFAULT_TYPE, HDR_ACTUAL_EXPIRY_TIME, HDR_DUPLICATE_DETECTION_ID, HDR_GROUP_ID, HDR_LARGE_BODY_SIZE, HDR_LARGE_COMPRESSED, HDR_LAST_VALUE_NAME, HDR_ORIG_MESSAGE_ID, HDR_ORIGINAL_ADDRESS, HDR_SCHEDULED_DELIVERY_TIME, MAP_TYPE, OBJECT_TYPE, STREAM_TYPE, TEXT_TYPE| Modifier | Constructor and Description |
|---|---|
protected |
MessageImpl() |
protected |
MessageImpl(byte type,
boolean durable,
long expiration,
long timestamp,
byte priority,
int initialMessageBufferSize)
overridden by the client message, we need access to the connection so we can create the appropriate HornetQBuffer.
|
protected |
MessageImpl(int initialMessageBufferSize) |
protected |
MessageImpl(long messageID,
int initialMessageBufferSize) |
protected |
MessageImpl(MessageImpl other) |
protected |
MessageImpl(MessageImpl other,
TypedProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
bodyChanged() |
void |
checkCopy() |
boolean |
containsProperty(SimpleString key)
Returns
true if this message contains a property with the given key, false else. |
boolean |
containsProperty(String key) |
void |
copyHeadersAndProperties(MessageInternal msg) |
protected void |
createBody(int initialMessageBufferSize) |
void |
decode(HornetQBuffer buff) |
void |
decodeFromBuffer(HornetQBuffer buffer) |
void |
decodeHeadersAndProperties(HornetQBuffer buffer) |
void |
encode(HornetQBuffer buff) |
void |
encodeHeadersAndProperties(HornetQBuffer buffer) |
SimpleString |
getAddress()
Returns the address this message is sent to.
|
HornetQBuffer |
getBodyBuffer()
Returns the message body as a HornetQBuffer
|
BodyEncoder |
getBodyEncoder() |
Boolean |
getBooleanProperty(SimpleString key)
Returns the property corresponding to the specified key as a Boolean.
|
Boolean |
getBooleanProperty(String key) |
Byte |
getByteProperty(SimpleString key)
Returns the property corresponding to the specified key as a Byte.
|
Byte |
getByteProperty(String key) |
byte[] |
getBytesProperty(SimpleString key)
Returns the property corresponding to the specified key as a byte[].
|
byte[] |
getBytesProperty(String key) |
Double |
getDoubleProperty(SimpleString key)
Returns the property corresponding to the specified key as a Double.
|
Double |
getDoubleProperty(String key) |
HornetQBuffer |
getEncodedBuffer() |
int |
getEncodeSize()
Returns the size of the encoded message.
|
int |
getEndOfBodyPosition() |
int |
getEndOfMessagePosition() |
long |
getExpiration()
Returns the expiration time of this message.
|
Float |
getFloatProperty(SimpleString key)
Returns the property corresponding to the specified key as a Float.
|
Float |
getFloatProperty(String key) |
int |
getHeadersAndPropertiesEncodeSize() |
Integer |
getIntProperty(SimpleString key)
Returns the property corresponding to the specified key as an Integer.
|
Integer |
getIntProperty(String key) |
Long |
getLongProperty(SimpleString key)
Returns the property corresponding to the specified key as a Long.
|
Long |
getLongProperty(String key) |
long |
getMessageID()
Returns the messageID.
|
Object |
getObjectProperty(SimpleString key)
Returns the property corresponding to the specified key
|
Object |
getObjectProperty(String key) |
byte |
getPriority()
Returns the message priority.
|
Set<SimpleString> |
getPropertyNames()
Returns all the names of the properties for this message.
|
Short |
getShortProperty(SimpleString key)
Returns the property corresponding to the specified key as a Short.
|
Short |
getShortProperty(String key) |
SimpleString |
getSimpleStringProperty(SimpleString key)
Returns the property corresponding to the specified key as a SimpleString.
|
SimpleString |
getSimpleStringProperty(String key) |
String |
getStringProperty(SimpleString key)
Returns the property corresponding to the specified key as a String.
|
String |
getStringProperty(String key) |
long |
getTimestamp()
Returns the message timestamp.
|
byte |
getType()
Returns this message type.
|
TypedProperties |
getTypedProperties() |
UUID |
getUserID()
Returns the userID - this is an optional user specified UUID that can be set to identify the message
and will be passed around with the message
|
HornetQBuffer |
getWholeBuffer() |
boolean |
isDurable()
Returns whether this message is durable or not.
|
boolean |
isExpired()
Returns whether this message is expired or not.
|
void |
putBooleanProperty(SimpleString key,
boolean value)
Puts a boolean property in this message.
|
void |
putBooleanProperty(String key,
boolean value) |
void |
putByteProperty(SimpleString key,
byte value)
Puts a byte property in this message.
|
void |
putByteProperty(String key,
byte value) |
void |
putBytesProperty(SimpleString key,
byte[] value)
Puts a byte[] property in this message.
|
void |
putBytesProperty(String key,
byte[] value) |
void |
putDoubleProperty(SimpleString key,
double value)
Puts a double property in this message.
|
void |
putDoubleProperty(String key,
double value) |
void |
putFloatProperty(SimpleString key,
float value)
Puts a float property in this message.
|
void |
putFloatProperty(String key,
float value) |
void |
putIntProperty(SimpleString key,
int value)
Puts a int property in this message.
|
void |
putIntProperty(String key,
int value) |
void |
putLongProperty(SimpleString key,
long value)
Puts a long property in this message.
|
void |
putLongProperty(String key,
long value) |
void |
putObjectProperty(SimpleString key,
Object value)
Puts an Object property in this message.
|
void |
putObjectProperty(String key,
Object value) |
void |
putShortProperty(SimpleString key,
short value)
Puts a short property in this message.
|
void |
putShortProperty(String key,
short value) |
void |
putStringProperty(SimpleString key,
SimpleString value)
Puts a SimpleString property in this message.
|
void |
putStringProperty(String key,
String value)
Puts a String property in this message.
|
void |
putTypedProperties(TypedProperties otherProps) |
Object |
removeProperty(SimpleString key)
Removes the property corresponding to the specified key.
|
Object |
removeProperty(String key) |
void |
resetCopied() |
void |
setAddress(SimpleString address)
Sets the address to send this message to.
|
void |
setAddressTransient(SimpleString address) |
void |
setDurable(boolean durable)
Sets whether this message is durable or not.
|
void |
setExpiration(long expiration)
Sets the expiration of this message.
|
void |
setPriority(byte priority)
Sets the message priority.
|
void |
setTimestamp(long timestamp)
Sets the message timestamp.
|
void |
setType(byte type) |
void |
setUserID(UUID userID)
Sets the user ID
|
Map<String,Object> |
toMap() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBodyInputStream, isServerMessageisLargeMessagepublic static final SimpleString HDR_ROUTE_TO_IDS
public static final SimpleString HDR_BRIDGE_DUPLICATE_ID
public static final int BUFFER_HEADER_SPACE
public static final int BODY_OFFSET
protected long messageID
protected SimpleString address
protected byte type
protected boolean durable
protected long expiration
protected long timestamp
protected TypedProperties properties
protected byte priority
protected HornetQBuffer buffer
protected ResetLimitWrappedHornetQBuffer bodyBuffer
protected volatile boolean bufferValid
protected MessageImpl()
protected MessageImpl(byte type,
boolean durable,
long expiration,
long timestamp,
byte priority,
int initialMessageBufferSize)
type - durable - expiration - timestamp - priority - initialMessageBufferSize - protected MessageImpl(long messageID,
int initialMessageBufferSize)
protected MessageImpl(int initialMessageBufferSize)
protected MessageImpl(MessageImpl other)
protected MessageImpl(MessageImpl other, TypedProperties properties)
public int getEncodeSize()
MessagegetEncodeSize in interface Messagepublic int getHeadersAndPropertiesEncodeSize()
getHeadersAndPropertiesEncodeSize in interface MessageInternalpublic void encodeHeadersAndProperties(HornetQBuffer buffer)
encodeHeadersAndProperties in interface MessageInternalpublic void decodeHeadersAndProperties(HornetQBuffer buffer)
decodeHeadersAndProperties in interface MessageInternalpublic void copyHeadersAndProperties(MessageInternal msg)
public HornetQBuffer getBodyBuffer()
MessagegetBodyBuffer in interface Messagepublic long getMessageID()
MessagegetMessageID in interface Messagepublic UUID getUserID()
Messagepublic void setUserID(UUID userID)
Messagepublic SimpleString getAddress()
MessagegetAddress in interface Messagepublic void setAddress(SimpleString address)
MessagesetAddress in interface Messageaddress - address to send the message topublic byte getType()
Messagepublic void setType(byte type)
public boolean isDurable()
Messagepublic void setDurable(boolean durable)
MessagesetDurable in interface Messagedurable - true to flag this message as durable, false elsepublic long getExpiration()
MessagegetExpiration in interface Messagepublic void setExpiration(long expiration)
MessagesetExpiration in interface Messageexpiration - expiration timepublic long getTimestamp()
MessagegetTimestamp in interface Messagepublic void setTimestamp(long timestamp)
MessagesetTimestamp in interface Messagetimestamp - timestamppublic byte getPriority()
MessagegetPriority in interface Messagepublic void setPriority(byte priority)
MessagesetPriority in interface Messagepriority - the new message prioritypublic boolean isExpired()
Messagepublic void decodeFromBuffer(HornetQBuffer buffer)
decodeFromBuffer in interface MessageInternalpublic void bodyChanged()
bodyChanged in interface MessageInternalpublic void checkCopy()
checkCopy in interface MessageInternalpublic void resetCopied()
resetCopied in interface MessageInternalpublic int getEndOfMessagePosition()
getEndOfMessagePosition in interface MessageInternalpublic int getEndOfBodyPosition()
getEndOfBodyPosition in interface MessageInternalpublic void encode(HornetQBuffer buff)
public void decode(HornetQBuffer buff)
public HornetQBuffer getEncodedBuffer()
getEncodedBuffer in interface MessageInternalpublic void setAddressTransient(SimpleString address)
setAddressTransient in interface MessageInternalpublic void putBooleanProperty(SimpleString key, boolean value)
MessageputBooleanProperty in interface Messagekey - property namevalue - property valuepublic void putByteProperty(SimpleString key, byte value)
MessageputByteProperty in interface Messagekey - property namevalue - property valuepublic void putBytesProperty(SimpleString key, byte[] value)
MessageputBytesProperty in interface Messagekey - property namevalue - property valuepublic void putShortProperty(SimpleString key, short value)
MessageputShortProperty in interface Messagekey - property namevalue - property valuepublic void putIntProperty(SimpleString key, int value)
MessageputIntProperty in interface Messagekey - property namevalue - property valuepublic void putLongProperty(SimpleString key, long value)
MessageputLongProperty in interface Messagekey - property namevalue - property valuepublic void putFloatProperty(SimpleString key, float value)
MessageputFloatProperty in interface Messagekey - property namevalue - property valuepublic void putDoubleProperty(SimpleString key, double value)
MessageputDoubleProperty in interface Messagekey - property namevalue - property valuepublic void putStringProperty(SimpleString key, SimpleString value)
MessageputStringProperty in interface Messagekey - property namevalue - property valuepublic void putObjectProperty(SimpleString key, Object value) throws PropertyConversionException
MessageputObjectProperty in interface Messagekey - property namevalue - property valuePropertyConversionException - if the value is not one of the accepted property types.public void putObjectProperty(String key, Object value) throws PropertyConversionException
putObjectProperty in interface MessagePropertyConversionExceptionMessage.putObjectProperty(SimpleString, Object)public void putBooleanProperty(String key, boolean value)
putBooleanProperty in interface MessageMessage.putBooleanProperty(SimpleString, boolean)public void putByteProperty(String key, byte value)
putByteProperty in interface MessageMessage.putByteProperty(SimpleString, byte)public void putBytesProperty(String key, byte[] value)
putBytesProperty in interface MessageMessage.putBytesProperty(SimpleString, byte[])public void putShortProperty(String key, short value)
putShortProperty in interface MessageMessage.putShortProperty(SimpleString, short)public void putIntProperty(String key, int value)
putIntProperty in interface MessageMessage.putIntProperty(SimpleString, int)public void putLongProperty(String key, long value)
putLongProperty in interface MessageMessage.putLongProperty(SimpleString, long)public void putFloatProperty(String key, float value)
putFloatProperty in interface MessageMessage.putFloatProperty(SimpleString, float)public void putDoubleProperty(String key, double value)
putDoubleProperty in interface MessageMessage.putDoubleProperty(SimpleString, double)public void putStringProperty(String key, String value)
MessageputStringProperty in interface Messagekey - property namevalue - property valuepublic void putTypedProperties(TypedProperties otherProps)
public Object getObjectProperty(SimpleString key)
MessagegetObjectProperty in interface Messagepublic Boolean getBooleanProperty(SimpleString key) throws PropertyConversionException
MessagegetBooleanProperty in interface MessagePropertyConversionException - if the value can not be converted to a Booleanpublic Boolean getBooleanProperty(String key) throws PropertyConversionException
getBooleanProperty in interface MessagePropertyConversionExceptionMessage.getBooleanProperty(SimpleString)public Byte getByteProperty(SimpleString key) throws PropertyConversionException
MessagegetByteProperty in interface MessagePropertyConversionException - if the value can not be converted to a Bytepublic Byte getByteProperty(String key) throws PropertyConversionException
getByteProperty in interface MessagePropertyConversionExceptionMessage.getByteProperty(SimpleString)public byte[] getBytesProperty(SimpleString key) throws PropertyConversionException
MessagegetBytesProperty in interface MessagePropertyConversionException - if the value can not be converted to a byte[]public byte[] getBytesProperty(String key) throws PropertyConversionException
getBytesProperty in interface MessagePropertyConversionExceptionMessage.getBytesProperty(SimpleString)public Double getDoubleProperty(SimpleString key) throws PropertyConversionException
MessagegetDoubleProperty in interface MessagePropertyConversionException - if the value can not be converted to a Doublepublic Double getDoubleProperty(String key) throws PropertyConversionException
getDoubleProperty in interface MessagePropertyConversionExceptionMessage.getDoubleProperty(SimpleString)public Integer getIntProperty(SimpleString key) throws PropertyConversionException
MessagegetIntProperty in interface MessagePropertyConversionException - if the value can not be converted to an Integerpublic Integer getIntProperty(String key) throws PropertyConversionException
getIntProperty in interface MessagePropertyConversionExceptionMessage.getIntProperty(SimpleString)public Long getLongProperty(SimpleString key) throws PropertyConversionException
MessagegetLongProperty in interface MessagePropertyConversionException - if the value can not be converted to a Longpublic Long getLongProperty(String key) throws PropertyConversionException
getLongProperty in interface MessagePropertyConversionExceptionMessage.getLongProperty(SimpleString)public Short getShortProperty(SimpleString key) throws PropertyConversionException
MessagegetShortProperty in interface MessagePropertyConversionException - if the value can not be converted to a Shortpublic Short getShortProperty(String key) throws PropertyConversionException
getShortProperty in interface MessagePropertyConversionExceptionMessage.getShortProperty(SimpleString)public Float getFloatProperty(SimpleString key) throws PropertyConversionException
MessagegetFloatProperty in interface MessagePropertyConversionException - if the value can not be converted to a Floatpublic Float getFloatProperty(String key) throws PropertyConversionException
getFloatProperty in interface MessagePropertyConversionExceptionMessage.getFloatProperty(SimpleString)public String getStringProperty(SimpleString key) throws PropertyConversionException
MessagegetStringProperty in interface MessagePropertyConversionException - if the value can not be converted to a Stringpublic String getStringProperty(String key) throws PropertyConversionException
getStringProperty in interface MessagePropertyConversionExceptionMessage.getStringProperty(SimpleString)public SimpleString getSimpleStringProperty(SimpleString key) throws PropertyConversionException
MessagegetSimpleStringProperty in interface MessagePropertyConversionException - if the value can not be converted to a SimpleStringpublic SimpleString getSimpleStringProperty(String key) throws PropertyConversionException
getSimpleStringProperty in interface MessagePropertyConversionExceptionMessage.getSimpleStringProperty(SimpleString)public Object getObjectProperty(String key)
getObjectProperty in interface MessageMessage.getBooleanProperty(SimpleString)public Object removeProperty(SimpleString key)
MessageremoveProperty in interface Messagekey - property namepublic Object removeProperty(String key)
removeProperty in interface MessageMessage.removeProperty(SimpleString)public boolean containsProperty(SimpleString key)
Messagetrue if this message contains a property with the given key, false else.containsProperty in interface Messagekey - property namepublic boolean containsProperty(String key)
containsProperty in interface MessageMessage.containsProperty(SimpleString)public Set<SimpleString> getPropertyNames()
MessagegetPropertyNames in interface Messagepublic HornetQBuffer getWholeBuffer()
getWholeBuffer in interface MessageInternalpublic BodyEncoder getBodyEncoder() throws HornetQException
getBodyEncoder in interface MessageInternalHornetQExceptionpublic TypedProperties getTypedProperties()
getTypedProperties in interface MessageInternalprotected void createBody(int initialMessageBufferSize)
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.