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

java.lang.Object
  extended by org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
      extended by org.apache.activemq.broker.region.cursors.StoreDurableSubscriberCursor
All Implemented Interfaces:
PendingMessageCursor, Service

public class StoreDurableSubscriberCursor
extends AbstractPendingMessageCursor

persist pending messages pending message (messages awaiting dispatch 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
StoreDurableSubscriberCursor(Broker broker, String clientId, String subscriberName, int maxBatchSize, DurableTopicSubscription subscription)
           
 
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 gc()
          free up any internal buffers
protected  PendingMessageCursor getNextCursor()
           
 boolean hasNext()
           
 boolean isEmpty()
           
 boolean isEmpty(Destination destination)
          check if a Destination is Empty for this cursor
 boolean isImmediatePriorityDispatch()
           
 boolean isRecoveryRequired()
          Informs the Broker if the subscription needs to intervention to recover it's state e.g.
 boolean isTransient()
           
 MessageReference next()
           
 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 setEnableAudit(boolean enableAudit)
           
 void setImmediatePriorityDispatch(boolean immediatePriorityDispatch)
           
 void setMaxAuditDepth(int maxAuditDepth)
          Set the maximum depth of message ids to track
 void setMaxBatchSize(int newMaxBatchSize)
          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 setSystemUsage(SystemUsage usageManager)
          Set the UsageManager
 void setUseCache(boolean useCache)
          use a cache to improve performance
 int size()
           
 void start()
           
 void stop()
           
 String toString()
           
 
Methods inherited from class org.apache.activemq.broker.region.cursors.AbstractPendingMessageCursor
destroy, fillBatch, getMaxAuditDepth, getMaxBatchSize, getMaxProducersToAudit, getMemoryUsageHighWaterMark, getMessageAudit, getSystemUsage, hasMessagesBufferedToDeliver, hasSpace, isCacheEnabled, isDuplicate, isEnableAudit, isFull, isPrioritizedMessageSubscriber, isStarted, isUseCache, pageInList, recordUniqueId, resetForGC, rollback, setCacheEnabled, setMessageAudit, tryAddMessageLast
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StoreDurableSubscriberCursor

public StoreDurableSubscriberCursor(Broker broker,
                                    String clientId,
                                    String subscriberName,
                                    int maxBatchSize,
                                    DurableTopicSubscription subscription)
Parameters:
broker - Broker for this cursor
clientId - clientId for this cursor
subscriberName - subscriber name for this cursor
maxBatchSize - currently ignored
subscription - subscription for this cursor
Method Detail

start

public void start()
           throws Exception
Specified by:
start in interface Service
Overrides:
start in class AbstractPendingMessageCursor
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Overrides:
stop in class AbstractPendingMessageCursor
Throws:
Exception

add

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

Specified by:
add in interface PendingMessageCursor
Overrides:
add in class AbstractPendingMessageCursor
Parameters:
context -
destination -
Throws:
Exception

remove

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

Specified by:
remove in interface PendingMessageCursor
Overrides:
remove in class AbstractPendingMessageCursor
Parameters:
context -
destination -
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

isEmpty

public boolean isEmpty(Destination destination)
Description copied from interface: PendingMessageCursor
check if a Destination is Empty for this cursor

Specified by:
isEmpty in interface PendingMessageCursor
Overrides:
isEmpty in class AbstractPendingMessageCursor
Returns:
true id the Destination is empty

isRecoveryRequired

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

Specified by:
isRecoveryRequired in interface PendingMessageCursor
Overrides:
isRecoveryRequired in class AbstractPendingMessageCursor
Returns:
true if recovery required
See Also:
AbstractPendingMessageCursor

addMessageLast

public void addMessageLast(MessageReference node)
                    throws Exception
Description copied from interface: PendingMessageCursor
add message to await dispatch

Specified by:
addMessageLast in interface PendingMessageCursor
Overrides:
addMessageLast in class AbstractPendingMessageCursor
Throws:
IOException
Exception

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

addMessageFirst

public void addMessageFirst(MessageReference node)
                     throws Exception
Description copied from interface: PendingMessageCursor
add message to await dispatch

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

addRecoveredMessage

public void addRecoveredMessage(MessageReference node)
                         throws Exception
Description copied from interface: PendingMessageCursor
Add a message recovered from a retroactive policy

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

clear

public void clear()
Description copied from interface: PendingMessageCursor
clear all pending messages

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

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 with its reference count increment

remove

public void remove()
Description copied from interface: PendingMessageCursor
remove the message at the cursor position

Specified by:
remove in interface PendingMessageCursor
Overrides:
remove 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

reset

public void reset()
Description copied from interface: PendingMessageCursor
reset the cursor

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

release

public void release()
Description copied from interface: PendingMessageCursor
hint to the cursor to release any locks it might have grabbed after a reset

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

size

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

setMaxBatchSize

public void setMaxBatchSize(int newMaxBatchSize)
Description copied from interface: PendingMessageCursor
Set the max batch size

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

gc

public void gc()
Description copied from interface: PendingMessageCursor
free up any internal buffers

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

setSystemUsage

public void setSystemUsage(SystemUsage usageManager)
Description copied from interface: PendingMessageCursor
Set the UsageManager

Specified by:
setSystemUsage in interface PendingMessageCursor
Overrides:
setSystemUsage in class AbstractPendingMessageCursor
See Also:
SystemUsage

setMemoryUsageHighWaterMark

public void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark)
Specified by:
setMemoryUsageHighWaterMark in interface PendingMessageCursor
Overrides:
setMemoryUsageHighWaterMark in class AbstractPendingMessageCursor
Parameters:
memoryUsageHighWaterMark - the memoryUsageHighWaterMark to set

setMaxProducersToAudit

public void setMaxProducersToAudit(int maxProducersToAudit)
Description copied from interface: PendingMessageCursor
set the maximum number of producers to track at one time

Specified by:
setMaxProducersToAudit in interface PendingMessageCursor
Overrides:
setMaxProducersToAudit in class AbstractPendingMessageCursor
Parameters:
maxProducersToAudit - the maxProducersToAudit to set

setMaxAuditDepth

public void setMaxAuditDepth(int maxAuditDepth)
Description copied from interface: PendingMessageCursor
Set the maximum depth of message ids to track

Specified by:
setMaxAuditDepth in interface PendingMessageCursor
Overrides:
setMaxAuditDepth in class AbstractPendingMessageCursor
Parameters:
maxAuditDepth - the maxAuditDepth to set

setEnableAudit

public void setEnableAudit(boolean enableAudit)
Specified by:
setEnableAudit in interface PendingMessageCursor
Overrides:
setEnableAudit in class AbstractPendingMessageCursor
Parameters:
enableAudit - the enableAudit to set

setUseCache

public void setUseCache(boolean useCache)
Description copied from interface: PendingMessageCursor
use a cache to improve performance

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

getNextCursor

protected PendingMessageCursor getNextCursor()
                                      throws Exception
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object

isImmediatePriorityDispatch

public boolean isImmediatePriorityDispatch()

setImmediatePriorityDispatch

public void setImmediatePriorityDispatch(boolean immediatePriorityDispatch)


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