Class LargeBody
- java.lang.Object
-
- org.apache.activemq.artemis.core.persistence.impl.journal.LargeBody
-
public class LargeBody extends Object
-
-
Constructor Summary
Constructors Constructor Description LargeBody(LargeServerMessage message, StorageManager storageManager)LargeBody(LargeServerMessage message, StorageManager storageManager, SequentialFile file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBytes(byte[] bytes)voidaddBytes(ActiveMQBuffer bytes)voidcheckDelete()voidclearFile()voidcopyInto(LargeServerMessage newMessage)voidcopyInto(LargeServerMessage newMessage, io.netty.buffer.ByteBuf newHeader, int skipBytes)SequentialFilecreateFile()voiddeleteFile()voidensureFileExists(boolean toOpen)SequentialFilegetAppendFile()intgetBodyBufferSize()longgetBodySize()LargeBodyReadergetLargeBodyReader()longgetMessageID()SequentialFilegetReadingFile()This will return its own File useful for reading the file on the large message while delivering, browsing..ActiveMQBuffergetReadOnlyBodyBuffer()StorageManagergetStorageManager()longgetStoredBodySize()This will return the bodySize without trying to open the file, just returning what's currently storedbooleanisPaged()protected voidopenFile()voidreferenceOriginalMessage(LargeBody original)voidreleaseComplete()voidreleaseResources(boolean sync, boolean sendEvent)sendEvent means it's a close happening from end of write largemessage.voidreplaceFile(SequentialFile file)Meant for test-ability, be careful if you decide to use it.voidsetBodySize(long size)voidsetMessage(LargeServerMessage message)voidsetPaged()voidsetStorageManager(StorageManager storageManager)voidvalidateFile()
-
-
-
Constructor Detail
-
LargeBody
public LargeBody(LargeServerMessage message, StorageManager storageManager)
-
LargeBody
public LargeBody(LargeServerMessage message, StorageManager storageManager, SequentialFile file)
-
-
Method Detail
-
getStorageManager
public StorageManager getStorageManager()
-
setStorageManager
public void setStorageManager(StorageManager storageManager)
-
setMessage
public void setMessage(LargeServerMessage message)
-
setPaged
public void setPaged()
-
isPaged
public boolean isPaged()
-
clearFile
public void clearFile()
-
releaseComplete
public void releaseComplete()
-
deleteFile
public void deleteFile()
-
getMessageID
public long getMessageID()
-
addBytes
public void addBytes(ActiveMQBuffer bytes) throws Exception
- Throws:
Exception
-
validateFile
public void validateFile() throws ActiveMQException- Throws:
ActiveMQException
-
ensureFileExists
public void ensureFileExists(boolean toOpen) throws ActiveMQException- Throws:
ActiveMQException
-
getStoredBodySize
public long getStoredBodySize()
This will return the bodySize without trying to open the file, just returning what's currently stored
-
setBodySize
public void setBodySize(long size)
-
getBodySize
public long getBodySize() throws ActiveMQException- Throws:
ActiveMQException
-
getLargeBodyReader
public LargeBodyReader getLargeBodyReader()
-
getReadingFile
public SequentialFile getReadingFile() throws ActiveMQException
This will return its own File useful for reading the file on the large message while delivering, browsing.. etc- Throws:
ActiveMQException
-
replaceFile
public void replaceFile(SequentialFile file)
Meant for test-ability, be careful if you decide to use it. and in case you use it for a real reason, please change the documentation here.- Parameters:
file-
-
getAppendFile
public SequentialFile getAppendFile() throws ActiveMQException
- Throws:
ActiveMQException
-
checkDelete
public void checkDelete()
-
referenceOriginalMessage
public void referenceOriginalMessage(LargeBody original)
-
getReadOnlyBodyBuffer
public ActiveMQBuffer getReadOnlyBodyBuffer()
-
getBodyBufferSize
public int getBodyBufferSize()
-
releaseResources
public void releaseResources(boolean sync, boolean sendEvent)sendEvent means it's a close happening from end of write largemessage. While reading the largemessage we don't need (and shouldn't inform the backup
-
copyInto
public void copyInto(LargeServerMessage newMessage) throws Exception
- Throws:
Exception
-
copyInto
public void copyInto(LargeServerMessage newMessage, io.netty.buffer.ByteBuf newHeader, int skipBytes) throws Exception
- Throws:
Exception
-
createFile
public SequentialFile createFile()
-
-