public abstract class AbstractPendingMessageCursor extends Object implements PendingMessageCursor
Modifier and Type | Field and Description |
---|---|
protected ActiveMQMessageAudit |
audit |
protected boolean |
enableAudit |
protected MessageReference |
last |
protected int |
maxAuditDepth |
protected int |
maxBatchSize |
protected int |
maxProducersToAudit |
protected int |
memoryUsageHighWaterMark |
protected boolean |
prioritizedMessages |
protected SystemUsage |
systemUsage |
protected boolean |
useCache |
INFINITE_WAIT
Constructor and Description |
---|
AbstractPendingMessageCursor(boolean prioritizedMessages) |
Modifier and Type | Method and Description |
---|---|
void |
add(ConnectionContext context,
Destination destination)
Add a destination
|
void |
addMessageFirst(MessageReference node)
add message to await dispatch
|
boolean |
addMessageLast(MessageReference node)
add message to await dispatch
|
void |
addRecoveredMessage(MessageReference node)
Add a message recovered from a retroactive policy
|
void |
clear()
clear all pending messages
|
void |
destroy()
destroy the cursor
|
protected void |
fillBatch() |
void |
gc()
free up any internal buffers
|
int |
getMaxAuditDepth() |
int |
getMaxBatchSize() |
int |
getMaxProducersToAudit() |
int |
getMemoryUsageHighWaterMark() |
ActiveMQMessageAudit |
getMessageAudit() |
SystemUsage |
getSystemUsage() |
boolean |
hasMessagesBufferedToDeliver() |
boolean |
hasNext() |
boolean |
hasSpace() |
boolean |
isCacheEnabled() |
boolean |
isDuplicate(MessageId messageId) |
boolean |
isEmpty() |
boolean |
isEmpty(Destination destination)
check if a Destination is Empty for this cursor
|
boolean |
isEnableAudit() |
boolean |
isFull() |
static boolean |
isPrioritizedMessageSubscriber(Broker broker,
Subscription sub) |
boolean |
isRecoveryRequired()
Informs the Broker if the subscription needs to intervention to recover
it's state e.g.
|
boolean |
isStarted() |
boolean |
isTransient() |
boolean |
isUseCache() |
MessageReference |
next() |
LinkedList<MessageReference> |
pageInList(int maxItems)
Page in a restricted number of messages
|
void |
rebase() |
boolean |
recordUniqueId(MessageId messageId)
records a message id and checks if it is a duplicate
|
void |
release()
hint to the cursor to release any locks it might have grabbed after a
reset
|
void |
remove()
remove the message at the cursor position
|
List<MessageReference> |
remove(ConnectionContext context,
Destination destination)
remove a destination
|
void |
remove(MessageReference node)
remove a node
|
void |
reset()
reset the cursor
|
void |
resetForGC()
Give the cursor a hint that we are about to remove messages from memory
only
|
void |
rollback(MessageId id)
remove from auditing the message id
|
void |
setCacheEnabled(boolean val) |
void |
setEnableAudit(boolean enableAudit) |
void |
setMaxAuditDepth(int maxAuditDepth)
Set the maximum depth of message ids to track
|
void |
setMaxBatchSize(int maxBatchSize)
Set the max batch size
|
void |
setMaxProducersToAudit(int maxProducersToAudit)
set the maximum number of producers to track at one time
|
void |
setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark) |
void |
setMessageAudit(ActiveMQMessageAudit audit)
set the audit
|
void |
setSystemUsage(SystemUsage usageManager)
Set the UsageManager
|
void |
setUseCache(boolean useCache)
use a cache to improve performance
|
int |
size() |
void |
start() |
void |
stop() |
boolean |
tryAddMessageLast(MessageReference node,
long maxWaitTime)
add message to await dispatch - if it can
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
messageSize
protected int memoryUsageHighWaterMark
protected int maxBatchSize
protected SystemUsage systemUsage
protected int maxProducersToAudit
protected int maxAuditDepth
protected boolean enableAudit
protected ActiveMQMessageAudit audit
protected boolean useCache
protected MessageReference last
protected final boolean prioritizedMessages
public AbstractPendingMessageCursor(boolean prioritizedMessages)
public void add(ConnectionContext context, Destination destination) throws Exception
PendingMessageCursor
add
in interface PendingMessageCursor
Exception
public List<MessageReference> remove(ConnectionContext context, Destination destination) throws Exception
PendingMessageCursor
remove
in interface PendingMessageCursor
Exception
public boolean isRecoveryRequired()
PendingMessageCursor
isRecoveryRequired
in interface PendingMessageCursor
public void addMessageFirst(MessageReference node) throws Exception
PendingMessageCursor
addMessageFirst
in interface PendingMessageCursor
Exception
public boolean addMessageLast(MessageReference node) throws Exception
PendingMessageCursor
addMessageLast
in interface PendingMessageCursor
IOException
Exception
public boolean tryAddMessageLast(MessageReference node, long maxWaitTime) throws Exception
PendingMessageCursor
tryAddMessageLast
in interface PendingMessageCursor
IOException
Exception
public void addRecoveredMessage(MessageReference node) throws Exception
PendingMessageCursor
addRecoveredMessage
in interface PendingMessageCursor
Exception
public void clear()
PendingMessageCursor
clear
in interface PendingMessageCursor
public boolean hasNext()
hasNext
in interface PendingMessageCursor
public boolean isEmpty()
isEmpty
in interface PendingMessageCursor
public boolean isEmpty(Destination destination)
PendingMessageCursor
isEmpty
in interface PendingMessageCursor
public MessageReference next()
next
in interface PendingMessageCursor
public void remove()
PendingMessageCursor
remove
in interface PendingMessageCursor
public void reset()
PendingMessageCursor
reset
in interface PendingMessageCursor
public int size()
size
in interface PendingMessageCursor
public int getMaxBatchSize()
getMaxBatchSize
in interface PendingMessageCursor
public void setMaxBatchSize(int maxBatchSize)
PendingMessageCursor
setMaxBatchSize
in interface PendingMessageCursor
public void resetForGC()
PendingMessageCursor
resetForGC
in interface PendingMessageCursor
public void remove(MessageReference node)
PendingMessageCursor
remove
in interface PendingMessageCursor
public void gc()
PendingMessageCursor
gc
in interface PendingMessageCursor
public void setSystemUsage(SystemUsage usageManager)
PendingMessageCursor
setSystemUsage
in interface PendingMessageCursor
SystemUsage
public boolean hasSpace()
hasSpace
in interface PendingMessageCursor
public boolean isFull()
isFull
in interface PendingMessageCursor
public void release()
PendingMessageCursor
release
in interface PendingMessageCursor
public boolean hasMessagesBufferedToDeliver()
hasMessagesBufferedToDeliver
in interface PendingMessageCursor
public int getMemoryUsageHighWaterMark()
getMemoryUsageHighWaterMark
in interface PendingMessageCursor
public void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark)
setMemoryUsageHighWaterMark
in interface PendingMessageCursor
memoryUsageHighWaterMark
- the memoryUsageHighWaterMark to setpublic SystemUsage getSystemUsage()
getSystemUsage
in interface PendingMessageCursor
public void destroy() throws Exception
destroy
in interface PendingMessageCursor
Exception
public LinkedList<MessageReference> pageInList(int maxItems)
pageInList
in interface PendingMessageCursor
maxItems
- maximum number of messages to returnpublic int getMaxProducersToAudit()
getMaxProducersToAudit
in interface PendingMessageCursor
public void setMaxProducersToAudit(int maxProducersToAudit)
PendingMessageCursor
setMaxProducersToAudit
in interface PendingMessageCursor
maxProducersToAudit
- the maxProducersToAudit to setpublic int getMaxAuditDepth()
getMaxAuditDepth
in interface PendingMessageCursor
public void setMaxAuditDepth(int maxAuditDepth)
PendingMessageCursor
setMaxAuditDepth
in interface PendingMessageCursor
maxAuditDepth
- the maxAuditDepth to setpublic boolean isEnableAudit()
isEnableAudit
in interface PendingMessageCursor
public void setEnableAudit(boolean enableAudit)
setEnableAudit
in interface PendingMessageCursor
enableAudit
- the enableAudit to setpublic boolean isTransient()
isTransient
in interface PendingMessageCursor
public void setMessageAudit(ActiveMQMessageAudit audit)
setMessageAudit
in interface PendingMessageCursor
audit
- new audit componentpublic ActiveMQMessageAudit getMessageAudit()
getMessageAudit
in interface PendingMessageCursor
public boolean isUseCache()
isUseCache
in interface PendingMessageCursor
public void setUseCache(boolean useCache)
PendingMessageCursor
setUseCache
in interface PendingMessageCursor
public boolean isDuplicate(MessageId messageId)
public boolean recordUniqueId(MessageId messageId)
messageId
- public void rollback(MessageId id)
PendingMessageCursor
rollback
in interface PendingMessageCursor
public boolean isStarted()
public static boolean isPrioritizedMessageSubscriber(Broker broker, Subscription sub)
public boolean isCacheEnabled()
isCacheEnabled
in interface PendingMessageCursor
public void setCacheEnabled(boolean val)
public void rebase()
rebase
in interface PendingMessageCursor
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.