Class LargeServerMessageImpl
- java.lang.Object
-
- org.apache.activemq.artemis.api.core.RefCountMessage
-
- org.apache.activemq.artemis.core.message.impl.CoreMessage
-
- org.apache.activemq.artemis.core.persistence.impl.journal.LargeServerMessageImpl
-
- All Implemented Interfaces:
ICoreMessage,Message,ReplicatedLargeMessage,CoreLargeServerMessage,LargeServerMessage
public final class LargeServerMessageImpl extends CoreMessage implements CoreLargeServerMessage
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.core.message.impl.CoreMessage
address, BODY_OFFSET, buffer, BUFFER_HEADER_SPACE, durable, endOfBodyPosition, memoryEstimate, messageID, messageIDPosition, priority, properties, timestamp, type, writableBuffer
-
Fields inherited from interface org.apache.activemq.artemis.api.core.Message
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_INGRESS_TIMESTAMP, HDR_LARGE_BODY_SIZE, HDR_LARGE_COMPRESSED, HDR_LAST_VALUE_NAME, HDR_ORIG_MESSAGE_ID, HDR_ORIG_ROUTING_TYPE, 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 Summary
Constructors Constructor Description LargeServerMessageImpl(byte type, long id, StorageManager storageManager, SequentialFile fileCopy)LargeServerMessageImpl(LargeServerMessageImpl copy, TypedProperties properties, SequentialFile fileCopy, long newID)Copy constructorLargeServerMessageImpl(StorageManager storageManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBytes(byte[] bytes)voidaddBytes(ActiveMQBuffer bytes, boolean initialHeader)static MessagecheckLargeMessage(Message message, StorageManager storageManager)This will check if a regular message needs to be converted as large messageMessagecopy()Messagecopy(long newID)voiddecode(ActiveMQBuffer buffer1)voiddeleteFile()voidencode(ActiveMQBuffer buffer1)voidensureFileExists(boolean toOpen)SequentialFilegetAppendFile()This will return the File suitable for appending the messageintgetBodyBufferSize()longgetBodySize()intgetEncodeSize()LargeBodygetLargeBody()LargeBodyReadergetLargeBodyReader()intgetMemoryEstimate()longgetPersistentSize()ActiveMQBuffergetReadOnlyBodyBuffer()StorageManagergetStorageManager()longgetWholeMessageSize()booleanisLargeMessage()booleanisServerMessage()voidreferenceOriginalMessage(Message original, SimpleString originalQueue)protected voidreleaseComplete()voidreleaseResources(boolean sync, boolean sendEvent)Close the files if openedLargeServerMessageImplsetMessageID(long messageID)voidsetPaged()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 pagedvoidsetStorageManager(StorageManager storageManager)MessagetoMessage()StringtoString()voidvalidateFile()-
Methods inherited from class org.apache.activemq.artemis.core.message.impl.CoreMessage
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, getOwner, getPersister, getPersistSize, getPriority, getProperties, getPropertyNames, getProtocolName, getReplyTo, getRoutingType, getScheduledDeliveryTime, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringBody, 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, receiveBuffer_1X, reloadPersistence, removeAnnotation, removeProperty, removeProperty, searchProperty, sendBuffer, sendBuffer_1X, setAddress, setAddress, setBuffer, setCorrelationID, setDurable, setExpiration, setGroupID, setGroupID, setGroupSequence, setLastValueProperty, setOwner, setPriority, setReplyTo, setRoutingType, setScheduledDeliveryTime, setTimestamp, setType, setUserID, setUserID, setValidatedUserID, toCompositeData, toCore, toCore
-
Methods inherited from class org.apache.activemq.artemis.api.core.RefCountMessage
counterString, debugLocations, deferredDebug, deferredDebug, deferredDebug, disableErrorCheck, durableDown, durableUp, getDurableCount, getParentRef, getRefCount, getUsage, getUserContext, isRefDebugEnabled, isRefTraceEnabled, isReleased, onDown, onUp, refDown, refUp, registerDebug, released, setParentRef, setUserContext, usageDown, usageUp
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.api.core.ICoreMessage
isConfirmed, setConfirmed, toMap
-
Methods inherited from interface org.apache.activemq.artemis.core.server.LargeServerMessage
addBytes, getMessageID
-
Methods inherited from interface org.apache.activemq.artemis.api.core.Message
acceptsConsumer, copy, durableDown, durableUp, getAnnotationString, getBrokerProperty, getConnectionID, getDuplicateIDBytes, getDurableCount, getExtraBytesProperty, getIngressTimestamp, getObjectPropertyForFilter, getRefCount, getUsage, getUserContext, isExpired, putExtraBytesProperty, reencode, refDown, refUp, rejectConsumer, removeExtraBytesProperty, setAnnotation, setBrokerProperty, setConnectionID, setIngressTimestamp, setUserContext, toMap, toPropertyMap, toPropertyMap, usageDown, usageUp
-
Methods inherited from interface org.apache.activemq.artemis.core.replication.ReplicatedLargeMessage
setDurable
-
-
-
-
Constructor Detail
-
LargeServerMessageImpl
public LargeServerMessageImpl(StorageManager storageManager)
-
LargeServerMessageImpl
public LargeServerMessageImpl(LargeServerMessageImpl copy, TypedProperties properties, SequentialFile fileCopy, long newID)
Copy constructor- Parameters:
properties-copy-fileCopy-
-
LargeServerMessageImpl
public LargeServerMessageImpl(byte type, long id, StorageManager storageManager, SequentialFile fileCopy)
-
-
Method Detail
-
toMessage
public Message toMessage()
- Specified by:
toMessagein interfaceLargeServerMessage
-
checkLargeMessage
public static Message checkLargeMessage(Message message, StorageManager storageManager) throws Exception
This will check if a regular message needs to be converted as large message- Throws:
Exception
-
getBodySize
public long getBodySize() throws ActiveMQException- Throws:
ActiveMQException
-
setMessageID
public LargeServerMessageImpl setMessageID(long messageID)
- Specified by:
setMessageIDin interfaceMessage- Specified by:
setMessageIDin interfaceReplicatedLargeMessage- Overrides:
setMessageIDin classCoreMessage- See Also:
ReplicatedLargeMessage.setMessageID(long)
-
getStorageManager
public StorageManager getStorageManager()
- Specified by:
getStorageManagerin interfaceLargeServerMessage
-
isServerMessage
public boolean isServerMessage()
- Specified by:
isServerMessagein interfaceICoreMessage- Overrides:
isServerMessagein classCoreMessage
-
setPaged
public void setPaged()
Description copied from interface:LargeServerMessageWe 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- Specified by:
setPagedin interfaceLargeServerMessage
-
addBytes
public void addBytes(byte[] bytes) throws Exception- Specified by:
addBytesin interfaceLargeServerMessage- Specified by:
addBytesin interfaceReplicatedLargeMessage- Throws:
Exception- See Also:
LargeServerMessage.addBytes(byte[])
-
addBytes
public void addBytes(ActiveMQBuffer bytes, boolean initialHeader) throws Exception
- Specified by:
addBytesin interfaceLargeServerMessage- Throws:
Exception
-
getEncodeSize
public int getEncodeSize()
- Specified by:
getEncodeSizein interfaceMessage- Overrides:
getEncodeSizein classCoreMessage
-
getWholeMessageSize
public long getWholeMessageSize()
- Specified by:
getWholeMessageSizein interfaceMessage
-
encode
public void encode(ActiveMQBuffer buffer1)
-
decode
public void decode(ActiveMQBuffer buffer1)
-
getLargeBodyReader
public LargeBodyReader getLargeBodyReader()
- Specified by:
getLargeBodyReaderin interfaceICoreMessage- Specified by:
getLargeBodyReaderin interfaceLargeServerMessage- Overrides:
getLargeBodyReaderin classCoreMessage
-
releaseComplete
protected void releaseComplete()
- Overrides:
releaseCompletein classRefCountMessage
-
getReadOnlyBodyBuffer
public ActiveMQBuffer getReadOnlyBodyBuffer()
- Specified by:
getReadOnlyBodyBufferin interfaceICoreMessage- Overrides:
getReadOnlyBodyBufferin classCoreMessage
-
getBodyBufferSize
public int getBodyBufferSize()
- Specified by:
getBodyBufferSizein interfaceICoreMessage- Overrides:
getBodyBufferSizein classCoreMessage
-
isLargeMessage
public boolean isLargeMessage()
- Specified by:
isLargeMessagein interfaceMessage- Overrides:
isLargeMessagein classCoreMessage
-
deleteFile
public void deleteFile() throws Exception- Specified by:
deleteFilein interfaceLargeServerMessage- Specified by:
deleteFilein interfaceReplicatedLargeMessage- Throws:
Exception- See Also:
LargeServerMessage.deleteFile()
-
getMemoryEstimate
public int getMemoryEstimate()
- Specified by:
getMemoryEstimatein interfaceMessage- Overrides:
getMemoryEstimatein classCoreMessage
-
releaseResources
public void releaseResources(boolean sync, boolean sendEvent)Description copied from interface:LargeServerMessageClose the files if opened- Specified by:
releaseResourcesin interfaceLargeServerMessage- Specified by:
releaseResourcesin interfaceReplicatedLargeMessage- See Also:
LargeServerMessage.releaseResources(boolean,boolean)
-
referenceOriginalMessage
public void referenceOriginalMessage(Message original, SimpleString originalQueue)
- Specified by:
referenceOriginalMessagein interfaceMessage
-
setStorageManager
public void setStorageManager(StorageManager storageManager)
- Specified by:
setStorageManagerin interfaceLargeServerMessage
-
copy
public Message copy()
- Specified by:
copyin interfaceMessage- Overrides:
copyin classCoreMessage
-
getLargeBody
public LargeBody getLargeBody()
- Specified by:
getLargeBodyin interfaceLargeServerMessage
-
copy
public Message copy(long newID)
- Specified by:
copyin interfaceMessage- Overrides:
copyin classCoreMessage
-
getAppendFile
public SequentialFile getAppendFile() throws ActiveMQException
Description copied from interface:LargeServerMessageThis will return the File suitable for appending the message- Specified by:
getAppendFilein interfaceLargeServerMessage- Returns:
- Throws:
ActiveMQException
-
getPersistentSize
public long getPersistentSize() throws ActiveMQException- Specified by:
getPersistentSizein interfaceMessage- Overrides:
getPersistentSizein classCoreMessage- Throws:
ActiveMQException
-
toString
public String toString()
- Overrides:
toStringin classCoreMessage
-
validateFile
public void validateFile() throws ActiveMQException- Specified by:
validateFilein interfaceLargeServerMessage- Throws:
ActiveMQException
-
ensureFileExists
public void ensureFileExists(boolean toOpen) throws ActiveMQException- Throws:
ActiveMQException
-
-