Interface PendingMessageCursor

    • Method Detail

      • 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

        boolean addMessageLast​(org.apache.activemq.broker.region.MessageReference node)
                        throws Exception
        add message to await dispatch
        Parameters:
        node -
        Returns:
        boolean true if successful, false if cursor traps a duplicate
        Throws:
        IOException
        Exception
      • tryAddMessageLast

        boolean tryAddMessageLast​(org.apache.activemq.broker.region.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​(org.apache.activemq.broker.region.MessageReference node)
                      throws Exception
        add message to await dispatch
        Parameters:
        node -
        Throws:
        Exception
      • addRecoveredMessage

        void addRecoveredMessage​(org.apache.activemq.broker.region.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

        org.apache.activemq.broker.region.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
      • messageSize

        long messageSize()
      • 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​(org.apache.activemq.broker.region.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
      • pageInList

        LinkedList<org.apache.activemq.broker.region.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​(org.apache.activemq.ActiveMQMessageAudit audit)
        set the audit
        Parameters:
        audit -
      • getMessageAudit

        org.apache.activemq.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​(org.apache.activemq.command.MessageId id)
        remove from auditing the message id
        Parameters:
        id -
      • isCacheEnabled

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

        void rebase()