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_IDS, messageID, priority, properties, timestamp, 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_ORIGINAL_QUEUE, HDR_SCHEDULED_DELIVERY_TIME, 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 |
---|---|
void |
acknowledge()
Acknowledge reception of this message.
|
void |
discardBody()
Discard unused packets (used on large-message)
|
BodyEncoder |
getBodyEncoder() |
InputStream |
getBodyInputStream() |
int |
getBodySize()
Return 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
|
void |
individualAcknowledge()
Acknowledge 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) |
void |
saveToOutputStream(OutputStream out)
Saves the content of the message to the OutputStream.
|
void |
setBodyInputStream(InputStream bodyInputStream)
Sets the body's IntputStream.
|
void |
setDeliveryCount(int deliveryCount)
Set the delivery count for this message.
|
void |
setFlowControlSize(int flowControlSize)
Size used for FlowControl
|
void |
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.
|
bodyChanged, checkCompletion, checkCopy, containsProperty, containsProperty, copyHeadersAndProperties, createBody, decode, decodeFromBuffer, decodeHeadersAndProperties, encode, encodeHeadersAndProperties, getAddress, getBodyBuffer, getBodyBufferCopy, 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, isDurable, isExpired, putBooleanProperty, putBooleanProperty, putByteProperty, putByteProperty, putBytesProperty, putBytesProperty, putDoubleProperty, putDoubleProperty, putFloatProperty, putFloatProperty, putIntProperty, putIntProperty, putLongProperty, putLongProperty, putObjectProperty, putObjectProperty, putShortProperty, putShortProperty, putStringProperty, putStringProperty, putTypedProperties, removeProperty, removeProperty, resetCopied, setAddress, setAddressTransient, setDurable, setExpiration, setPriority, setTimestamp, setType, setUserID, toMap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
checkCompletion
bodyChanged, checkCopy, decodeFromBuffer, decodeHeadersAndProperties, encodeHeadersAndProperties, getEncodedBuffer, getEndOfBodyPosition, getEndOfMessagePosition, getHeadersAndPropertiesEncodeSize, getTypedProperties, getWholeBuffer, resetCopied, setAddressTransient
containsProperty, containsProperty, getAddress, getBodyBuffer, getBodyBufferCopy, 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, putBooleanProperty, putBooleanProperty, putByteProperty, putByteProperty, putBytesProperty, putBytesProperty, putDoubleProperty, putDoubleProperty, putFloatProperty, putFloatProperty, putIntProperty, putIntProperty, putLongProperty, putLongProperty, putObjectProperty, putObjectProperty, putShortProperty, putShortProperty, putStringProperty, putStringProperty, removeProperty, removeProperty, setAddress, setDurable, setExpiration, setPriority, setTimestamp, setUserID, toMap
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 void setDeliveryCount(int deliveryCount)
ClientMessage
setDeliveryCount
in interface ClientMessage
deliveryCount
- message delivery countpublic int getDeliveryCount()
ClientMessage
getDeliveryCount
in interface ClientMessage
public void acknowledge() throws HornetQException
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
HornetQException
- if an error occurred while acknowledging the message.ClientSession.isAutoCommitAcks()
public void individualAcknowledge() throws HornetQException
ClientMessage
autoCommitAcks
set to true
, the transaction will automatically commit the current transaction.
Otherwise, this acknwoledgement will not be committed until the client commits the session transaction.individualAcknowledge
in interface ClientMessage
HornetQException
- if an error occured 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 HornetQException
ClientMessage
saveToOutputStream
in interface ClientMessage
HornetQException
public void setOutputStream(OutputStream out) throws HornetQException
ClientMessage
setOutputStream
in interface ClientMessage
HornetQException
public boolean waitOutputStreamCompletion(long timeMilliseconds) throws HornetQException
ClientMessage
waitOutputStreamCompletion
in interface ClientMessage
timeMilliseconds
- - 0 means wait foreverHornetQException
public void discardBody()
ClientMessageInternal
discardBody
in interface ClientMessageInternal
public InputStream getBodyInputStream()
getBodyInputStream
in interface MessageInternal
public void setBodyInputStream(InputStream bodyInputStream)
ClientMessage
setBodyInputStream
in interface ClientMessage
bodyInputStream
- the bodyInputStream to setpublic BodyEncoder getBodyEncoder() throws HornetQException
getBodyEncoder
in interface MessageInternal
getBodyEncoder
in class MessageImpl
HornetQException
Copyright © 2018 JBoss by Red Hat. All rights reserved.