public abstract class AbstractSubscription extends Object implements Subscription
Modifier and Type | Field and Description |
---|---|
protected Broker |
broker |
protected ConnectionContext |
context |
protected DestinationFilter |
destinationFilter |
protected CopyOnWriteArrayList<Destination> |
destinations |
protected ConsumerInfo |
info |
Constructor and Description |
---|
AbstractSubscription(Broker broker,
ConnectionContext context,
ConsumerInfo info) |
Modifier and Type | Method and Description |
---|---|
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() |
ConsumerInfo |
getConsumerInfo()
The ConsumerInfo object that created the subscription.
|
ConnectionContext |
getContext() |
int |
getCursorMemoryHighWaterMark() |
int |
getInFlightUsage() |
ConsumerInfo |
getInfo() |
ObjectName |
getObjectName() |
int |
getPrefetchSize() |
String |
getSelector() |
BooleanExpression |
getSelectorExpression() |
boolean |
isBrowser() |
boolean |
isRecoveryRequired()
Informs the Broker if the subscription needs to intervention to recover it's state
e.g.
|
boolean |
isSlave() |
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?
|
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 |
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 |
unmatched(MessageReference node) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acknowledge, add, destroy, getDequeueCounter, getDispatchedCounter, getDispatchedQueueSize, getEnqueueCounter, getInFlightSize, getPendingQueueSize, isFull, isHighWaterMark, isLowWaterMark, processMessageDispatchNotification, pullMessage, updateConsumerPrefetch
protected Broker broker
protected ConnectionContext context
protected ConsumerInfo info
protected final DestinationFilter destinationFilter
protected final CopyOnWriteArrayList<Destination> destinations
public AbstractSubscription(Broker broker, ConnectionContext context, ConsumerInfo info) throws javax.jms.InvalidSelectorException
javax.jms.InvalidSelectorException
public boolean matches(MessageReference node, MessageEvaluationContext context) throws IOException
Subscription
matches
in interface Subscription
IOException
public boolean matches(ActiveMQDestination destination)
Subscription
matches
in interface Subscription
public void add(ConnectionContext context, Destination destination) throws Exception
Subscription
add
in interface Subscription
Exception
public List<MessageReference> remove(ConnectionContext context, Destination destination) throws Exception
Subscription
remove
in interface Subscription
Exception
public ConsumerInfo getConsumerInfo()
Subscription
getConsumerInfo
in interface Subscription
public void gc()
Subscription
gc
in interface Subscription
public boolean isSlave()
isSlave
in interface Subscription
public ConnectionContext getContext()
getContext
in interface Subscription
public ConsumerInfo getInfo()
public BooleanExpression getSelectorExpression()
public String getSelector()
getSelector
in interface Subscription
public void setSelector(String selector) throws javax.jms.InvalidSelectorException
Subscription
setSelector
in interface Subscription
javax.jms.InvalidSelectorException
public ObjectName getObjectName()
getObjectName
in interface Subscription
public void setObjectName(ObjectName objectName)
Subscription
setObjectName
in interface Subscription
public int getPrefetchSize()
getPrefetchSize
in interface Subscription
public void setPrefetchSize(int newSize)
public boolean isRecoveryRequired()
Subscription
isRecoveryRequired
in interface Subscription
org.apache.activemq.region.cursors.PendingMessageCursor
public boolean isSlowConsumer()
isSlowConsumer
in interface Subscription
public void setSlowConsumer(boolean val)
public boolean addRecoveredMessage(ConnectionContext context, MessageReference message) throws Exception
SubscriptionRecovery
addRecoveredMessage
in interface SubscriptionRecovery
Exception
public ActiveMQDestination getActiveMQDestination()
getActiveMQDestination
in interface SubscriptionRecovery
public boolean isBrowser()
isBrowser
in interface Subscription
public int getInFlightUsage()
getInFlightUsage
in interface Subscription
public void addDestination(Destination destination)
destination
- public void removeDestination(Destination destination)
destination
- public int getCursorMemoryHighWaterMark()
getCursorMemoryHighWaterMark
in interface Subscription
public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark)
setCursorMemoryHighWaterMark
in interface Subscription
public int countBeforeFull()
countBeforeFull
in interface Subscription
public void unmatched(MessageReference node) throws IOException
unmatched
in interface Subscription
IOException
protected void doAddRecoveredMessage(MessageReference message) throws Exception
Exception
Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.