public abstract class MessageImpl extends Object implements MessageInternal
All messages handled by ActiveMQ Artemis core are of this type
| Modifier and Type | Field and Description |
|---|---|
protected SimpleString |
address |
static int |
BODY_OFFSET |
protected ResetLimitWrappedActiveMQBuffer |
bodyBuffer |
protected ActiveMQBuffer |
buffer |
static int |
BUFFER_HEADER_SPACE |
protected boolean |
bufferValid |
protected boolean |
durable |
static SimpleString |
HDR_BRIDGE_DUPLICATE_ID |
static SimpleString |
HDR_ROUTE_TO_ACK_IDS |
static SimpleString |
HDR_ROUTE_TO_IDS |
static SimpleString |
HDR_SCALEDOWN_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_CONTENT_TYPE, 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_ORIGINAL_QUEUE, HDR_ROUTING_TYPE, HDR_SCHEDULED_DELIVERY_TIME, HDR_VALIDATED_USER, 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 ActiveMQBuffer.
|
protected |
MessageImpl(int initialMessageBufferSize) |
protected |
MessageImpl(MessageImpl other) |
protected |
MessageImpl(MessageImpl other,
TypedProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
bodyChanged() |
String |
bodyToString()
Debug Helper!!!!
I'm leaving this message here without any callers for a reason:
During debugs it's important eventually to identify what's on the bodies, and this method will give you a good idea about them.
|
void |
checkCompletion() |
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) |
void |
createBody(int initialMessageBufferSize) |
void |
decode(ActiveMQBuffer buff) |
void |
decodeFromBuffer(ActiveMQBuffer buffer) |
void |
decodeHeadersAndProperties(ActiveMQBuffer buffer) |
void |
encode(ActiveMQBuffer buff) |
void |
encodeHeadersAndProperties(ActiveMQBuffer buffer) |
boolean |
equals(Object other) |
SimpleString |
getAddress()
this doesn't need to be synchronized as setAddress is protecting the buffer,
not the address
|
ActiveMQBuffer |
getBodyBuffer()
Returns the message body as an ActiveMQBuffer
|
ActiveMQBuffer |
getBodyBufferDuplicate()
Returns a copy of the message body as an ActiveMQBuffer.
|
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) |
ActiveMQBuffer |
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.
|
TypedProperties |
getProperties() |
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
|
ActiveMQBuffer |
getWholeBuffer() |
int |
hashCode() |
boolean |
isDurable()
Returns whether this message is durable or not.
|
boolean |
isExpired()
Returns whether this message is expired or not.
|
Message |
putBooleanProperty(SimpleString key,
boolean value)
Puts a boolean property in this message.
|
Message |
putBooleanProperty(String key,
boolean value) |
Message |
putByteProperty(SimpleString key,
byte value)
Puts a byte property in this message.
|
Message |
putByteProperty(String key,
byte value) |
Message |
putBytesProperty(SimpleString key,
byte[] value)
Puts a byte[] property in this message.
|
Message |
putBytesProperty(String key,
byte[] value) |
Message |
putCharProperty(SimpleString key,
char value)
Puts a char property in this message.
|
Message |
putCharProperty(String key,
char value) |
Message |
putDoubleProperty(SimpleString key,
double value)
Puts a double property in this message.
|
Message |
putDoubleProperty(String key,
double value) |
Message |
putFloatProperty(SimpleString key,
float value)
Puts a float property in this message.
|
Message |
putFloatProperty(String key,
float value) |
Message |
putIntProperty(SimpleString key,
int value)
Puts an int property in this message.
|
Message |
putIntProperty(String key,
int value) |
Message |
putLongProperty(SimpleString key,
long value)
Puts a long property in this message.
|
Message |
putLongProperty(String key,
long value) |
Message |
putObjectProperty(SimpleString key,
Object value)
Puts an Object property in this message.
|
Message |
putObjectProperty(String key,
Object value) |
Message |
putShortProperty(SimpleString key,
short value)
Puts a short property in this message.
|
Message |
putShortProperty(String key,
short value) |
Message |
putStringProperty(SimpleString key,
SimpleString value)
Puts a SimpleString property in this message.
|
Message |
putStringProperty(String key,
String value)
Puts a String property in this message.
|
Message |
putTypedProperties(TypedProperties otherProps) |
Object |
removeProperty(SimpleString key)
Removes the property corresponding to the specified key.
|
Object |
removeProperty(String key) |
Message |
setAddress(SimpleString address)
The only reason this is synchronized is because of encoding a message versus invalidating the buffer.
|
void |
setAddressTransient(SimpleString address) |
MessageImpl |
setDurable(boolean durable)
Sets whether this message is durable or not.
|
MessageImpl |
setExpiration(long expiration)
Sets the expiration of this message.
|
MessageImpl |
setPriority(byte priority)
Sets the message priority.
|
MessageImpl |
setTimestamp(long timestamp)
Sets the message timestamp.
|
void |
setType(byte type) |
MessageImpl |
setUserID(UUID userID)
Sets the user ID
|
Map<String,Object> |
toMap() |
Map<String,Object> |
toPropertyMap() |
Message |
writeBodyBufferBytes(byte[] bytes)
Writes the input byte array to the message body ActiveMQBuffer
|
Message |
writeBodyBufferString(String string)
Writes the input String to the message body ActiveMQBuffer
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetBodyInputStream, isServerMessageisLargeMessagepublic static final SimpleString HDR_ROUTE_TO_IDS
public static final SimpleString HDR_SCALEDOWN_TO_IDS
public static final SimpleString HDR_ROUTE_TO_ACK_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 timestamp
protected TypedProperties properties
protected byte priority
protected volatile ActiveMQBuffer buffer
protected volatile ResetLimitWrappedActiveMQBuffer 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(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(ActiveMQBuffer buffer)
encodeHeadersAndProperties in interface MessageInternalpublic void decodeHeadersAndProperties(ActiveMQBuffer buffer)
decodeHeadersAndProperties in interface MessageInternalpublic void copyHeadersAndProperties(MessageInternal msg)
public ActiveMQBuffer getBodyBuffer()
MessagegetBodyBuffer in interface Messagepublic Message writeBodyBufferBytes(byte[] bytes)
MessagewriteBodyBufferBytes in interface Messagepublic Message writeBodyBufferString(String string)
MessagewriteBodyBufferString in interface Messagepublic void checkCompletion()
throws ActiveMQException
ActiveMQExceptionpublic ActiveMQBuffer getBodyBufferDuplicate()
MessagegetBodyBufferDuplicate in interface Messagepublic long getMessageID()
MessagegetMessageID in interface Messagepublic UUID getUserID()
Messagepublic MessageImpl setUserID(UUID userID)
Messagepublic SimpleString getAddress()
getAddress in interface Messagepublic Message setAddress(SimpleString address)
setAddress in interface Messageaddress - address to send the message topublic byte getType()
MessageSee fields *_TYPE for possible values.
public void setType(byte type)
public boolean isDurable()
Messagepublic MessageImpl setDurable(boolean durable)
MessagesetDurable in interface Messagedurable - true to flag this message as durable, false elsepublic long getExpiration()
MessagegetExpiration in interface Messagepublic MessageImpl setExpiration(long expiration)
MessagesetExpiration in interface Messageexpiration - expiration timepublic long getTimestamp()
MessagegetTimestamp in interface Messagepublic MessageImpl setTimestamp(long timestamp)
MessagesetTimestamp in interface Messagetimestamp - timestamppublic byte getPriority()
MessageValues range from 0 (less priority) to 9 (more priority) inclusive.
getPriority in interface Messagepublic MessageImpl setPriority(byte priority)
MessageValue must be between 0 and 9 inclusive.
setPriority in interface Messagepriority - the new message prioritypublic boolean isExpired()
Messagepublic Map<String,Object> toPropertyMap()
toPropertyMap in interface Messagepublic void decodeFromBuffer(ActiveMQBuffer buffer)
decodeFromBuffer in interface MessageInternalpublic void bodyChanged()
bodyChanged in interface MessageInternalpublic int getEndOfMessagePosition()
getEndOfMessagePosition in interface MessageInternalpublic int getEndOfBodyPosition()
getEndOfBodyPosition in interface MessageInternalpublic void encode(ActiveMQBuffer buff)
public void decode(ActiveMQBuffer buff)
public ActiveMQBuffer getEncodedBuffer()
getEncodedBuffer in interface MessageInternalpublic void setAddressTransient(SimpleString address)
setAddressTransient in interface MessageInternalpublic Message putBooleanProperty(SimpleString key, boolean value)
MessageputBooleanProperty in interface Messagekey - property namevalue - property valuepublic Message putByteProperty(SimpleString key, byte value)
MessageputByteProperty in interface Messagekey - property namevalue - property valuepublic Message putBytesProperty(SimpleString key, byte[] value)
MessageputBytesProperty in interface Messagekey - property namevalue - property valuepublic Message putCharProperty(SimpleString key, char value)
MessageputCharProperty in interface Messagekey - property namevalue - property valuepublic Message putCharProperty(String key, char value)
putCharProperty in interface MessageMessage.putCharProperty(SimpleString, char)public Message putShortProperty(SimpleString key, short value)
MessageputShortProperty in interface Messagekey - property namevalue - property valuepublic Message putIntProperty(SimpleString key, int value)
MessageputIntProperty in interface Messagekey - property namevalue - property valuepublic Message putLongProperty(SimpleString key, long value)
MessageputLongProperty in interface Messagekey - property namevalue - property valuepublic Message putFloatProperty(SimpleString key, float value)
MessageputFloatProperty in interface Messagekey - property namevalue - property valuepublic Message putDoubleProperty(SimpleString key, double value)
MessageputDoubleProperty in interface Messagekey - property namevalue - property valuepublic Message putStringProperty(SimpleString key, SimpleString value)
MessageputStringProperty in interface Messagekey - property namevalue - property valuepublic Message putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException
MessageputObjectProperty in interface Messagekey - property namevalue - property valueActiveMQPropertyConversionException - if the value is not one of the accepted property
types.public Message putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException
putObjectProperty in interface MessageActiveMQPropertyConversionExceptionMessage.putObjectProperty(SimpleString, Object)public Message putBooleanProperty(String key, boolean value)
putBooleanProperty in interface MessageMessage.putBooleanProperty(SimpleString, boolean)public Message putByteProperty(String key, byte value)
putByteProperty in interface MessageMessage.putByteProperty(SimpleString, byte)public Message putBytesProperty(String key, byte[] value)
putBytesProperty in interface MessageMessage.putBytesProperty(SimpleString, byte[])public Message putShortProperty(String key, short value)
putShortProperty in interface MessageMessage.putShortProperty(SimpleString, short)public Message putIntProperty(String key, int value)
putIntProperty in interface MessageMessage.putIntProperty(SimpleString, int)public Message putLongProperty(String key, long value)
putLongProperty in interface MessageMessage.putLongProperty(SimpleString, long)public Message putFloatProperty(String key, float value)
putFloatProperty in interface MessageMessage.putFloatProperty(SimpleString, float)public Message putDoubleProperty(String key, double value)
putDoubleProperty in interface MessageMessage.putDoubleProperty(SimpleString, double)public Message putStringProperty(String key, String value)
MessageputStringProperty in interface Messagekey - property namevalue - property valuepublic Message putTypedProperties(TypedProperties otherProps)
public Object getObjectProperty(SimpleString key)
MessagegetObjectProperty in interface Messagepublic Boolean getBooleanProperty(SimpleString key) throws ActiveMQPropertyConversionException
MessagegetBooleanProperty in interface MessageActiveMQPropertyConversionException - if the value can not be converted to a Booleanpublic Boolean getBooleanProperty(String key) throws ActiveMQPropertyConversionException
getBooleanProperty in interface MessageActiveMQPropertyConversionExceptionMessage.getBooleanProperty(SimpleString)public Byte getByteProperty(SimpleString key) throws ActiveMQPropertyConversionException
MessagegetByteProperty in interface MessageActiveMQPropertyConversionException - if the value can not be converted to a Bytepublic Byte getByteProperty(String key) throws ActiveMQPropertyConversionException
getByteProperty in interface MessageActiveMQPropertyConversionExceptionMessage.getByteProperty(SimpleString)public byte[] getBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException
MessagegetBytesProperty in interface MessageActiveMQPropertyConversionException - if the value can not be converted to a byte[]public byte[] getBytesProperty(String key) throws ActiveMQPropertyConversionException
getBytesProperty in interface MessageActiveMQPropertyConversionExceptionMessage.getBytesProperty(SimpleString)public Double getDoubleProperty(SimpleString key) throws ActiveMQPropertyConversionException
MessagegetDoubleProperty in interface MessageActiveMQPropertyConversionException - if the value can not be converted to a Doublepublic Double getDoubleProperty(String key) throws ActiveMQPropertyConversionException
getDoubleProperty in interface MessageActiveMQPropertyConversionExceptionMessage.getDoubleProperty(SimpleString)public Integer getIntProperty(SimpleString key) throws ActiveMQPropertyConversionException
MessagegetIntProperty in interface MessageActiveMQPropertyConversionException - if the value can not be converted to an Integerpublic Integer getIntProperty(String key) throws ActiveMQPropertyConversionException
getIntProperty in interface MessageActiveMQPropertyConversionExceptionMessage.getIntProperty(SimpleString)public Long getLongProperty(SimpleString key) throws ActiveMQPropertyConversionException
MessagegetLongProperty in interface MessageActiveMQPropertyConversionException - if the value can not be converted to a Longpublic Long getLongProperty(String key) throws ActiveMQPropertyConversionException
getLongProperty in interface MessageActiveMQPropertyConversionExceptionMessage.getLongProperty(SimpleString)public Short getShortProperty(SimpleString key) throws ActiveMQPropertyConversionException
MessagegetShortProperty in interface MessageActiveMQPropertyConversionException - if the value can not be converted to a Shortpublic Short getShortProperty(String key) throws ActiveMQPropertyConversionException
getShortProperty in interface MessageActiveMQPropertyConversionExceptionMessage.getShortProperty(SimpleString)public Float getFloatProperty(SimpleString key) throws ActiveMQPropertyConversionException
MessagegetFloatProperty in interface MessageActiveMQPropertyConversionException - if the value can not be converted to a Floatpublic Float getFloatProperty(String key) throws ActiveMQPropertyConversionException
getFloatProperty in interface MessageActiveMQPropertyConversionExceptionMessage.getFloatProperty(SimpleString)public String getStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
MessagegetStringProperty in interface MessageActiveMQPropertyConversionException - if the value can not be converted to a Stringpublic String getStringProperty(String key) throws ActiveMQPropertyConversionException
getStringProperty in interface MessageActiveMQPropertyConversionExceptionMessage.getStringProperty(SimpleString)public SimpleString getSimpleStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
MessagegetSimpleStringProperty in interface MessageActiveMQPropertyConversionException - if the value can not be converted to a SimpleStringpublic SimpleString getSimpleStringProperty(String key) throws ActiveMQPropertyConversionException
getSimpleStringProperty in interface MessageActiveMQPropertyConversionExceptionMessage.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 ActiveMQBuffer getWholeBuffer()
getWholeBuffer in interface MessageInternalpublic BodyEncoder getBodyEncoder() throws ActiveMQException
getBodyEncoder in interface MessageInternalActiveMQExceptionpublic TypedProperties getTypedProperties()
getTypedProperties in interface MessageInternalpublic String bodyToString()
public TypedProperties getProperties()
public void createBody(int initialMessageBufferSize)
Copyright © 2018 JBoss by Red Hat. All rights reserved.