org.apache.activemq.broker.region
Class QueueBrowserSubscription

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
              extended by org.apache.activemq.broker.region.QueueBrowserSubscription
All Implemented Interfaces:
LockOwner, Subscription, SubscriptionRecovery

public class QueueBrowserSubscription
extends QueueSubscription


Field Summary
protected static Logger LOG
           
 
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
QueueBrowserSubscription(Broker broker, SystemUsage usageManager, ConnectionContext context, ConsumerInfo info)
           
 
Method Summary
protected  void acknowledge(ConnectionContext context, MessageAck ack, MessageReference n)
          Since we are a browser we don't really remove the message from the queue.
protected  boolean canDispatch(MessageReference node)
          Use when a matched message is about to be dispatched to the client.
 void decrementQueueRef()
           
 void destinationsAdded()
           
 void incrementQueueRef()
           
 boolean isDuplicate(MessageId messageId)
           
 boolean matches(MessageReference node, MessageEvaluationContext context)
          Is the subscription interested in the message?
 List<MessageReference> remove(ConnectionContext context, Destination destination)
          The subscription will be no longer be receiving messages from the destination.
 String toString()
           
 
Methods inherited from class org.apache.activemq.broker.region.QueueSubscription
destroy, getLockPriority, isDropped, isLockExclusive
 
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, getTimeOfLastMessageAck, isBrowser, isSlowConsumer, matches, removeDestination, setCursorMemoryHighWaterMark, setObjectName, setSelector, setSlowConsumer, setTimeOfLastMessageAck, unmatched
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

protected static final Logger LOG
Constructor Detail

QueueBrowserSubscription

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

canDispatch

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

Overrides:
canDispatch in class QueueSubscription
Returns:
false if the message should not be dispatched to the client (another sub may have already dispatched it for example).

toString

public String toString()
Overrides:
toString in class QueueSubscription

destinationsAdded

public void destinationsAdded()
                       throws Exception
Throws:
Exception

isDuplicate

public boolean isDuplicate(MessageId messageId)

matches

public boolean matches(MessageReference node,
                       MessageEvaluationContext context)
                throws IOException
Description copied from interface: Subscription
Is the subscription interested in the message?

Specified by:
matches in interface Subscription
Overrides:
matches in class AbstractSubscription
Returns:
Throws:
IOException

acknowledge

protected void acknowledge(ConnectionContext context,
                           MessageAck ack,
                           MessageReference n)
                    throws IOException
Since we are a browser we don't really remove the message from the queue.

Overrides:
acknowledge in class QueueSubscription
Throws:
IOException

incrementQueueRef

public void incrementQueueRef()

decrementQueueRef

public void decrementQueueRef()
                       throws Exception
Throws:
Exception

remove

public List<MessageReference> remove(ConnectionContext context,
                                     Destination destination)
                              throws Exception
Description copied from interface: Subscription
The subscription will be no longer be receiving messages from the destination.

Specified by:
remove in interface Subscription
Overrides:
remove in class PrefetchSubscription
Returns:
a list of un-acked messages that were added to the subscription.
Throws:
Exception


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.