public final class LargeServerMessageImpl extends CoreMessage implements CoreLargeServerMessage
address, BODY_OFFSET, buffer, BUFFER_HEADER_SPACE, durable, endOfBodyPosition, messageID, messageIDPosition, priority, properties, timestamp, type, writableBufferBYTES_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, toCoredebugRefs, debugString, durableDown, durableUp, getDurableCount, getParentRef, getRefCount, getUsage, refDown, refUp, setParentRef, usageDown, usageUpclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddBytes, getMessageIDsetDurable, setMessageIDtoMapacceptsConsumer, 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, usageUppublic 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 LargeServerMessagepublic static Message checkLargeMessage(Message message, StorageManager storageManager) throws Exception
Exceptionpublic long getBodySize()
throws ActiveMQException
ActiveMQExceptionpublic StorageManager getStorageManager()
getStorageManager in interface LargeServerMessagepublic boolean isServerMessage()
ICoreMessageisServerMessage in interface ICoreMessageisServerMessage in class CoreMessagepublic long getPendingRecordID()
getPendingRecordID in interface ReplicatedLargeMessagepublic void clearPendingRecordID()
clearPendingRecordID in interface ReplicatedLargeMessagepublic boolean hasPendingRecord()
hasPendingRecord in interface ReplicatedLargeMessagepublic void setPendingRecordID(long pendingRecordID)
setPendingRecordID in interface ReplicatedLargeMessagependingRecordID - public void setPaged()
LargeServerMessagesetPaged in interface LargeServerMessagepublic void addBytes(byte[] bytes)
throws Exception
addBytes in interface ReplicatedLargeMessageaddBytes in interface LargeServerMessageExceptionLargeServerMessage.addBytes(byte[])public void addBytes(ActiveMQBuffer bytes, boolean initialHeader) throws Exception
addBytes in interface LargeServerMessageExceptionpublic int getEncodeSize()
MessagegetEncodeSize in interface MessagegetEncodeSize in class CoreMessagepublic long getWholeMessageSize()
MessagegetWholeMessageSize in interface Messagepublic void encode(ActiveMQBuffer buffer1)
public void decode(ActiveMQBuffer buffer1)
public LargeBodyReader getLargeBodyReader()
getLargeBodyReader in interface ICoreMessagegetLargeBodyReader in interface LargeServerMessagegetLargeBodyReader in class CoreMessageprotected void releaseComplete()
releaseComplete in class RefCountMessagepublic ActiveMQBuffer getReadOnlyBodyBuffer()
ICoreMessagegetReadOnlyBodyBuffer in interface ICoreMessagegetReadOnlyBodyBuffer in class CoreMessagepublic int getBodyBufferSize()
ICoreMessagegetBodyBufferSize in interface ICoreMessagegetBodyBufferSize in class CoreMessagepublic boolean isLargeMessage()
isLargeMessage in interface MessageisLargeMessage in class CoreMessagepublic void deleteFile()
throws Exception
deleteFile in interface ReplicatedLargeMessagedeleteFile in interface LargeServerMessageExceptionLargeServerMessage.deleteFile()public int getMemoryEstimate()
getMemoryEstimate in interface MessagegetMemoryEstimate in class CoreMessagepublic void releaseResources(boolean sync)
LargeServerMessagereleaseResources in interface ReplicatedLargeMessagereleaseResources in interface LargeServerMessageLargeServerMessage.releaseResources(boolean)public void referenceOriginalMessage(Message original, String originalQueue)
referenceOriginalMessage in interface Messagepublic void setStorageManager(StorageManager storageManager)
setStorageManager in interface LargeServerMessagepublic Message copy()
Messagecopy in interface Messagecopy in class CoreMessagepublic LargeBody getLargeBody()
getLargeBody in interface LargeServerMessagepublic Message copy(long newID)
Messagecopy in interface Messagecopy in class CoreMessagepublic SequentialFile getAppendFile() throws ActiveMQException
LargeServerMessagegetAppendFile in interface LargeServerMessageActiveMQExceptionpublic long getPersistentSize()
throws ActiveMQException
MessagegetPersistentSize in interface MessagegetPersistentSize in class CoreMessageActiveMQExceptionpublic String toString()
toString in class CoreMessagepublic void validateFile()
throws ActiveMQException
validateFile in interface LargeServerMessageActiveMQExceptionpublic void ensureFileExists(boolean toOpen)
throws ActiveMQException
ActiveMQExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.