org.apache.activemq.broker.region
Class QueueSubscription

java.lang.Object
  extended by org.apache.activemq.broker.region.AbstractSubscription
      extended by org.apache.activemq.broker.region.PrefetchSubscription
          extended by org.apache.activemq.broker.region.QueueSubscription
All Implemented Interfaces:
LockOwner, Subscription, SubscriptionRecovery
Direct Known Subclasses:
QueueBrowserSubscription

public class QueueSubscription
extends PrefetchSubscription
implements LockOwner


Field Summary
 
Fields inherited from class org.apache.activemq.broker.region.PrefetchSubscription
dequeueCounter, dispatchCounter, dispatched, dispatchLock, enqueueCounter, pending, pendingLock, prefetchExtension, scheduler, usageManager, usePrefetchExtension
 
Fields inherited from class org.apache.activemq.broker.region.AbstractSubscription
broker, context, destinationFilter, destinations, info
 
Fields inherited from interface org.apache.activemq.broker.region.LockOwner
HIGH_PRIORITY_LOCK_OWNER
 
Constructor Summary
QueueSubscription(Broker broker, SystemUsage usageManager, ConnectionContext context, ConsumerInfo info)
           
 
Method Summary
protected  void acknowledge(ConnectionContext context, MessageAck ack, MessageReference n)
          In the queue case, mark the node as dropped and then a gc cycle will remove it from the queue.
protected  void assignGroupToMe(MessageGroupMap messageGroupOwners, MessageReference n, String groupId)
          Assigns the message group to this subscription and set the flag on the message that it is the first message to be dispatched.
protected  boolean canDispatch(MessageReference n)
          Use when a matched message is about to be dispatched to the client.
 void destroy()
          Called when the subscription is destroyed.
 int getLockPriority()
           
protected  boolean isDropped(MessageReference node)
           
 boolean isLockExclusive()
           
 String toString()
           
 
Methods inherited from class org.apache.activemq.broker.region.PrefetchSubscription
acknowledge, add, add, assertAckMatchesDispatched, countBeforeFull, createMessageDispatch, dispatch, dispatchPending, getDequeueCounter, getDispatchedCounter, getDispatchedQueueSize, getEnqueueCounter, getInFlightSize, getMaxAuditDepth, getMaxProducersToAudit, getPending, getPendingQueueSize, getPrefetchExtension, isFull, isHighWaterMark, isLowWaterMark, isRecoveryRequired, isUsePrefetchExtension, onDispatch, processMessageDispatchNotification, pullMessage, remove, sendToDLQ, setMaxAuditDepth, setMaxProducersToAudit, setPending, setPendingBatchSize, setPrefetchSize, setUsePrefetchExtension, updateConsumerPrefetch
 
Methods inherited from class org.apache.activemq.broker.region.AbstractSubscription
addDestination, addRecoveredMessage, doAddRecoveredMessage, gc, getActiveMQDestination, getConsumerInfo, getContext, getCursorMemoryHighWaterMark, getInFlightUsage, getInfo, getObjectName, getPrefetchSize, getSelector, getSelectorExpression, isBrowser, isSlowConsumer, matches, matches, removeDestination, setCursorMemoryHighWaterMark, setObjectName, setSelector, setSlowConsumer, unmatched
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueueSubscription

public QueueSubscription(Broker broker,
                         SystemUsage usageManager,
                         ConnectionContext context,
                         ConsumerInfo info)
                  throws JMSException
Throws:
JMSException
Method Detail

acknowledge

protected void acknowledge(ConnectionContext context,
                           MessageAck ack,
                           MessageReference n)
                    throws IOException
In the queue case, mark the node as dropped and then a gc cycle will remove it from the queue.

Specified by:
acknowledge in class PrefetchSubscription
Throws:
IOException

canDispatch

protected boolean canDispatch(MessageReference n)
                       throws IOException
Description copied from class: PrefetchSubscription
Use when a matched message is about to be dispatched to the client.

Specified by:
canDispatch in class PrefetchSubscription
Returns:
false if the message should not be dispatched to the client (another sub may have already dispatched it for example).
Throws:
IOException

assignGroupToMe

protected void assignGroupToMe(MessageGroupMap messageGroupOwners,
                               MessageReference n,
                               String groupId)
                        throws IOException
Assigns the message group to this subscription and set the flag on the message that it is the first message to be dispatched.

Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

getLockPriority

public int getLockPriority()
Specified by:
getLockPriority in interface LockOwner

isLockExclusive

public boolean isLockExclusive()
Specified by:
isLockExclusive in interface LockOwner

destroy

public void destroy()
Description copied from interface: Subscription
Called when the subscription is destroyed.

Specified by:
destroy in interface Subscription

isDropped

protected boolean isDropped(MessageReference node)
Specified by:
isDropped in class PrefetchSubscription


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