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
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 void
addMessageFirst(org.apache.activemq.broker.region.MessageReference node)
add message to await dispatchvoid
clear()
clear all pending messagesvoid
destroy()
destroy the cursorboolean
hasNext()
boolean
isEmpty()
boolean
isTransient()
long
messageSize()
org.apache.activemq.broker.region.MessageReference
next()
LinkedList<org.apache.activemq.broker.region.MessageReference>
pageInList(int maxItems)
Page in a restricted number of messagesvoid
remove()
remove the message at the cursor positionList<org.apache.activemq.broker.region.MessageReference>
remove(ConnectionContext context, Destination destination)
remove a destinationvoid
remove(org.apache.activemq.broker.region.MessageReference node)
remove a nodevoid
reset()
reset the cursorint
size()
boolean
tryAddMessageLast(org.apache.activemq.broker.region.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<org.apache.activemq.broker.region.MessageReference> remove(ConnectionContext context, Destination destination) throws Exception
Description copied from interface:PendingMessageCursor
remove a destination- Specified by:
remove
in interfacePendingMessageCursor
- Overrides:
remove
in classAbstractPendingMessageCursor
- Throws:
Exception
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePendingMessageCursor
- Overrides:
isEmpty
in classAbstractPendingMessageCursor
- Returns:
- true if there are no pending messages
-
reset
public void reset()
reset the cursor- Specified by:
reset
in interfacePendingMessageCursor
- Overrides:
reset
in classAbstractPendingMessageCursor
-
tryAddMessageLast
public boolean tryAddMessageLast(org.apache.activemq.broker.region.MessageReference node, long maxWait)
add message to await dispatch- Specified by:
tryAddMessageLast
in interfacePendingMessageCursor
- Overrides:
tryAddMessageLast
in 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:
addMessageFirst
in interfacePendingMessageCursor
- Overrides:
addMessageFirst
in classAbstractPendingMessageCursor
- Parameters:
node
-
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacePendingMessageCursor
- Overrides:
hasNext
in classAbstractPendingMessageCursor
- Returns:
- true if there pending messages to dispatch
-
next
public org.apache.activemq.broker.region.MessageReference next()
- Specified by:
next
in interfacePendingMessageCursor
- Overrides:
next
in classAbstractPendingMessageCursor
- Returns:
- the next pending message
-
remove
public void remove()
remove the message at the cursor position- Specified by:
remove
in interfacePendingMessageCursor
- Overrides:
remove
in classAbstractPendingMessageCursor
-
size
public int size()
- Specified by:
size
in interfacePendingMessageCursor
- Overrides:
size
in classAbstractPendingMessageCursor
- Returns:
- the number of pending messages
-
messageSize
public long messageSize()
-
clear
public void clear()
clear all pending messages- Specified by:
clear
in interfacePendingMessageCursor
- Overrides:
clear
in classAbstractPendingMessageCursor
-
remove
public void remove(org.apache.activemq.broker.region.MessageReference node)
Description copied from interface:PendingMessageCursor
remove a node- Specified by:
remove
in interfacePendingMessageCursor
- Overrides:
remove
in classAbstractPendingMessageCursor
-
pageInList
public LinkedList<org.apache.activemq.broker.region.MessageReference> pageInList(int maxItems)
Page in a restricted number of messages- Specified by:
pageInList
in interfacePendingMessageCursor
- Overrides:
pageInList
in classAbstractPendingMessageCursor
- Parameters:
maxItems
-- Returns:
- a list of paged in messages
-
isTransient
public boolean isTransient()
- Specified by:
isTransient
in interfacePendingMessageCursor
- Overrides:
isTransient
in classAbstractPendingMessageCursor
- Returns:
- true if the underlying state of this cursor disappears when the broker shuts down
-
destroy
public void destroy() throws Exception
Description copied from class:AbstractPendingMessageCursor
destroy the cursor- Specified by:
destroy
in interfacePendingMessageCursor
- Overrides:
destroy
in classAbstractPendingMessageCursor
- Throws:
Exception
-
-