Class VMPendingMessageCursor
- java.lang.Object
-
- org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
-
- org.apache.activemq.broker.region.cursors.VMPendingMessageCursor
-
- All Implemented Interfaces:
PendingMessageCursor,Service
public class VMPendingMessageCursor extends AbstractPendingMessageCursor
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, useCache
-
Fields inherited from interface org.apache.activemq.broker.region.cursors.PendingMessageCursor
INFINITE_WAIT
-
-
Constructor Summary
Constructors Constructor Description VMPendingMessageCursor(boolean prioritizedMessages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessageFirst(MessageReference node)add message to await dispatchvoidclear()clear all pending messagesvoiddestroy()destroy the cursorbooleanhasNext()booleanisEmpty()booleanisTransient()longmessageSize()MessageReferencenext()LinkedList<MessageReference>pageInList(int maxItems)Page in a restricted number of messagesvoidremove()remove the message at the cursor positionList<MessageReference>remove(ConnectionContext context, Destination destination)remove a destinationvoidremove(MessageReference node)remove a nodevoidreset()reset the cursorintsize()booleantryAddMessageLast(MessageReference node, long maxWait)add message to await dispatch-
Methods 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
-
-
-
-
Method Detail
-
remove
public List<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(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(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 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(MessageReference node)
Description copied from interface:PendingMessageCursorremove a node- Specified by:
removein interfacePendingMessageCursor- Overrides:
removein classAbstractPendingMessageCursor
-
pageInList
public LinkedList<MessageReference> pageInList(int maxItems)
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
public void destroy() throws ExceptionDescription copied from class:AbstractPendingMessageCursordestroy the cursor- Specified by:
destroyin interfacePendingMessageCursor- Overrides:
destroyin classAbstractPendingMessageCursor- Throws:
Exception
-
-