public abstract class AbstractSubscription extends java.lang.Object implements Subscription
| Modifier and Type | Field and Description |
|---|---|
protected Broker |
broker |
protected ConnectionContext |
context |
protected DestinationFilter |
destinationFilter |
protected java.util.concurrent.CopyOnWriteArrayList<Destination> |
destinations |
protected ConsumerInfo |
info |
| Constructor and Description |
|---|
AbstractSubscription(Broker broker,
ConnectionContext context,
ConsumerInfo info) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(ConnectionContext context,
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,
MessageReference message)
Add a message to the SubscriptionRecovery
|
int |
countBeforeFull() |
protected void |
doAddRecoveredMessage(MessageReference message) |
void |
gc()
The subscription should release as may references as it can to help the garbage collector
reclaim memory.
|
ActiveMQDestination |
getActiveMQDestination() |
long |
getConsumedCount() |
ConsumerInfo |
getConsumerInfo()
The ConsumerInfo object that created the subscription.
|
ConnectionContext |
getContext() |
int |
getCursorMemoryHighWaterMark() |
int |
getInFlightUsage() |
ConsumerInfo |
getInfo() |
javax.management.ObjectName |
getObjectName() |
int |
getPrefetchSize() |
java.lang.String |
getSelector() |
BooleanExpression |
getSelectorExpression() |
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 |
matches(ActiveMQDestination destination)
Is the subscription interested in messages in the destination?
|
boolean |
matches(MessageReference node,
MessageEvaluationContext context)
Is the subscription interested in the message?
|
java.util.List<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(javax.management.ObjectName objectName)
Set when the subscription is registered in JMX
|
void |
setPrefetchSize(int newSize) |
void |
setSelector(java.lang.String selector)
Attempts to change the current active selector on the subscription.
|
void |
setSlowConsumer(boolean val) |
void |
setTimeOfLastMessageAck(long value) |
void |
unmatched(MessageReference node) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, destroy, getDequeueCounter, getDispatchedCounter, getDispatchedQueueSize, getEnqueueCounter, getInFlightSize, getPendingQueueSize, isFull, isHighWaterMark, isLowWaterMark, processMessageDispatchNotification, pullMessage, updateConsumerPrefetchprotected Broker broker
protected ConnectionContext context
protected ConsumerInfo info
protected final DestinationFilter destinationFilter
protected final java.util.concurrent.CopyOnWriteArrayList<Destination> destinations
public AbstractSubscription(Broker broker, ConnectionContext context, ConsumerInfo info) throws javax.jms.InvalidSelectorException
javax.jms.InvalidSelectorExceptionpublic void acknowledge(ConnectionContext context, MessageAck ack) throws java.lang.Exception
Subscriptionacknowledge in interface Subscriptionjava.io.IOExceptionjava.lang.Exceptionpublic boolean matches(MessageReference node, MessageEvaluationContext context) throws java.io.IOException
Subscriptionmatches in interface Subscriptionjava.io.IOExceptionpublic boolean matches(ActiveMQDestination destination)
Subscriptionmatches in interface Subscriptionpublic void add(ConnectionContext context, Destination destination) throws java.lang.Exception
Subscriptionadd in interface Subscriptionjava.lang.Exceptionpublic java.util.List<MessageReference> remove(ConnectionContext context, Destination destination) throws java.lang.Exception
Subscriptionremove in interface Subscriptionjava.lang.Exceptionpublic ConsumerInfo getConsumerInfo()
SubscriptiongetConsumerInfo in interface Subscriptionpublic void gc()
Subscriptiongc in interface Subscriptionpublic ConnectionContext getContext()
getContext in interface Subscriptionpublic ConsumerInfo getInfo()
public BooleanExpression getSelectorExpression()
public java.lang.String getSelector()
getSelector in interface Subscriptionpublic void setSelector(java.lang.String selector)
throws javax.jms.InvalidSelectorException
SubscriptionsetSelector in interface Subscriptionjavax.jms.InvalidSelectorExceptionpublic javax.management.ObjectName getObjectName()
getObjectName in interface Subscriptionpublic void setObjectName(javax.management.ObjectName objectName)
SubscriptionsetObjectName in interface Subscriptionpublic int getPrefetchSize()
getPrefetchSize in interface Subscriptionpublic 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, MessageReference message) throws java.lang.Exception
SubscriptionRecoveryaddRecoveredMessage in interface SubscriptionRecoveryjava.lang.Exceptionpublic ActiveMQDestination getActiveMQDestination()
getActiveMQDestination in interface SubscriptionRecoverypublic boolean isBrowser()
isBrowser 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(MessageReference node) throws java.io.IOException
unmatched in interface Subscriptionjava.io.IOExceptionprotected void doAddRecoveredMessage(MessageReference message) throws java.lang.Exception
java.lang.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 SubscriptionCopyright © 2005-2016 Red Hat, Inc.. All Rights Reserved.