org.apache.activemq.broker.region.cursors
Class VMPendingMessageCursor

java.lang.Object
  extended by org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
      extended by org.apache.activemq.broker.region.cursors.VMPendingMessageCursor
All Implemented Interfaces:
PendingMessageCursor, 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, enableAudit, last, maxAuditDepth, maxBatchSize, maxProducersToAudit, memoryUsageHighWaterMark, prioritizedMessages, systemUsage, useCache
 
Constructor Summary
VMPendingMessageCursor(boolean prioritizedMessages)
           
 
Method Summary
 void addMessageFirst(MessageReference node)
          add message to await dispatch
 void addMessageLast(MessageReference node)
          add message to await dispatch
 void clear()
          clear all pending messages
 void destroy()
          destroy the cursor
 boolean hasNext()
           
 boolean isEmpty()
           
 boolean isTransient()
           
 MessageReference next()
           
 LinkedList<MessageReference> pageInList(int maxItems)
          Page in a restricted number of messages
 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
 int size()
           
 
Methods inherited from class org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
add, addRecoveredMessage, fillBatch, gc, getMaxAuditDepth, getMaxBatchSize, getMaxProducersToAudit, getMemoryUsageHighWaterMark, getMessageAudit, getSystemUsage, hasMessagesBufferedToDeliver, hasSpace, isCacheEnabled, isDuplicate, isEmpty, isEnableAudit, isFull, isPrioritizedMessageSubscriber, isRecoveryRequired, isStarted, isUseCache, recordUniqueId, release, resetForGC, rollback, setCacheEnabled, setEnableAudit, setMaxAuditDepth, setMaxBatchSize, setMaxProducersToAudit, setMemoryUsageHighWaterMark, setMessageAudit, setSystemUsage, setUseCache, start, stop, tryAddMessageLast
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VMPendingMessageCursor

public VMPendingMessageCursor(boolean prioritizedMessages)
Method Detail

remove

public List<MessageReference> remove(ConnectionContext context,
                                     Destination destination)
                              throws Exception
Description copied from interface: PendingMessageCursor
remove a destination

Specified by:
remove in interface PendingMessageCursor
Overrides:
remove in class AbstractPendingMessageCursor
Throws:
Exception

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface PendingMessageCursor
Overrides:
isEmpty in class AbstractPendingMessageCursor
Returns:
true if there are no pending messages

reset

public void reset()
reset the cursor

Specified by:
reset in interface PendingMessageCursor
Overrides:
reset in class AbstractPendingMessageCursor

addMessageLast

public void addMessageLast(MessageReference node)
add message to await dispatch

Specified by:
addMessageLast in interface PendingMessageCursor
Overrides:
addMessageLast in class AbstractPendingMessageCursor
Parameters:
node -

addMessageFirst

public void addMessageFirst(MessageReference node)
add message to await dispatch

Specified by:
addMessageFirst in interface PendingMessageCursor
Overrides:
addMessageFirst in class AbstractPendingMessageCursor
Parameters:
position -
node -

hasNext

public boolean hasNext()
Specified by:
hasNext in interface PendingMessageCursor
Overrides:
hasNext in class AbstractPendingMessageCursor
Returns:
true if there pending messages to dispatch

next

public MessageReference next()
Specified by:
next in interface PendingMessageCursor
Overrides:
next in class AbstractPendingMessageCursor
Returns:
the next pending message

remove

public void remove()
remove the message at the cursor position

Specified by:
remove in interface PendingMessageCursor
Overrides:
remove in class AbstractPendingMessageCursor

size

public int size()
Specified by:
size in interface PendingMessageCursor
Overrides:
size in class AbstractPendingMessageCursor
Returns:
the number of pending messages

clear

public void clear()
clear all pending messages

Specified by:
clear in interface PendingMessageCursor
Overrides:
clear in class AbstractPendingMessageCursor

remove

public void remove(MessageReference node)
Description copied from interface: PendingMessageCursor
remove a node

Specified by:
remove in interface PendingMessageCursor
Overrides:
remove in class AbstractPendingMessageCursor

pageInList

public LinkedList<MessageReference> pageInList(int maxItems)
Page in a restricted number of messages

Specified by:
pageInList in interface PendingMessageCursor
Overrides:
pageInList in class AbstractPendingMessageCursor
Parameters:
maxItems -
Returns:
a list of paged in messages

isTransient

public boolean isTransient()
Specified by:
isTransient in interface PendingMessageCursor
Overrides:
isTransient in class AbstractPendingMessageCursor
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 interface PendingMessageCursor
Overrides:
destroy in class AbstractPendingMessageCursor
Throws:
Exception


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