Class AbstractStoreCursor
java.lang.Object
org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
org.apache.activemq.broker.region.cursors.AbstractStoreCursor
- All Implemented Interfaces:
PendingMessageCursor,org.apache.activemq.Service,MessageRecoveryListener
public abstract class AbstractStoreCursor
extends AbstractPendingMessageCursor
implements MessageRecoveryListener
Store based cursor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PendingListprotected booleanprotected booleanprotected final Destinationprotected intFields inherited from class org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
audit, cacheEnabled, enableAudit, last, maxAuditDepth, maxBatchSize, maxProducersToAudit, memoryUsageHighWaterMark, prioritizedMessages, started, systemUsage, useCacheFields inherited from interface org.apache.activemq.broker.region.cursors.PendingMessageCursor
INFINITE_WAIT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessageFirst(org.apache.activemq.broker.region.MessageReference node) add message to await dispatchprotected booleanbooleanfinal voidclear()clear all pending messagesprotected org.apache.activemq.broker.region.MessageReferencecreateBatchListRef(org.apache.activemq.command.Message message) protected abstract voidprotected booleanduplicateFromStoreExcepted(org.apache.activemq.command.Message message) protected booleanprotected final voidfinal voidfinished()voidgc()free up any internal buffersprotected abstract longprotected abstract intstatic booleangotToTheStore(org.apache.activemq.command.Message message) final booleanfinal booleanhasNext()booleanfinal booleanisEmpty()protected abstract booleanfinal longfinal org.apache.activemq.broker.region.MessageReferencenext()voidrebase()final booleanrecoverMessage(org.apache.activemq.command.Message message) booleanrecoverMessage(org.apache.activemq.command.Message message, boolean cached) voidrelease()hint to the cursor to release any locks it might have grabbed after a resetfinal voidremove()remove the message at the cursor positionfinal voidremove(org.apache.activemq.broker.region.MessageReference node) remove a nodefinal voidreset()reset the cursorprotected abstract voidprotected voidprotected voidsetBatch(org.apache.activemq.command.MessageId messageId) final intsize()final voidstart()final voidstop()toString()booleantryAddMessageLast(org.apache.activemq.broker.region.MessageReference node, long wait) add message to await dispatch - if it canMethods inherited from class org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
add, addMessageLast, addRecoveredMessage, destroy, getMaxAuditDepth, getMaxBatchSize, getMaxProducersToAudit, getMemoryUsageHighWaterMark, getMessageAudit, getSystemUsage, hasSpace, isDuplicate, isEmpty, isEnableAudit, isFull, isPrioritizedMessageSubscriber, isRecoveryRequired, isStarted, isTransient, isUseCache, pageInList, recordUniqueId, remove, resetForGC, rollback, setCacheEnabled, setEnableAudit, setMaxAuditDepth, setMaxBatchSize, setMaxProducersToAudit, setMemoryUsageHighWaterMark, setMessageAudit, setSystemUsage, setUseCacheMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.activemq.store.MessageRecoveryListener
hasSpace, isDuplicate, recoverMessageReference
-
Field Details
-
regionDestination
-
batchList
-
batchResetNeeded
protected boolean batchResetNeeded -
size
protected int size -
hadSpace
protected boolean hadSpace
-
-
Constructor Details
-
AbstractStoreCursor
-
-
Method Details
-
start
- Specified by:
startin interfaceorg.apache.activemq.Service- Overrides:
startin classAbstractPendingMessageCursor- Throws:
Exception
-
resetSize
protected void resetSize() -
rebase
public void rebase()- Specified by:
rebasein interfacePendingMessageCursor- Overrides:
rebasein classAbstractPendingMessageCursor
-
stop
- Specified by:
stopin interfaceorg.apache.activemq.Service- Overrides:
stopin classAbstractPendingMessageCursor- Throws:
Exception
-
recoverMessage
- Specified by:
recoverMessagein interfaceMessageRecoveryListener- Throws:
Exception
-
recoverMessage
public boolean recoverMessage(org.apache.activemq.command.Message message, boolean cached) throws Exception - Throws:
Exception
-
createBatchListRef
protected org.apache.activemq.broker.region.MessageReference createBatchListRef(org.apache.activemq.command.Message message) -
duplicateFromStoreExcepted
protected boolean duplicateFromStoreExcepted(org.apache.activemq.command.Message message) -
gotToTheStore
- Throws:
Exception
-
reset
public final void reset()Description copied from interface:PendingMessageCursorreset the cursor- Specified by:
resetin interfacePendingMessageCursor- Overrides:
resetin classAbstractPendingMessageCursor
-
release
public void release()Description copied from interface:PendingMessageCursorhint to the cursor to release any locks it might have grabbed after a reset- Specified by:
releasein interfacePendingMessageCursor- Overrides:
releasein classAbstractPendingMessageCursor
-
finished
public final void finished() -
hasNext
public final boolean hasNext()- Specified by:
hasNextin interfacePendingMessageCursor- Overrides:
hasNextin classAbstractPendingMessageCursor- Returns:
- true if there pending messages to dispatch
-
next
public final org.apache.activemq.broker.region.MessageReference next()- Specified by:
nextin interfacePendingMessageCursor- Overrides:
nextin classAbstractPendingMessageCursor- Returns:
- the next pending message with its reference count increment
-
tryAddMessageLast
public boolean tryAddMessageLast(org.apache.activemq.broker.region.MessageReference node, long wait) throws Exception Description copied from interface:PendingMessageCursoradd message to await dispatch - if it can- Specified by:
tryAddMessageLastin interfacePendingMessageCursor- Overrides:
tryAddMessageLastin classAbstractPendingMessageCursor- Returns:
- true if successful
- Throws:
IOExceptionException
-
isCacheEnabled
public boolean isCacheEnabled()- Specified by:
isCacheEnabledin interfacePendingMessageCursor- Overrides:
isCacheEnabledin classAbstractPendingMessageCursor- Returns:
- true if cache is being used
-
enableCacheNow
protected boolean enableCacheNow() -
canEnableCash
protected boolean canEnableCash() -
canRecoveryNextMessage
public boolean canRecoveryNextMessage()- Specified by:
canRecoveryNextMessagein interfaceMessageRecoveryListener
-
setBatch
- Throws:
Exception
-
addMessageFirst
public void addMessageFirst(org.apache.activemq.broker.region.MessageReference node) throws Exception Description copied from interface:PendingMessageCursoradd message to await dispatch- Specified by:
addMessageFirstin interfacePendingMessageCursor- Overrides:
addMessageFirstin classAbstractPendingMessageCursor- Throws:
Exception
-
remove
public final void remove()Description copied from interface:PendingMessageCursorremove the message at the cursor position- Specified by:
removein interfacePendingMessageCursor- Overrides:
removein classAbstractPendingMessageCursor
-
remove
public final void remove(org.apache.activemq.broker.region.MessageReference node) Description copied from interface:PendingMessageCursorremove a node- Specified by:
removein interfacePendingMessageCursor- Overrides:
removein classAbstractPendingMessageCursor
-
clear
public final void clear()Description copied from interface:PendingMessageCursorclear all pending messages- Specified by:
clearin interfacePendingMessageCursor- Overrides:
clearin classAbstractPendingMessageCursor
-
gc
public void gc()Description copied from interface:PendingMessageCursorfree up any internal buffers- Specified by:
gcin interfacePendingMessageCursor- Overrides:
gcin classAbstractPendingMessageCursor
-
fillBatch
protected final void fillBatch()- Overrides:
fillBatchin classAbstractPendingMessageCursor
-
isEmpty
public final boolean isEmpty()- Specified by:
isEmptyin interfacePendingMessageCursor- Overrides:
isEmptyin classAbstractPendingMessageCursor- Returns:
- true if there are no pending messages
-
hasMessagesBufferedToDeliver
public final boolean hasMessagesBufferedToDeliver()- Specified by:
hasMessagesBufferedToDeliverin interfacePendingMessageCursor- Overrides:
hasMessagesBufferedToDeliverin classAbstractPendingMessageCursor- Returns:
- true if the cursor has buffered messages ready to deliver
-
size
public final int size()- Specified by:
sizein interfacePendingMessageCursor- Overrides:
sizein classAbstractPendingMessageCursor- Returns:
- the number of pending messages
-
messageSize
public final long messageSize()- Specified by:
messageSizein interfacePendingMessageCursor
-
toString
-
doFillBatch
- Throws:
Exception
-
resetBatch
protected abstract void resetBatch() -
getStoreSize
protected abstract int getStoreSize() -
getStoreMessageSize
protected abstract long getStoreMessageSize() -
isStoreEmpty
protected abstract boolean isStoreEmpty() -
getSubscription
-