public class ClientMessageImpl extends MessageImpl implements ClientMessageInternal
Modifier and Type | Field and Description |
---|---|
static SimpleString |
REPLYTO_HEADER_NAME |
address, BODY_OFFSET, bodyBuffer, buffer, BUFFER_HEADER_SPACE, bufferValid, durable, HDR_BRIDGE_DUPLICATE_ID, HDR_ROUTE_TO_ACK_IDS, HDR_ROUTE_TO_IDS, HDR_SCALEDOWN_TO_IDS, messageID, priority, properties, timestamp, 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_SCHEDULED_DELIVERY_TIME, HDR_VALIDATED_USER, MAP_TYPE, OBJECT_TYPE, STREAM_TYPE, TEXT_TYPE
Constructor and Description |
---|
ClientMessageImpl() |
ClientMessageImpl(byte type,
boolean durable,
long expiration,
long timestamp,
byte priority,
int initialMessageBufferSize) |
Modifier and Type | Method and Description |
---|---|
ClientMessageImpl |
acknowledge()
Acknowledges reception of this message.
|
void |
discardBody()
Discard unused packets (used on large-message)
|
BodyEncoder |
getBodyEncoder() |
InputStream |
getBodyInputStream() |
int |
getBodySize()
Returns the size (in bytes) of this message's body
|
int |
getDeliveryCount()
Returns the number of times this message was delivered.
|
int |
getFlowControlSize()
Size used for FlowControl
|
ClientMessageImpl |
individualAcknowledge()
Acknowledges reception of a single message.
|
boolean |
isCompressed() |
boolean |
isLargeMessage()
Returns whether this message is a large message or a regular message.
|
boolean |
isServerMessage() |
void |
onReceipt(ClientConsumerInternal consumer) |
ClientMessageImpl |
putBooleanProperty(SimpleString key,
boolean value)
Puts a boolean property in this message.
|
ClientMessageImpl |
putBooleanProperty(String key,
boolean value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putByteProperty(SimpleString key,
byte value)
Puts a byte property in this message.
|
ClientMessageImpl |
putByteProperty(String key,
byte value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putBytesProperty(SimpleString key,
byte[] value)
Puts a byte[] property in this message.
|
ClientMessageImpl |
putBytesProperty(String key,
byte[] value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putCharProperty(SimpleString key,
char value)
Puts a char property in this message.
|
ClientMessageImpl |
putCharProperty(String key,
char value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putDoubleProperty(SimpleString key,
double value)
Puts a double property in this message.
|
ClientMessageImpl |
putDoubleProperty(String key,
double value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putFloatProperty(SimpleString key,
float value)
Puts a float property in this message.
|
ClientMessageImpl |
putFloatProperty(String key,
float value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putIntProperty(SimpleString key,
int value)
Puts an int property in this message.
|
ClientMessageImpl |
putIntProperty(String key,
int value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putLongProperty(SimpleString key,
long value)
Puts a long property in this message.
|
ClientMessageImpl |
putLongProperty(String key,
long value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putObjectProperty(SimpleString key,
Object value)
Puts an Object property in this message.
|
ClientMessageImpl |
putObjectProperty(String key,
Object value) |
ClientMessageImpl |
putShortProperty(SimpleString key,
short value)
Puts a short property in this message.
|
ClientMessageImpl |
putShortProperty(String key,
short value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putStringProperty(SimpleString key,
SimpleString value)
Puts a SimpleString property in this message.
|
ClientMessageImpl |
putStringProperty(String key,
String value)
Puts a String property in this message.
|
void |
saveToOutputStream(OutputStream out)
Saves the content of the message to the OutputStream.
|
ClientMessageImpl |
setBodyInputStream(InputStream bodyInputStream)
Sets the body's IntputStream.
|
ClientMessageImpl |
setDeliveryCount(int deliveryCount)
Sets the delivery count for this message.
|
void |
setFlowControlSize(int flowControlSize)
Size used for FlowControl
|
ClientMessageImpl |
setOutputStream(OutputStream out)
Sets the OutputStream that will receive the content of a message received in a non blocking way.
|
String |
toString() |
boolean |
waitOutputStreamCompletion(long timeMilliseconds)
Wait the outputStream completion of the message.
|
ClientMessageImpl |
writeBodyBufferBytes(byte[] bytes)
Writes the input byte array to the message body ActiveMQBuffer
|
ClientMessageImpl |
writeBodyBufferString(String string)
Writes the input String to the message body ActiveMQBuffer
|
bodyChanged, bodyToString, checkCompletion, containsProperty, containsProperty, copyHeadersAndProperties, createBody, decode, decodeFromBuffer, decodeHeadersAndProperties, encode, encodeHeadersAndProperties, equals, getAddress, getBodyBuffer, getBodyBufferDuplicate, getBooleanProperty, getBooleanProperty, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getDoubleProperty, getDoubleProperty, getEncodedBuffer, getEncodeSize, getEndOfBodyPosition, getEndOfMessagePosition, getExpiration, getFloatProperty, getFloatProperty, getHeadersAndPropertiesEncodeSize, getIntProperty, getIntProperty, getLongProperty, getLongProperty, getMessageID, getObjectProperty, getObjectProperty, getPriority, getProperties, getPropertyNames, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringProperty, getStringProperty, getTimestamp, getType, getTypedProperties, getUserID, getWholeBuffer, hashCode, isDurable, isExpired, putTypedProperties, removeProperty, removeProperty, setAddress, setAddressTransient, setDurable, setExpiration, setPriority, setTimestamp, setType, setUserID, toMap, toPropertyMap
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getProperties, setAddressTransient
checkCompletion
containsProperty, containsProperty, getAddress, getBodyBuffer, getBodyBufferDuplicate, getBooleanProperty, getBooleanProperty, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getDoubleProperty, getDoubleProperty, getEncodeSize, getExpiration, getFloatProperty, getFloatProperty, getIntProperty, getIntProperty, getLongProperty, getLongProperty, getMessageID, getObjectProperty, getObjectProperty, getPriority, getPropertyNames, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringProperty, getStringProperty, getTimestamp, getType, getUserID, isDurable, isExpired, removeProperty, removeProperty, setAddress, setDurable, setExpiration, setPriority, setTimestamp, setUserID, toMap, toPropertyMap
public static final SimpleString REPLYTO_HEADER_NAME
public ClientMessageImpl()
public ClientMessageImpl(byte type, boolean durable, long expiration, long timestamp, byte priority, int initialMessageBufferSize)
public boolean isServerMessage()
isServerMessage
in interface MessageInternal
public void onReceipt(ClientConsumerInternal consumer)
onReceipt
in interface ClientMessageInternal
public ClientMessageImpl setDeliveryCount(int deliveryCount)
ClientMessage
This method is not meant to be called by ActiveMQ Artemis clients.
setDeliveryCount
in interface ClientMessage
deliveryCount
- message delivery countpublic int getDeliveryCount()
ClientMessage
getDeliveryCount
in interface ClientMessage
public ClientMessageImpl acknowledge() throws ActiveMQException
ClientMessage
If the session responsible to acknowledge this message has autoCommitAcks
set to
true
, the transaction will automatically commit the current transaction. Otherwise,
this acknowledgement will not be committed until the client commits the session transaction.
acknowledge
in interface ClientMessage
ActiveMQException
- if an error occurred while acknowledging the message.ClientSession.isAutoCommitAcks()
public ClientMessageImpl individualAcknowledge() throws ActiveMQException
ClientMessage
If the session responsible to acknowledge this message has autoCommitAcks
set to
true
, the transaction will automatically commit the current transaction. Otherwise,
this acknowledgement will not be committed until the client commits the session transaction.
individualAcknowledge
in interface ClientMessage
ActiveMQException
- if an error occurred while acknowledging the message.ClientSession.isAutoCommitAcks()
public int getFlowControlSize()
ClientMessageInternal
getFlowControlSize
in interface ClientMessageInternal
public void setFlowControlSize(int flowControlSize)
ClientMessageInternal
setFlowControlSize
in interface ClientMessageInternal
public boolean isLargeMessage()
Message
isLargeMessage
in interface Message
public boolean isCompressed()
isCompressed
in interface ClientMessageInternal
public int getBodySize()
ClientMessage
getBodySize
in interface ClientMessage
public void saveToOutputStream(OutputStream out) throws ActiveMQException
ClientMessage
saveToOutputStream
in interface ClientMessage
ActiveMQException
public ClientMessageImpl setOutputStream(OutputStream out) throws ActiveMQException
ClientMessage
setOutputStream
in interface ClientMessage
ActiveMQException
public boolean waitOutputStreamCompletion(long timeMilliseconds) throws ActiveMQException
ClientMessage
waitOutputStreamCompletion
in interface ClientMessage
timeMilliseconds
- - 0 means wait foreverActiveMQException
public void discardBody()
ClientMessageInternal
discardBody
in interface ClientMessageInternal
public InputStream getBodyInputStream()
getBodyInputStream
in interface MessageInternal
public ClientMessageImpl setBodyInputStream(InputStream bodyInputStream)
ClientMessage
setBodyInputStream
in interface ClientMessage
bodyInputStream
- the bodyInputStream to setpublic BodyEncoder getBodyEncoder() throws ActiveMQException
getBodyEncoder
in interface MessageInternal
getBodyEncoder
in class MessageImpl
ActiveMQException
public ClientMessageImpl putBooleanProperty(SimpleString key, boolean value)
Message
putBooleanProperty
in interface ClientMessage
putBooleanProperty
in interface Message
putBooleanProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl putByteProperty(SimpleString key, byte value)
Message
putByteProperty
in interface ClientMessage
putByteProperty
in interface Message
putByteProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl putBytesProperty(SimpleString key, byte[] value)
Message
putBytesProperty
in interface ClientMessage
putBytesProperty
in interface Message
putBytesProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl putCharProperty(SimpleString key, char value)
Message
putCharProperty
in interface ClientMessage
putCharProperty
in interface Message
putCharProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl putCharProperty(String key, char value)
ClientMessage
Message
to enable fluent APIputCharProperty
in interface ClientMessage
putCharProperty
in interface Message
putCharProperty
in class MessageImpl
Message.putCharProperty(SimpleString, char)
public ClientMessageImpl putShortProperty(SimpleString key, short value)
Message
putShortProperty
in interface ClientMessage
putShortProperty
in interface Message
putShortProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl putIntProperty(SimpleString key, int value)
Message
putIntProperty
in interface ClientMessage
putIntProperty
in interface Message
putIntProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl putLongProperty(SimpleString key, long value)
Message
putLongProperty
in interface ClientMessage
putLongProperty
in interface Message
putLongProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl putFloatProperty(SimpleString key, float value)
Message
putFloatProperty
in interface ClientMessage
putFloatProperty
in interface Message
putFloatProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl putDoubleProperty(SimpleString key, double value)
Message
putDoubleProperty
in interface ClientMessage
putDoubleProperty
in interface Message
putDoubleProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl putStringProperty(SimpleString key, SimpleString value)
Message
putStringProperty
in interface ClientMessage
putStringProperty
in interface Message
putStringProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException
Message
putObjectProperty
in interface Message
putObjectProperty
in class MessageImpl
key
- property namevalue
- property valueActiveMQPropertyConversionException
- if the value is not one of the accepted property
types.public ClientMessageImpl putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException
putObjectProperty
in interface Message
putObjectProperty
in class MessageImpl
ActiveMQPropertyConversionException
Message.putObjectProperty(SimpleString, Object)
public ClientMessageImpl putBooleanProperty(String key, boolean value)
ClientMessage
Message
to enable fluent APIputBooleanProperty
in interface ClientMessage
putBooleanProperty
in interface Message
putBooleanProperty
in class MessageImpl
Message.putBooleanProperty(SimpleString, boolean)
public ClientMessageImpl putByteProperty(String key, byte value)
ClientMessage
Message
to enable fluent APIputByteProperty
in interface ClientMessage
putByteProperty
in interface Message
putByteProperty
in class MessageImpl
Message.putByteProperty(SimpleString, byte)
public ClientMessageImpl putBytesProperty(String key, byte[] value)
ClientMessage
Message
to enable fluent APIputBytesProperty
in interface ClientMessage
putBytesProperty
in interface Message
putBytesProperty
in class MessageImpl
Message.putBytesProperty(SimpleString, byte[])
public ClientMessageImpl putShortProperty(String key, short value)
ClientMessage
Message
to enable fluent APIputShortProperty
in interface ClientMessage
putShortProperty
in interface Message
putShortProperty
in class MessageImpl
Message.putShortProperty(SimpleString, short)
public ClientMessageImpl putIntProperty(String key, int value)
ClientMessage
Message
to enable fluent APIputIntProperty
in interface ClientMessage
putIntProperty
in interface Message
putIntProperty
in class MessageImpl
Message.putIntProperty(SimpleString, int)
public ClientMessageImpl putLongProperty(String key, long value)
ClientMessage
Message
to enable fluent APIputLongProperty
in interface ClientMessage
putLongProperty
in interface Message
putLongProperty
in class MessageImpl
Message.putLongProperty(SimpleString, long)
public ClientMessageImpl putFloatProperty(String key, float value)
ClientMessage
Message
to enable fluent APIputFloatProperty
in interface ClientMessage
putFloatProperty
in interface Message
putFloatProperty
in class MessageImpl
Message.putFloatProperty(SimpleString, float)
public ClientMessageImpl putDoubleProperty(String key, double value)
ClientMessage
Message
to enable fluent APIputDoubleProperty
in interface ClientMessage
putDoubleProperty
in interface Message
putDoubleProperty
in class MessageImpl
Message.putDoubleProperty(SimpleString, double)
public ClientMessageImpl putStringProperty(String key, String value)
Message
putStringProperty
in interface ClientMessage
putStringProperty
in interface Message
putStringProperty
in class MessageImpl
key
- property namevalue
- property valuepublic ClientMessageImpl writeBodyBufferBytes(byte[] bytes)
Message
writeBodyBufferBytes
in interface ClientMessage
writeBodyBufferBytes
in interface Message
writeBodyBufferBytes
in class MessageImpl
public ClientMessageImpl writeBodyBufferString(String string)
Message
writeBodyBufferString
in interface ClientMessage
writeBodyBufferString
in interface Message
writeBodyBufferString
in class MessageImpl
Copyright © 2017 JBoss by Red Hat. All rights reserved.