org.apache.activemq.broker.region.cursors
Interface PendingMessageCursor

All Superinterfaces:
Service
All Known Implementing Classes:
AbstractPendingMessageCursor, AbstractStoreCursor, FilePendingMessageCursor, StoreDurableSubscriberCursor, StoreQueueCursor, VMPendingMessageCursor

public interface PendingMessageCursor
extends Service

Interface to pending message (messages awaiting disptach to a consumer) cursor


Method Summary
 void add(ConnectionContext context, Destination destination)
          Add a destination
 void addMessageFirst(MessageReference node)
          add message to await dispatch
 void 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
 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 isEmpty()
           
 boolean isEmpty(Destination destination)
          check if a Destination is Empty for this cursor
 boolean isEnableAudit()
           
 boolean isFull()
           
 boolean isRecoveryRequired()
          Informs the Broker if the subscription needs to intervention to recover it's state e.g.
 boolean isTransient()
           
 boolean isUseCache()
           
 MessageReference next()
           
 LinkedList<MessageReference> pageInList(int maxItems)
          Page in a restricted number of messages and increment the reference count
 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 setEnableAudit(boolean enableAudit)
           
 void setMaxAuditDepth(int depth)
          Set the maximum depth of message ids to track
 void setMaxBatchSize(int maxBatchSize)
          Set the max batch size
 void setMaxProducersToAudit(int value)
          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 systemUsage)
          Set the UsageManager
 void setUseCache(boolean useCache)
          use a cache to improve performance
 int size()
           
 boolean tryAddMessageLast(MessageReference node, long maxWaitTime)
          add message to await dispatch - if it can
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Method Detail

add

void add(ConnectionContext context,
         Destination destination)
         throws Exception
Add a destination

Parameters:
context -
destination -
Throws:
Exception

remove

List<MessageReference> remove(ConnectionContext context,
                              Destination destination)
                              throws Exception
remove a destination

Parameters:
context -
destination -
Throws:
Exception

isEmpty

boolean isEmpty()
Returns:
true if there are no pending messages

isEmpty

boolean isEmpty(Destination destination)
check if a Destination is Empty for this cursor

Parameters:
destination -
Returns:
true id the Destination is empty

reset

void reset()
reset the cursor


release

void release()
hint to the cursor to release any locks it might have grabbed after a reset


addMessageLast

void addMessageLast(MessageReference node)
                    throws Exception
add message to await dispatch

Parameters:
node -
Throws:
IOException
Exception

tryAddMessageLast

boolean tryAddMessageLast(MessageReference node,
                          long maxWaitTime)
                          throws Exception
add message to await dispatch - if it can

Parameters:
node -
maxWaitTime -
Returns:
true if successful
Throws:
IOException
Exception

addMessageFirst

void addMessageFirst(MessageReference node)
                     throws Exception
add message to await dispatch

Parameters:
node -
Throws:
Exception

addRecoveredMessage

void addRecoveredMessage(MessageReference node)
                         throws Exception
Add a message recovered from a retroactive policy

Parameters:
node -
Throws:
Exception

hasNext

boolean hasNext()
Returns:
true if there pending messages to dispatch

next

MessageReference next()
Returns:
the next pending message with its reference count increment

remove

void remove()
remove the message at the cursor position


size

int size()
Returns:
the number of pending messages

clear

void clear()
clear all pending messages


isRecoveryRequired

boolean isRecoveryRequired()
Informs the Broker if the subscription needs to intervention to recover it's state e.g. DurableTopicSubscriber may do

Returns:
true if recovery required

getMaxBatchSize

int getMaxBatchSize()
Returns:
the maximum batch size

setMaxBatchSize

void setMaxBatchSize(int maxBatchSize)
Set the max batch size

Parameters:
maxBatchSize -

resetForGC

void resetForGC()
Give the cursor a hint that we are about to remove messages from memory only


remove

void remove(MessageReference node)
remove a node

Parameters:
node -

gc

void gc()
free up any internal buffers


setSystemUsage

void setSystemUsage(SystemUsage systemUsage)
Set the UsageManager

Parameters:
systemUsage -
See Also:
SystemUsage

getSystemUsage

SystemUsage getSystemUsage()
Returns:
the usageManager

getMemoryUsageHighWaterMark

int getMemoryUsageHighWaterMark()
Returns:
the memoryUsageHighWaterMark

setMemoryUsageHighWaterMark

void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark)
Parameters:
memoryUsageHighWaterMark - the memoryUsageHighWaterMark to set

isFull

boolean isFull()
Returns:
true if the cursor is full

hasSpace

boolean hasSpace()
Returns:
true if the cursor has space to page messages into

hasMessagesBufferedToDeliver

boolean hasMessagesBufferedToDeliver()
Returns:
true if the cursor has buffered messages ready to deliver

destroy

void destroy()
             throws Exception
destroy the cursor

Throws:
Exception

pageInList

LinkedList<MessageReference> pageInList(int maxItems)
Page in a restricted number of messages and increment the reference count

Parameters:
maxItems -
Returns:
a list of paged in messages

setMaxProducersToAudit

void setMaxProducersToAudit(int value)
set the maximum number of producers to track at one time

Parameters:
value -

getMaxProducersToAudit

int getMaxProducersToAudit()
Returns:
the maximum number of producers to audit

setMaxAuditDepth

void setMaxAuditDepth(int depth)
Set the maximum depth of message ids to track

Parameters:
depth -

getMaxAuditDepth

int getMaxAuditDepth()
Returns:
the audit depth

isEnableAudit

boolean isEnableAudit()
Returns:
the enableAudit

setEnableAudit

void setEnableAudit(boolean enableAudit)
Parameters:
enableAudit - the enableAudit to set

isTransient

boolean isTransient()
Returns:
true if the underlying state of this cursor disappears when the broker shuts down

setMessageAudit

void setMessageAudit(ActiveMQMessageAudit audit)
set the audit

Parameters:
audit -

getMessageAudit

ActiveMQMessageAudit getMessageAudit()
Returns:
the audit - could be null

setUseCache

void setUseCache(boolean useCache)
use a cache to improve performance

Parameters:
useCache -

isUseCache

boolean isUseCache()
Returns:
true if a cache may be used

rollback

void rollback(MessageId id)
remove from auditing the message id

Parameters:
id -

isCacheEnabled

boolean isCacheEnabled()
Returns:
true if cache is being used


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.