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

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

public interface PendingMessageCursor
extends Service

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

Version:
$Revision: 474986 $

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 clear()
          clear all pending messages
 int getMaxBatchSize()
           
 boolean hasNext()
           
 boolean isEmpty()
           
 boolean isRecoveryRequired()
          Informs the Broker if the subscription needs to intervention to recover it's state e.g.
 MessageReference next()
           
 void remove()
          remove the message at the cursor position
 void remove(ConnectionContext context, Destination destination)
          remove a destination
 void reset()
          reset the cursor
 void resetForGC()
          Give the cursor a hint that we are about to remove messages from memory only
 void setMaxBatchSize(int maxBatchSize)
          Set the max batch size
 int size()
           
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Method Detail

add

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

Parameters:
context -
destination -
Throws:
java.lang.Exception

remove

void remove(ConnectionContext context,
            Destination destination)
            throws java.lang.Exception
remove a destination

Parameters:
context -
destination -
Throws:
java.lang.Exception

isEmpty

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

reset

void reset()
reset the cursor


addMessageLast

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

Parameters:
node -
Throws:
java.io.IOException
java.lang.Exception

addMessageFirst

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

Parameters:
node -
Throws:
java.lang.Exception

hasNext

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

next

MessageReference next()
Returns:
the next pending message

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



Copyright © 2009 Apache Software Foundation. All Rights Reserved.