Class QueueSubscription
- java.lang.Object
-
- org.apache.activemq.broker.region.AbstractSubscription
-
- org.apache.activemq.broker.region.PrefetchSubscription
-
- 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
dispatched, dispatchLock, pending, pendingLock, scheduler, usageManager
-
Fields inherited from class org.apache.activemq.broker.region.AbstractSubscription
broker, context, destinationFilter, destinations, info, prefetchExtension
-
Fields inherited from interface org.apache.activemq.broker.region.LockOwner
HIGH_PRIORITY_LOCK_OWNER
-
-
Constructor Summary
Constructors Constructor Description QueueSubscription(Broker broker, SystemUsage usageManager, ConnectionContext context, ConsumerInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 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, getPendingMessageSize, getPendingQueueSize, isFull, isHighWaterMark, isLowWaterMark, isRecoveryRequired, onDispatch, processMessageDispatchNotification, pullMessage, remove, remove, sendToDLQ, setMaxAuditDepth, setMaxProducersToAudit, setPending, setPendingBatchSize, setPrefetchSize, trackedInPendingTransaction, updateConsumerPrefetch
-
Methods inherited from class org.apache.activemq.broker.region.AbstractSubscription
addDestination, addRecoveredMessage, contractPrefetchExtension, decrementPrefetchExtension, doAddRecoveredMessage, expandPrefetchExtension, gc, getActiveMQDestination, getConsumedCount, getConsumerInfo, getContext, getCursorMemoryHighWaterMark, getDestinations, getInFlightMessageSize, getInFlightUsage, getInfo, getObjectName, getPrefetchExtension, getPrefetchSize, getSelector, getSelectorExpression, getSubscriptionStatistics, getTimeOfLastMessageAck, incrementConsumedCount, isBrowser, isSlowConsumer, isUsePrefetchExtension, isWildcard, matches, matches, removeDestination, resetConsumedCount, setCursorMemoryHighWaterMark, setObjectName, setSelector, setSlowConsumer, setTimeOfLastMessageAck, setUsePrefetchExtension, unmatched, wakeupDestinationsForDispatch
-
-
-
-
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 classPrefetchSubscription
- 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 classPrefetchSubscription
- Returns:
- false if the message should not be dispatched to the client (another sub may have already dispatched it for example).
- Throws:
IOException
-
getLockPriority
public int getLockPriority()
- Specified by:
getLockPriority
in interfaceLockOwner
-
isLockExclusive
public boolean isLockExclusive()
- Specified by:
isLockExclusive
in interfaceLockOwner
-
destroy
public void destroy()
Description copied from interface:Subscription
Called when the subscription is destroyed.- Specified by:
destroy
in interfaceSubscription
-
isDropped
protected boolean isDropped(MessageReference node)
- Specified by:
isDropped
in classPrefetchSubscription
-
-