public final class LargeServerMessageImpl extends CoreMessage implements CoreLargeServerMessage
address, BODY_OFFSET, buffer, BUFFER_HEADER_SPACE, durable, endOfBodyPosition, messageID, messageIDPosition, priority, properties, timestamp, type, writableBuffer
BYTES_TYPE, DEFAULT_TYPE, EMBEDDED_TYPE, HDR_ACTUAL_EXPIRY_TIME, HDR_BRIDGE_DUPLICATE_ID, HDR_CONTENT_TYPE, HDR_DUPLICATE_DETECTION_ID, HDR_GROUP_ID, HDR_GROUP_SEQUENCE, HDR_LARGE_BODY_SIZE, HDR_LARGE_COMPRESSED, HDR_LAST_VALUE_NAME, HDR_ORIG_MESSAGE_ID, HDR_ORIGINAL_ADDRESS, HDR_ORIGINAL_QUEUE, HDR_PREFIX, HDR_ROUTE_TO_ACK_IDS, HDR_ROUTE_TO_IDS, HDR_ROUTING_TYPE, HDR_SCALEDOWN_TO_IDS, HDR_SCHEDULED_DELIVERY_TIME, HDR_VALIDATED_USER, INTERNAL_PROPERTY_NAMES_PREDICATE, LARGE_EMBEDDED_TYPE, MAP_TYPE, memoryOffset, OBJECT_TYPE, STREAM_TYPE, TEXT_TYPE
Constructor and Description |
---|
LargeServerMessageImpl(byte type,
long id,
StorageManager storageManager,
SequentialFile fileCopy) |
LargeServerMessageImpl(LargeServerMessageImpl copy,
TypedProperties properties,
SequentialFile fileCopy,
long newID)
Copy constructor
|
LargeServerMessageImpl(StorageManager storageManager) |
Modifier and Type | Method and Description |
---|---|
void |
addBytes(ActiveMQBuffer bytes,
boolean initialHeader) |
void |
addBytes(byte[] bytes) |
static Message |
checkLargeMessage(Message message,
StorageManager storageManager)
This will check if a regular message needs to be converted as large message
|
void |
clearPendingRecordID() |
Message |
copy()
It will generate a new instance of the message encode, being a deep copy, new properties, new everything
|
Message |
copy(long newID)
It will generate a new instance of the message encode, being a deep copy, new properties, new everything
|
void |
decode(ActiveMQBuffer buffer1) |
void |
deleteFile() |
void |
encode(ActiveMQBuffer buffer1) |
void |
ensureFileExists(boolean toOpen) |
SequentialFile |
getAppendFile()
This will return the File suitable for appending the message
|
int |
getBodyBufferSize()
Returns the length in bytes of the body buffer.
|
long |
getBodySize() |
int |
getEncodeSize()
Returns the size of the encoded message.
|
LargeBody |
getLargeBody() |
LargeBodyReader |
getLargeBodyReader() |
int |
getMemoryEstimate() |
long |
getPendingRecordID() |
long |
getPersistentSize()
This is the size of the message when persisted on disk which is used for metrics tracking
Note that even if the message itself is not persisted on disk (ie non-durable) this value is
still used for metrics tracking
If a normal message it will be the encoded message size
If a large message it will be encoded message size + large message body size
|
ActiveMQBuffer |
getReadOnlyBodyBuffer()
Returns a new Buffer slicing the current Body.
|
StorageManager |
getStorageManager() |
long |
getWholeMessageSize()
Return an estimate of the size of the message on the wire.
|
boolean |
hasPendingRecord() |
boolean |
isLargeMessage() |
boolean |
isServerMessage()
We are really interested if this is a LargeServerMessage.
|
void |
referenceOriginalMessage(Message original,
String originalQueue) |
protected void |
releaseComplete() |
void |
releaseResources(boolean sync)
Close the files if opened
|
void |
setPaged()
We have to copy the large message content in case of DLQ and paged messages
For that we need to pre-mark the LargeMessage with a flag when it is paged
|
void |
setPendingRecordID(long pendingRecordID) |
void |
setStorageManager(StorageManager storageManager) |
Message |
toMessage() |
String |
toString() |
void |
validateFile() |
checkEncode, clearInternalProperties, containsProperty, containsProperty, decodeHeadersAndProperties, encode, encodeHeadersAndProperties, getAddress, getAddressSimpleString, getAnnotation, getBodyBuffer, getBodyInputStream, getBooleanProperty, getBooleanProperty, getBuffer, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getCorrelationID, getDataBuffer, getDoubleProperty, getDoubleProperty, getDuplicateProperty, getEndOfBodyPosition, getExpiration, getFloatProperty, getFloatProperty, getGroupID, getGroupSequence, getHeadersAndPropertiesEncodeSize, getIntProperty, getIntProperty, getLastValueProperty, getLongProperty, getLongProperty, getMessageID, getObjectProperty, getObjectProperty, getPersister, getPersistSize, getPriority, getProperties, getPropertyNames, getReplyTo, getRoutingType, getScheduledDeliveryTime, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringProperty, getStringProperty, getTimestamp, getType, getUserID, getValidatedUserID, hasScheduledDeliveryTime, initBuffer, internalSetMessageID, isDurable, messageChanged, moveHeadersAndProperties, persist, putBooleanProperty, putBooleanProperty, putByteProperty, putByteProperty, putBytesProperty, putBytesProperty, putCharProperty, putCharProperty, putDoubleProperty, putDoubleProperty, putFloatProperty, putFloatProperty, putIntProperty, putIntProperty, putLongProperty, putLongProperty, putObjectProperty, putObjectProperty, putShortProperty, putShortProperty, putStringProperty, putStringProperty, putStringProperty, receiveBuffer_1X, receiveBuffer, reloadPersistence, removeAnnotation, removeProperty, removeProperty, searchProperty, sendBuffer_1X, sendBuffer, setAddress, setAddress, setBuffer, setCorrelationID, setDurable, setExpiration, setGroupID, setGroupID, setGroupSequence, setLastValueProperty, setMessageID, setPriority, setReplyTo, setRoutingType, setScheduledDeliveryTime, setTimestamp, setType, setUserID, setUserID, setValidatedUserID, toCore, toCore
debugRefs, debugString, durableDown, durableUp, getDurableCount, getParentRef, getRefCount, getUsage, refDown, refUp, setParentRef, usageDown, usageUp
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addBytes, getMessageID
setDurable, setMessageID
toMap
acceptsConsumer, copy, durableDown, durableUp, getAnnotationString, getBrokerProperty, getConnectionID, getDuplicateIDBytes, getDurableCount, getExtraBytesProperty, getObjectPropertyForFilter, getRefCount, getUsage, isExpired, putExtraBytesProperty, reencode, refDown, refUp, rejectConsumer, releaseBuffer, removeExtraBytesProperty, setAnnotation, setBrokerProperty, setConnectionID, toPropertyMap, usageDown, usageUp
public LargeServerMessageImpl(StorageManager storageManager)
public LargeServerMessageImpl(LargeServerMessageImpl copy, TypedProperties properties, SequentialFile fileCopy, long newID)
properties
- copy
- fileCopy
- public LargeServerMessageImpl(byte type, long id, StorageManager storageManager, SequentialFile fileCopy)
public Message toMessage()
toMessage
in interface LargeServerMessage
public static Message checkLargeMessage(Message message, StorageManager storageManager) throws Exception
Exception
public long getBodySize() throws ActiveMQException
ActiveMQException
public StorageManager getStorageManager()
getStorageManager
in interface LargeServerMessage
public boolean isServerMessage()
ICoreMessage
isServerMessage
in interface ICoreMessage
isServerMessage
in class CoreMessage
public long getPendingRecordID()
getPendingRecordID
in interface ReplicatedLargeMessage
public void clearPendingRecordID()
clearPendingRecordID
in interface ReplicatedLargeMessage
public boolean hasPendingRecord()
hasPendingRecord
in interface ReplicatedLargeMessage
public void setPendingRecordID(long pendingRecordID)
setPendingRecordID
in interface ReplicatedLargeMessage
pendingRecordID
- public void setPaged()
LargeServerMessage
setPaged
in interface LargeServerMessage
public void addBytes(byte[] bytes) throws Exception
addBytes
in interface ReplicatedLargeMessage
addBytes
in interface LargeServerMessage
Exception
LargeServerMessage.addBytes(byte[])
public void addBytes(ActiveMQBuffer bytes, boolean initialHeader) throws Exception
addBytes
in interface LargeServerMessage
Exception
public int getEncodeSize()
Message
getEncodeSize
in interface Message
getEncodeSize
in class CoreMessage
public long getWholeMessageSize()
Message
getWholeMessageSize
in interface Message
public void encode(ActiveMQBuffer buffer1)
public void decode(ActiveMQBuffer buffer1)
public LargeBodyReader getLargeBodyReader()
getLargeBodyReader
in interface ICoreMessage
getLargeBodyReader
in interface LargeServerMessage
getLargeBodyReader
in class CoreMessage
protected void releaseComplete()
releaseComplete
in class RefCountMessage
public ActiveMQBuffer getReadOnlyBodyBuffer()
ICoreMessage
getReadOnlyBodyBuffer
in interface ICoreMessage
getReadOnlyBodyBuffer
in class CoreMessage
public int getBodyBufferSize()
ICoreMessage
getBodyBufferSize
in interface ICoreMessage
getBodyBufferSize
in class CoreMessage
public boolean isLargeMessage()
isLargeMessage
in interface Message
isLargeMessage
in class CoreMessage
public void deleteFile() throws Exception
deleteFile
in interface ReplicatedLargeMessage
deleteFile
in interface LargeServerMessage
Exception
LargeServerMessage.deleteFile()
public int getMemoryEstimate()
getMemoryEstimate
in interface Message
getMemoryEstimate
in class CoreMessage
public void releaseResources(boolean sync)
LargeServerMessage
releaseResources
in interface ReplicatedLargeMessage
releaseResources
in interface LargeServerMessage
LargeServerMessage.releaseResources(boolean)
public void referenceOriginalMessage(Message original, String originalQueue)
referenceOriginalMessage
in interface Message
public void setStorageManager(StorageManager storageManager)
setStorageManager
in interface LargeServerMessage
public Message copy()
Message
copy
in interface Message
copy
in class CoreMessage
public LargeBody getLargeBody()
getLargeBody
in interface LargeServerMessage
public Message copy(long newID)
Message
copy
in interface Message
copy
in class CoreMessage
public SequentialFile getAppendFile() throws ActiveMQException
LargeServerMessage
getAppendFile
in interface LargeServerMessage
ActiveMQException
public long getPersistentSize() throws ActiveMQException
Message
getPersistentSize
in interface Message
getPersistentSize
in class CoreMessage
ActiveMQException
public String toString()
toString
in class CoreMessage
public void validateFile() throws ActiveMQException
validateFile
in interface LargeServerMessage
ActiveMQException
public void ensureFileExists(boolean toOpen) throws ActiveMQException
ActiveMQException
Copyright © 2021 JBoss by Red Hat. All rights reserved.