Class VMPendingMessageCursor
java.lang.Object
org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
org.apache.activemq.broker.region.cursors.VMPendingMessageCursor
- All Implemented Interfaces:
PendingMessageCursor,org.apache.activemq.Service
hold pending messages in a linked list (messages awaiting disptach to a
consumer) cursor
-
Field Summary
Fields 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 dispatchvoidclear()clear all pending messagesvoiddestroy()destroy the cursorbooleanhasNext()booleanisEmpty()booleanlongorg.apache.activemq.broker.region.MessageReferencenext()LinkedList<org.apache.activemq.broker.region.MessageReference>pageInList(int maxItems) Page in a restricted number of messagesvoidremove()remove the message at the cursor positionList<org.apache.activemq.broker.region.MessageReference>remove(ConnectionContext context, Destination destination) remove a destinationvoidremove(org.apache.activemq.broker.region.MessageReference node) remove a nodevoidreset()reset the cursorintsize()booleantryAddMessageLast(org.apache.activemq.broker.region.MessageReference node, long maxWait) add message to await dispatchMethods inherited from class org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
add, addMessageLast, addRecoveredMessage, fillBatch, gc, getMaxAuditDepth, getMaxBatchSize, getMaxProducersToAudit, getMemoryUsageHighWaterMark, getMessageAudit, getSystemUsage, hasMessagesBufferedToDeliver, hasSpace, isCacheEnabled, isDuplicate, isEmpty, isEnableAudit, isFull, isPrioritizedMessageSubscriber, isRecoveryRequired, isStarted, isUseCache, rebase, recordUniqueId, release, resetForGC, rollback, setCacheEnabled, setEnableAudit, setMaxAuditDepth, setMaxBatchSize, setMaxProducersToAudit, setMemoryUsageHighWaterMark, setMessageAudit, setSystemUsage, setUseCache, start, stop
-
Constructor Details
-
VMPendingMessageCursor
public VMPendingMessageCursor(boolean prioritizedMessages)
-
-
Method Details
-
remove
public List<org.apache.activemq.broker.region.MessageReference> remove(ConnectionContext context, Destination destination) throws Exception Description copied from interface:PendingMessageCursorremove a destination- Specified by:
removein interfacePendingMessageCursor- Overrides:
removein classAbstractPendingMessageCursor- Throws:
Exception
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacePendingMessageCursor- Overrides:
isEmptyin classAbstractPendingMessageCursor- Returns:
- true if there are no pending messages
-
reset
public void reset()reset the cursor- Specified by:
resetin interfacePendingMessageCursor- Overrides:
resetin classAbstractPendingMessageCursor
-
tryAddMessageLast
public boolean tryAddMessageLast(org.apache.activemq.broker.region.MessageReference node, long maxWait) add message to await dispatch- Specified by:
tryAddMessageLastin interfacePendingMessageCursor- Overrides:
tryAddMessageLastin classAbstractPendingMessageCursor- Parameters:
node-- Returns:
- true if successful
-
addMessageFirst
public void addMessageFirst(org.apache.activemq.broker.region.MessageReference node) add message to await dispatch- Specified by:
addMessageFirstin interfacePendingMessageCursor- Overrides:
addMessageFirstin classAbstractPendingMessageCursor- Parameters:
node-
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfacePendingMessageCursor- Overrides:
hasNextin classAbstractPendingMessageCursor- Returns:
- true if there pending messages to dispatch
-
next
public org.apache.activemq.broker.region.MessageReference next()- Specified by:
nextin interfacePendingMessageCursor- Overrides:
nextin classAbstractPendingMessageCursor- Returns:
- the next pending message
-
remove
public void remove()remove the message at the cursor position- Specified by:
removein interfacePendingMessageCursor- Overrides:
removein classAbstractPendingMessageCursor
-
size
public int size()- Specified by:
sizein interfacePendingMessageCursor- Overrides:
sizein classAbstractPendingMessageCursor- Returns:
- the number of pending messages
-
messageSize
public long messageSize() -
clear
public void clear()clear all pending messages- Specified by:
clearin interfacePendingMessageCursor- Overrides:
clearin classAbstractPendingMessageCursor
-
remove
public void remove(org.apache.activemq.broker.region.MessageReference node) Description copied from interface:PendingMessageCursorremove a node- Specified by:
removein interfacePendingMessageCursor- Overrides:
removein classAbstractPendingMessageCursor
-
pageInList
Page in a restricted number of messages- Specified by:
pageInListin interfacePendingMessageCursor- Overrides:
pageInListin classAbstractPendingMessageCursor- Parameters:
maxItems-- Returns:
- a list of paged in messages
-
isTransient
public boolean isTransient()- Specified by:
isTransientin interfacePendingMessageCursor- Overrides:
isTransientin classAbstractPendingMessageCursor- Returns:
- true if the underlying state of this cursor disappears when the broker shuts down
-
destroy
Description copied from class:AbstractPendingMessageCursordestroy the cursor- Specified by:
destroyin interfacePendingMessageCursor- Overrides:
destroyin classAbstractPendingMessageCursor- Throws:
Exception
-