public abstract class BaseDestination extends Object implements Destination
Modifier and Type | Field and Description |
---|---|
protected long |
blockedProducerWarningInterval |
protected Broker |
broker |
protected BrokerService |
brokerService |
protected int |
cursorMemoryHighWaterMark |
protected DeadLetterStrategy |
deadLetterStrategy |
static long |
DEFAULT_INACTIVE_TIMEOUT_BEFORE_GC |
protected ActiveMQDestination |
destination |
protected DestinationStatistics |
destinationStatistics |
static long |
EXPIRE_MESSAGE_PERIOD |
protected long |
expireMessagesPeriod |
static int |
MAX_AUDIT_DEPTH |
static int |
MAX_BROWSE_PAGE_SIZE |
static int |
MAX_PAGE_SIZE
The maximum number of messages to page in to the destination from
persistent storage
|
static int |
MAX_PRODUCERS_TO_AUDIT |
protected MemoryUsage |
memoryUsage |
protected Broker |
regionBroker |
protected Scheduler |
scheduler |
protected MessageStore |
store |
protected int |
storeUsageHighWaterMark |
protected SystemUsage |
systemUsage |
protected boolean |
warnOnProducerFlowControl |
DEFAULT_BLOCKED_PRODUCER_WARNING_INTERVAL, DEFAULT_DEAD_LETTER_STRATEGY
Constructor and Description |
---|
BaseDestination(BrokerService brokerService,
MessageStore store,
ActiveMQDestination destination,
DestinationStatistics parentStats) |
Modifier and Type | Method and Description |
---|---|
void |
addProducer(ConnectionContext context,
ProducerInfo info) |
void |
addSubscription(ConnectionContext context,
Subscription sub) |
boolean |
canGC() |
protected ConnectionContext |
createConnectionContext() |
void |
dispose(ConnectionContext context) |
void |
fastProducer(ConnectionContext context,
ProducerInfo producerInfo)
Called to notify a producer is too fast
|
ActiveMQDestination |
getActiveMQDestination() |
long |
getBlockedProducerWarningInterval() |
abstract List<Subscription> |
getConsumers() |
int |
getCursorMemoryHighWaterMark() |
DeadLetterStrategy |
getDeadLetterStrategy() |
protected long |
getDestinationSequenceId() |
DestinationStatistics |
getDestinationStatistics() |
long |
getExpireMessagesPeriod() |
long |
getInactiveTimoutBeforeGC() |
protected abstract org.slf4j.Logger |
getLog() |
int |
getMaxAuditDepth() |
int |
getMaxBrowsePageSize() |
int |
getMaxExpirePageSize() |
int |
getMaxPageSize() |
int |
getMaxProducersToAudit() |
MemoryUsage |
getMemoryUsage() |
MessageStore |
getMessageStore() |
int |
getMinimumMessageSize() |
String |
getName() |
int |
getOptimizeMessageStoreInFlightLimit() |
SlowConsumerStrategy |
getSlowConsumerStrategy() |
int |
getStoreUsageHighWaterMark() |
protected boolean |
hasRegularConsumers(List<Subscription> consumers) |
void |
initialize()
initialize the destination
|
boolean |
isActive() |
boolean |
isAdvisdoryForFastProducers() |
boolean |
isAdvisoryForConsumed() |
boolean |
isAdvisoryForDelivery() |
boolean |
isAdvisoryForDiscardingMessages() |
boolean |
isAdvisoryForSlowConsumers() |
boolean |
isAdvisoryWhenFull() |
boolean |
isAlwaysRetroactive() |
boolean |
isDisposed() |
boolean |
isDoOptimzeMessageStorage() |
boolean |
isEnableAudit() |
void |
isFull(ConnectionContext context,
Usage<?> usage)
Called when a Usage reaches a limit
|
boolean |
isGcIfInactive() |
boolean |
isGcWithNetworkConsumers() |
boolean |
isLazyDispatch() |
boolean |
isPrioritizedMessages() |
boolean |
isProducerFlowControl() |
protected boolean |
isReduceMemoryFootprint() |
boolean |
isSendAdvisoryIfNoConsumers() |
boolean |
isUseCache() |
void |
markForGC(long timeStamp) |
void |
messageConsumed(ConnectionContext context,
MessageReference messageReference)
called when message is consumed
|
void |
messageDelivered(ConnectionContext context,
MessageReference messageReference)
Called when message is delivered to the broker
|
void |
messageDiscarded(ConnectionContext context,
Subscription sub,
MessageReference messageReference)
Called when a message is discarded - e.g.
|
protected void |
onMessageWithNoConsumers(ConnectionContext context,
Message msg)
Provides a hook to allow messages with no consumer to be processed in
some way - such as to send to a dead letter queue or something..
|
void |
processDispatchNotification(MessageDispatchNotification messageDispatchNotification)
called on Queues in slave mode to allow dispatch to follow subscription
choice of master
|
void |
removeProducer(ConnectionContext context,
ProducerInfo info) |
void |
removeSubscription(ConnectionContext context,
Subscription sub,
long lastDeliveredSequenceId) |
void |
setAdvisdoryForFastProducers(boolean advisdoryForFastProducers) |
void |
setAdvisoryForConsumed(boolean advisoryForConsumed) |
void |
setAdvisoryForDelivery(boolean advisoryForDelivery) |
void |
setAdvisoryForDiscardingMessages(boolean advisoryForDiscardingMessages) |
void |
setAdvisoryForSlowConsumers(boolean advisoryForSlowConsumers) |
void |
setAdvisoryWhenFull(boolean advisoryWhenFull) |
void |
setAlwaysRetroactive(boolean alwaysRetroactive) |
void |
setBlockedProducerWarningInterval(long blockedProducerWarningInterval)
Set's the interval at which warnings about producers being blocked by
resource usage will be triggered.
|
void |
setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark) |
void |
setDeadLetterStrategy(DeadLetterStrategy deadLetterStrategy)
set the dead letter strategy
|
void |
setDoOptimzeMessageStorage(boolean doOptimzeMessageStorage) |
void |
setEnableAudit(boolean enableAudit) |
void |
setExpireMessagesPeriod(long expireMessagesPeriod) |
void |
setGcIfInactive(boolean gcIfInactive) |
void |
setGcWithNetworkConsumers(boolean gcWithNetworkConsumers)
Indicate if it is ok to gc destinations that have only network consumers
|
void |
setInactiveTimoutBeforeGC(long inactiveTimoutBeforeGC) |
void |
setLazyDispatch(boolean lazyDispatch)
set the lazy dispatch - default is false
|
void |
setMaxAuditDepth(int maxAuditDepth) |
void |
setMaxBrowsePageSize(int maxPageSize) |
void |
setMaxExpirePageSize(int maxPageSize) |
void |
setMaxPageSize(int maxPageSize) |
void |
setMaxProducersToAudit(int maxProducersToAudit) |
void |
setMinimumMessageSize(int minimumMessageSize) |
void |
setOptimizeMessageStoreInFlightLimit(int optimizeMessageStoreInFlightLimit) |
void |
setPrioritizedMessages(boolean prioritizedMessages) |
void |
setProducerFlowControl(boolean producerFlowControl) |
void |
setReduceMemoryFootprint(boolean reduceMemoryFootprint) |
void |
setSendAdvisoryIfNoConsumers(boolean sendAdvisoryIfNoConsumers) |
void |
setSlowConsumerStrategy(SlowConsumerStrategy slowConsumerStrategy) |
void |
setStoreUsageHighWaterMark(int storeUsageHighWaterMark) |
void |
setUseCache(boolean useCache) |
void |
slowConsumer(ConnectionContext context,
Subscription subs)
Called when there is a slow consumer
|
protected void |
waitForSpace(ConnectionContext context,
Usage<?> usage,
int highWaterMark,
String warning) |
protected void |
waitForSpace(ConnectionContext context,
Usage<?> usage,
String warning) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acknowledge, browse, gc, messageExpired, send, wakeup
public static final int MAX_PAGE_SIZE
public static final int MAX_BROWSE_PAGE_SIZE
public static final long EXPIRE_MESSAGE_PERIOD
public static final long DEFAULT_INACTIVE_TIMEOUT_BEFORE_GC
public static final int MAX_PRODUCERS_TO_AUDIT
public static final int MAX_AUDIT_DEPTH
protected final ActiveMQDestination destination
protected final Broker broker
protected final MessageStore store
protected SystemUsage systemUsage
protected MemoryUsage memoryUsage
protected boolean warnOnProducerFlowControl
protected long blockedProducerWarningInterval
protected final DestinationStatistics destinationStatistics
protected final BrokerService brokerService
protected final Broker regionBroker
protected DeadLetterStrategy deadLetterStrategy
protected long expireMessagesPeriod
protected int cursorMemoryHighWaterMark
protected int storeUsageHighWaterMark
protected final Scheduler scheduler
public BaseDestination(BrokerService brokerService, MessageStore store, ActiveMQDestination destination, DestinationStatistics parentStats) throws Exception
brokerService
- store
- destination
- parentStats
- Exception
public boolean isProducerFlowControl()
isProducerFlowControl
in interface Destination
public void setProducerFlowControl(boolean producerFlowControl)
setProducerFlowControl
in interface Destination
producerFlowControl
- the producerFlowControl to setpublic boolean isAlwaysRetroactive()
isAlwaysRetroactive
in interface Destination
public void setAlwaysRetroactive(boolean alwaysRetroactive)
setAlwaysRetroactive
in interface Destination
public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval)
setBlockedProducerWarningInterval
in interface Destination
blockedProducerWarningInterval
- the interval at which warning about
blocked producers will be triggered.public long getBlockedProducerWarningInterval()
getBlockedProducerWarningInterval
in interface Destination
public int getMaxProducersToAudit()
getMaxProducersToAudit
in interface Destination
public void setMaxProducersToAudit(int maxProducersToAudit)
setMaxProducersToAudit
in interface Destination
maxProducersToAudit
- the maxProducersToAudit to setpublic int getMaxAuditDepth()
getMaxAuditDepth
in interface Destination
public void setMaxAuditDepth(int maxAuditDepth)
setMaxAuditDepth
in interface Destination
maxAuditDepth
- the maxAuditDepth to setpublic boolean isEnableAudit()
isEnableAudit
in interface Destination
public void setEnableAudit(boolean enableAudit)
setEnableAudit
in interface Destination
enableAudit
- the enableAudit to setpublic void addProducer(ConnectionContext context, ProducerInfo info) throws Exception
addProducer
in interface Destination
Exception
public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception
removeProducer
in interface Destination
Exception
public void addSubscription(ConnectionContext context, Subscription sub) throws Exception
addSubscription
in interface Destination
Exception
public void removeSubscription(ConnectionContext context, Subscription sub, long lastDeliveredSequenceId) throws Exception
removeSubscription
in interface Destination
Exception
public final MemoryUsage getMemoryUsage()
getMemoryUsage
in interface Destination
public DestinationStatistics getDestinationStatistics()
getDestinationStatistics
in interface Destination
public ActiveMQDestination getActiveMQDestination()
getActiveMQDestination
in interface Destination
public final String getName()
getName
in interface Destination
public final MessageStore getMessageStore()
getMessageStore
in interface Destination
public boolean isActive()
isActive
in interface Destination
public int getMaxPageSize()
getMaxPageSize
in interface Destination
public void setMaxPageSize(int maxPageSize)
setMaxPageSize
in interface Destination
public int getMaxBrowsePageSize()
getMaxBrowsePageSize
in interface Destination
public void setMaxBrowsePageSize(int maxPageSize)
setMaxBrowsePageSize
in interface Destination
public int getMaxExpirePageSize()
public void setMaxExpirePageSize(int maxPageSize)
public void setExpireMessagesPeriod(long expireMessagesPeriod)
public long getExpireMessagesPeriod()
public boolean isUseCache()
isUseCache
in interface Destination
public void setUseCache(boolean useCache)
setUseCache
in interface Destination
public int getMinimumMessageSize()
getMinimumMessageSize
in interface Destination
public void setMinimumMessageSize(int minimumMessageSize)
setMinimumMessageSize
in interface Destination
public boolean isLazyDispatch()
isLazyDispatch
in interface Destination
public void setLazyDispatch(boolean lazyDispatch)
Destination
setLazyDispatch
in interface Destination
protected long getDestinationSequenceId()
public boolean isAdvisoryForSlowConsumers()
public void setAdvisoryForSlowConsumers(boolean advisoryForSlowConsumers)
advisoryForSlowConsumers
- the advisoryForSlowConsumers to setpublic boolean isAdvisoryForDiscardingMessages()
public void setAdvisoryForDiscardingMessages(boolean advisoryForDiscardingMessages)
advisoryForDiscardingMessages
- the advisoryForDiscardingMessages to
setpublic boolean isAdvisoryWhenFull()
public void setAdvisoryWhenFull(boolean advisoryWhenFull)
advisoryWhenFull
- the advisoryWhenFull to setpublic boolean isAdvisoryForDelivery()
public void setAdvisoryForDelivery(boolean advisoryForDelivery)
advisoryForDelivery
- the advisoryForDelivery to setpublic boolean isAdvisoryForConsumed()
public void setAdvisoryForConsumed(boolean advisoryForConsumed)
advisoryForConsumed
- the advisoryForConsumed to setpublic boolean isAdvisdoryForFastProducers()
public void setAdvisdoryForFastProducers(boolean advisdoryForFastProducers)
advisdoryForFastProducers
- the advisdoryForFastProducers to setpublic boolean isSendAdvisoryIfNoConsumers()
public void setSendAdvisoryIfNoConsumers(boolean sendAdvisoryIfNoConsumers)
public DeadLetterStrategy getDeadLetterStrategy()
getDeadLetterStrategy
in interface Destination
public void setDeadLetterStrategy(DeadLetterStrategy deadLetterStrategy)
deadLetterStrategy
- public int getCursorMemoryHighWaterMark()
getCursorMemoryHighWaterMark
in interface Destination
public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark)
setCursorMemoryHighWaterMark
in interface Destination
public void messageConsumed(ConnectionContext context, MessageReference messageReference)
messageConsumed
in interface Destination
context
- messageReference
- public void messageDelivered(ConnectionContext context, MessageReference messageReference)
messageDelivered
in interface Destination
context
- messageReference
- public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference)
messageDiscarded
in interface Destination
context
- messageReference
- public void slowConsumer(ConnectionContext context, Subscription subs)
slowConsumer
in interface Destination
context
- subs
- public void fastProducer(ConnectionContext context, ProducerInfo producerInfo)
fastProducer
in interface Destination
context
- producerInfo
- public void isFull(ConnectionContext context, Usage<?> usage)
isFull
in interface Destination
context
- usage
- public void dispose(ConnectionContext context) throws IOException
dispose
in interface Destination
IOException
public boolean isDisposed()
isDisposed
in interface Destination
protected void onMessageWithNoConsumers(ConnectionContext context, Message msg) throws Exception
Exception
public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception
Destination
processDispatchNotification
in interface Destination
Exception
public final int getStoreUsageHighWaterMark()
public void setStoreUsageHighWaterMark(int storeUsageHighWaterMark)
protected final void waitForSpace(ConnectionContext context, Usage<?> usage, String warning) throws IOException, InterruptedException, javax.jms.ResourceAllocationException
IOException
InterruptedException
javax.jms.ResourceAllocationException
protected final void waitForSpace(ConnectionContext context, Usage<?> usage, int highWaterMark, String warning) throws IOException, InterruptedException, javax.jms.ResourceAllocationException
IOException
InterruptedException
javax.jms.ResourceAllocationException
protected abstract org.slf4j.Logger getLog()
public void setSlowConsumerStrategy(SlowConsumerStrategy slowConsumerStrategy)
public SlowConsumerStrategy getSlowConsumerStrategy()
getSlowConsumerStrategy
in interface Destination
public boolean isPrioritizedMessages()
isPrioritizedMessages
in interface Destination
public void setPrioritizedMessages(boolean prioritizedMessages)
public long getInactiveTimoutBeforeGC()
getInactiveTimoutBeforeGC
in interface Destination
public void setInactiveTimoutBeforeGC(long inactiveTimoutBeforeGC)
inactiveTimoutBeforeGC
- the inactiveTimoutBeforeGC to setpublic boolean isGcIfInactive()
public void setGcIfInactive(boolean gcIfInactive)
gcIfInactive
- the gcIfInactive to setpublic void setGcWithNetworkConsumers(boolean gcWithNetworkConsumers)
gcWithNetworkConsumers
- public boolean isGcWithNetworkConsumers()
public void markForGC(long timeStamp)
markForGC
in interface Destination
public boolean canGC()
canGC
in interface Destination
public void setReduceMemoryFootprint(boolean reduceMemoryFootprint)
protected boolean isReduceMemoryFootprint()
public boolean isDoOptimzeMessageStorage()
isDoOptimzeMessageStorage
in interface Destination
public void setDoOptimzeMessageStorage(boolean doOptimzeMessageStorage)
setDoOptimzeMessageStorage
in interface Destination
public int getOptimizeMessageStoreInFlightLimit()
public void setOptimizeMessageStoreInFlightLimit(int optimizeMessageStoreInFlightLimit)
public abstract List<Subscription> getConsumers()
getConsumers
in interface Destination
protected boolean hasRegularConsumers(List<Subscription> consumers)
protected ConnectionContext createConnectionContext()
Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.