public abstract class AbstractSubscription extends Object implements Subscription
| Modifier and Type | Field and Description |
|---|---|
protected Broker |
broker |
protected ConnectionContext |
context |
protected org.apache.activemq.filter.DestinationFilter |
destinationFilter |
protected CopyOnWriteArrayList<Destination> |
destinations |
protected org.apache.activemq.command.ConsumerInfo |
info |
protected AtomicInteger |
prefetchExtension |
| Constructor and Description |
|---|
AbstractSubscription(Broker broker,
ConnectionContext context,
org.apache.activemq.command.ConsumerInfo info) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(ConnectionContext context,
org.apache.activemq.command.MessageAck ack)
Used when client acknowledge receipt of dispatched message.
|
void |
add(ConnectionContext context,
Destination destination)
The subscription will be receiving messages from the destination.
|
void |
addDestination(Destination destination)
Add a destination
|
boolean |
addRecoveredMessage(ConnectionContext context,
org.apache.activemq.broker.region.MessageReference message)
Add a message to the SubscriptionRecovery
|
protected void |
contractPrefetchExtension(int amount) |
int |
countBeforeFull() |
protected void |
decrementPrefetchExtension(int amount) |
protected void |
doAddRecoveredMessage(org.apache.activemq.broker.region.MessageReference message) |
protected void |
expandPrefetchExtension(int amount) |
void |
gc()
The subscription should release as may references as it can to help the garbage collector
reclaim memory.
|
org.apache.activemq.command.ActiveMQDestination |
getActiveMQDestination() |
long |
getConsumedCount() |
org.apache.activemq.command.ConsumerInfo |
getConsumerInfo()
The ConsumerInfo object that created the subscription.
|
ConnectionContext |
getContext() |
int |
getCursorMemoryHighWaterMark() |
long |
getInFlightMessageSize() |
int |
getInFlightUsage() |
org.apache.activemq.command.ConsumerInfo |
getInfo() |
ObjectName |
getObjectName() |
AtomicInteger |
getPrefetchExtension() |
int |
getPrefetchSize() |
String |
getSelector() |
org.apache.activemq.filter.BooleanExpression |
getSelectorExpression() |
SubscriptionStatistics |
getSubscriptionStatistics() |
long |
getTimeOfLastMessageAck()
Returns the time since the last Ack message was received by this subscription.
|
void |
incrementConsumedCount() |
boolean |
isBrowser() |
boolean |
isRecoveryRequired()
Informs the Broker if the subscription needs to intervention to recover it's state
e.g.
|
boolean |
isSlowConsumer() |
boolean |
isUsePrefetchExtension() |
boolean |
isWildcard()
Returns true if this subscription is a Wildcard subscription.
|
boolean |
matches(org.apache.activemq.command.ActiveMQDestination destination)
Is the subscription interested in messages in the destination?
|
boolean |
matches(org.apache.activemq.broker.region.MessageReference node,
org.apache.activemq.filter.MessageEvaluationContext context)
Is the subscription interested in the message?
|
List<org.apache.activemq.broker.region.MessageReference> |
remove(ConnectionContext context,
Destination destination)
The subscription will be no longer be receiving messages from the destination.
|
void |
removeDestination(Destination destination)
Remove a destination
|
void |
resetConsumedCount() |
void |
setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark) |
void |
setObjectName(ObjectName objectName)
Set when the subscription is registered in JMX
|
void |
setPrefetchSize(int newSize) |
void |
setSelector(String selector)
Attempts to change the current active selector on the subscription.
|
void |
setSlowConsumer(boolean val) |
void |
setTimeOfLastMessageAck(long value) |
void |
setUsePrefetchExtension(boolean usePrefetchExtension) |
void |
unmatched(org.apache.activemq.broker.region.MessageReference node) |
void |
wakeupDestinationsForDispatch() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, destroy, getDequeueCounter, getDispatchedCounter, getDispatchedQueueSize, getEnqueueCounter, getInFlightSize, getPendingMessageSize, getPendingQueueSize, isFull, isHighWaterMark, isLowWaterMark, processMessageDispatchNotification, pullMessage, updateConsumerPrefetchprotected ConnectionContext context
protected org.apache.activemq.command.ConsumerInfo info
protected final org.apache.activemq.filter.DestinationFilter destinationFilter
protected final CopyOnWriteArrayList<Destination> destinations
protected final AtomicInteger prefetchExtension
public AbstractSubscription(Broker broker, ConnectionContext context, org.apache.activemq.command.ConsumerInfo info) throws javax.jms.InvalidSelectorException
javax.jms.InvalidSelectorExceptionpublic void acknowledge(ConnectionContext context, org.apache.activemq.command.MessageAck ack) throws Exception
Subscriptionacknowledge in interface SubscriptionIOExceptionExceptionpublic boolean matches(org.apache.activemq.broker.region.MessageReference node, org.apache.activemq.filter.MessageEvaluationContext context) throws IOException
Subscriptionmatches in interface SubscriptionIOExceptionpublic boolean isWildcard()
SubscriptionisWildcard in interface Subscriptionpublic boolean matches(org.apache.activemq.command.ActiveMQDestination destination)
Subscriptionmatches in interface Subscriptionpublic void add(ConnectionContext context, Destination destination) throws Exception
Subscriptionadd in interface SubscriptionExceptionpublic List<org.apache.activemq.broker.region.MessageReference> remove(ConnectionContext context, Destination destination) throws Exception
Subscriptionremove in interface SubscriptionExceptionpublic org.apache.activemq.command.ConsumerInfo getConsumerInfo()
SubscriptiongetConsumerInfo in interface Subscriptionpublic void gc()
Subscriptiongc in interface Subscriptionpublic ConnectionContext getContext()
getContext in interface Subscriptionpublic org.apache.activemq.command.ConsumerInfo getInfo()
public org.apache.activemq.filter.BooleanExpression getSelectorExpression()
public String getSelector()
getSelector in interface Subscriptionpublic void setSelector(String selector) throws javax.jms.InvalidSelectorException
SubscriptionsetSelector in interface Subscriptionjavax.jms.InvalidSelectorExceptionpublic ObjectName getObjectName()
getObjectName in interface Subscriptionpublic void setObjectName(ObjectName objectName)
SubscriptionsetObjectName in interface Subscriptionpublic int getPrefetchSize()
getPrefetchSize in interface Subscriptionpublic boolean isUsePrefetchExtension()
public void setUsePrefetchExtension(boolean usePrefetchExtension)
public void setPrefetchSize(int newSize)
public boolean isRecoveryRequired()
SubscriptionisRecoveryRequired in interface SubscriptionPendingMessageCursorpublic boolean isSlowConsumer()
isSlowConsumer in interface Subscriptionpublic void setSlowConsumer(boolean val)
public boolean addRecoveredMessage(ConnectionContext context, org.apache.activemq.broker.region.MessageReference message) throws Exception
SubscriptionRecoveryaddRecoveredMessage in interface SubscriptionRecoveryExceptionpublic org.apache.activemq.command.ActiveMQDestination getActiveMQDestination()
getActiveMQDestination in interface SubscriptionRecoverypublic boolean isBrowser()
isBrowser in interface Subscriptionpublic long getInFlightMessageSize()
getInFlightMessageSize in interface Subscriptionpublic int getInFlightUsage()
getInFlightUsage in interface Subscriptionpublic void addDestination(Destination destination)
destination - public void removeDestination(Destination destination)
destination - public int getCursorMemoryHighWaterMark()
getCursorMemoryHighWaterMark in interface Subscriptionpublic void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark)
setCursorMemoryHighWaterMark in interface Subscriptionpublic int countBeforeFull()
countBeforeFull in interface Subscriptionpublic void unmatched(org.apache.activemq.broker.region.MessageReference node) throws IOException
unmatched in interface SubscriptionIOExceptionprotected void doAddRecoveredMessage(org.apache.activemq.broker.region.MessageReference message) throws Exception
Exceptionpublic long getTimeOfLastMessageAck()
SubscriptiongetTimeOfLastMessageAck in interface Subscriptionpublic void setTimeOfLastMessageAck(long value)
public long getConsumedCount()
getConsumedCount in interface Subscriptionpublic void incrementConsumedCount()
incrementConsumedCount in interface Subscriptionpublic void resetConsumedCount()
resetConsumedCount in interface Subscriptionpublic SubscriptionStatistics getSubscriptionStatistics()
getSubscriptionStatistics in interface Subscriptionpublic void wakeupDestinationsForDispatch()
public AtomicInteger getPrefetchExtension()
protected void contractPrefetchExtension(int amount)
protected void expandPrefetchExtension(int amount)
protected void decrementPrefetchExtension(int amount)
Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.