001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.activemq.broker.region.policy;
018
019import org.apache.activemq.ActiveMQPrefetchPolicy;
020import org.apache.activemq.broker.Broker;
021import org.apache.activemq.broker.region.BaseDestination;
022import org.apache.activemq.broker.region.Destination;
023import org.apache.activemq.broker.region.DurableTopicSubscription;
024import org.apache.activemq.broker.region.Queue;
025import org.apache.activemq.broker.region.QueueBrowserSubscription;
026import org.apache.activemq.broker.region.QueueSubscription;
027import org.apache.activemq.broker.region.Topic;
028import org.apache.activemq.broker.region.TopicSubscription;
029import org.apache.activemq.broker.region.cursors.PendingMessageCursor;
030import org.apache.activemq.broker.region.group.MessageGroupHashBucketFactory;
031import org.apache.activemq.broker.region.group.MessageGroupMapFactory;
032import org.apache.activemq.filter.DestinationMapEntry;
033import org.apache.activemq.usage.SystemUsage;
034import org.slf4j.Logger;
035import org.slf4j.LoggerFactory;
036
037/**
038 * Represents an entry in a {@link PolicyMap} for assigning policies to a
039 * specific destination or a hierarchical wildcard area of destinations.
040 * 
041 * @org.apache.xbean.XBean
042 * 
043 */
044public class PolicyEntry extends DestinationMapEntry {
045
046    private static final Logger LOG = LoggerFactory.getLogger(PolicyEntry.class);
047    private DispatchPolicy dispatchPolicy;
048    private SubscriptionRecoveryPolicy subscriptionRecoveryPolicy;
049    private boolean sendAdvisoryIfNoConsumers;
050    private DeadLetterStrategy deadLetterStrategy = Destination.DEFAULT_DEAD_LETTER_STRATEGY;
051    private PendingMessageLimitStrategy pendingMessageLimitStrategy;
052    private MessageEvictionStrategy messageEvictionStrategy;
053    private long memoryLimit;
054    private MessageGroupMapFactory messageGroupMapFactory;
055    private PendingQueueMessageStoragePolicy pendingQueuePolicy;
056    private PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy;
057    private PendingSubscriberMessageStoragePolicy pendingSubscriberPolicy;
058    private int maxProducersToAudit=BaseDestination.MAX_PRODUCERS_TO_AUDIT;
059    private int maxAuditDepth=BaseDestination.MAX_AUDIT_DEPTH;
060    private int maxQueueAuditDepth=BaseDestination.MAX_AUDIT_DEPTH;
061    private boolean enableAudit=true;
062    private boolean producerFlowControl = true;
063    private long blockedProducerWarningInterval = Destination.DEFAULT_BLOCKED_PRODUCER_WARNING_INTERVAL;
064    private boolean optimizedDispatch=false;
065    private int maxPageSize=BaseDestination.MAX_PAGE_SIZE;
066    private int maxBrowsePageSize=BaseDestination.MAX_BROWSE_PAGE_SIZE;
067    private boolean useCache=true;
068    private long minimumMessageSize=1024;
069    private boolean useConsumerPriority=true;
070    private boolean strictOrderDispatch=false;
071    private boolean lazyDispatch=false;
072    private int timeBeforeDispatchStarts = 0;
073    private int consumersBeforeDispatchStarts = 0;
074    private boolean advisoryForSlowConsumers;
075    private boolean advisdoryForFastProducers;
076    private boolean advisoryForDiscardingMessages;
077    private boolean advisoryWhenFull;
078    private boolean advisoryForDelivery;
079    private boolean advisoryForConsumed;
080    private long expireMessagesPeriod = BaseDestination.EXPIRE_MESSAGE_PERIOD;
081    private int maxExpirePageSize = BaseDestination.MAX_BROWSE_PAGE_SIZE;
082    private int queuePrefetch=ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH;
083    private int queueBrowserPrefetch=ActiveMQPrefetchPolicy.DEFAULT_QUEUE_BROWSER_PREFETCH;
084    private int topicPrefetch=ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH;
085    private int durableTopicPrefetch=ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH;
086    private boolean usePrefetchExtension = true;
087    private int cursorMemoryHighWaterMark = 70;
088    private int storeUsageHighWaterMark = 100;
089    private SlowConsumerStrategy slowConsumerStrategy;
090    private boolean prioritizedMessages;
091    private boolean allConsumersExclusiveByDefault;
092    private boolean gcInactiveDestinations;
093    private long inactiveTimoutBeforeGC = BaseDestination.DEFAULT_INACTIVE_TIMEOUT_BEFORE_GC;
094    private boolean reduceMemoryFootprint;
095    
096   
097    public void configure(Broker broker,Queue queue) {
098        baseConfiguration(broker,queue);
099        if (dispatchPolicy != null) {
100            queue.setDispatchPolicy(dispatchPolicy);
101        }
102        queue.setDeadLetterStrategy(getDeadLetterStrategy());
103        queue.setMessageGroupMapFactory(getMessageGroupMapFactory());
104        if (memoryLimit > 0) {
105            queue.getMemoryUsage().setLimit(memoryLimit);
106        }
107        if (pendingQueuePolicy != null) {
108            PendingMessageCursor messages = pendingQueuePolicy.getQueuePendingMessageCursor(broker,queue);
109            queue.setMessages(messages);
110        }
111        
112        queue.setUseConsumerPriority(isUseConsumerPriority());
113        queue.setStrictOrderDispatch(isStrictOrderDispatch());
114        queue.setOptimizedDispatch(isOptimizedDispatch());
115        queue.setLazyDispatch(isLazyDispatch());
116        queue.setTimeBeforeDispatchStarts(getTimeBeforeDispatchStarts());
117        queue.setConsumersBeforeDispatchStarts(getConsumersBeforeDispatchStarts());
118        queue.setAllConsumersExclusiveByDefault(isAllConsumersExclusiveByDefault());
119    }
120
121    public void configure(Broker broker,Topic topic) {
122        baseConfiguration(broker,topic);
123        if (dispatchPolicy != null) {
124            topic.setDispatchPolicy(dispatchPolicy);
125        }
126        topic.setDeadLetterStrategy(getDeadLetterStrategy());
127        if (subscriptionRecoveryPolicy != null) {
128            SubscriptionRecoveryPolicy srp = subscriptionRecoveryPolicy.copy();
129            srp.setBroker(broker);
130            topic.setSubscriptionRecoveryPolicy(srp);
131        }
132        if (memoryLimit > 0) {
133            topic.getMemoryUsage().setLimit(memoryLimit);
134        }
135        topic.setLazyDispatch(isLazyDispatch());
136    }
137    
138    public void baseConfiguration(Broker broker,BaseDestination destination) {
139        destination.setProducerFlowControl(isProducerFlowControl());
140        destination.setBlockedProducerWarningInterval(getBlockedProducerWarningInterval());
141        destination.setEnableAudit(isEnableAudit());
142        destination.setMaxAuditDepth(getMaxQueueAuditDepth());
143        destination.setMaxProducersToAudit(getMaxProducersToAudit());
144        destination.setMaxPageSize(getMaxPageSize());
145        destination.setMaxBrowsePageSize(getMaxBrowsePageSize());
146        destination.setUseCache(isUseCache());
147        destination.setMinimumMessageSize((int) getMinimumMessageSize());
148        destination.setAdvisoryForConsumed(isAdvisoryForConsumed());
149        destination.setAdvisoryForDelivery(isAdvisoryForDelivery());
150        destination.setAdvisoryForDiscardingMessages(isAdvisoryForDiscardingMessages());
151        destination.setAdvisoryForSlowConsumers(isAdvisoryForSlowConsumers());
152        destination.setAdvisdoryForFastProducers(isAdvisdoryForFastProducers());
153        destination.setAdvisoryWhenFull(isAdvisoryWhenFull());
154        destination.setSendAdvisoryIfNoConsumers(sendAdvisoryIfNoConsumers);
155        destination.setExpireMessagesPeriod(getExpireMessagesPeriod());
156        destination.setMaxExpirePageSize(getMaxExpirePageSize());
157        destination.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark());
158        destination.setStoreUsageHighWaterMark(getStoreUsageHighWaterMark());
159        SlowConsumerStrategy scs = getSlowConsumerStrategy();
160        if (scs != null) {
161            scs.setBrokerService(broker);
162        }
163        destination.setSlowConsumerStrategy(scs);
164        destination.setPrioritizedMessages(isPrioritizedMessages());
165        destination.setGcIfInactive(isGcInactiveDestinations());
166        destination.setInactiveTimoutBeforeGC(getInactiveTimoutBeforeGC());
167        destination.setReduceMemoryFootprint(isReduceMemoryFootprint());
168    }
169
170    public void configure(Broker broker, SystemUsage memoryManager, TopicSubscription subscription) {
171        //override prefetch size if not set by the Consumer
172        int prefetch=subscription.getConsumerInfo().getPrefetchSize();
173        if (prefetch == ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH){
174            subscription.getConsumerInfo().setPrefetchSize(getTopicPrefetch());
175        }
176        if (pendingMessageLimitStrategy != null) {
177            int value = pendingMessageLimitStrategy.getMaximumPendingMessageLimit(subscription);
178            int consumerLimit = subscription.getInfo().getMaximumPendingMessageLimit();
179            if (consumerLimit > 0) {
180                if (value < 0 || consumerLimit < value) {
181                    value = consumerLimit;
182                }
183            }
184            if (value >= 0) {
185                if (LOG.isDebugEnabled()) {
186                    LOG.debug("Setting the maximumPendingMessages size to: " + value + " for consumer: " + subscription.getInfo().getConsumerId());
187                }
188                subscription.setMaximumPendingMessages(value);
189            }
190        }
191        if (messageEvictionStrategy != null) {
192            subscription.setMessageEvictionStrategy(messageEvictionStrategy);
193        }
194        if (pendingSubscriberPolicy != null) {
195            String name = subscription.getContext().getClientId() + "_" + subscription.getConsumerInfo().getConsumerId();
196            int maxBatchSize = subscription.getConsumerInfo().getPrefetchSize();
197            subscription.setMatched(pendingSubscriberPolicy.getSubscriberPendingMessageCursor(broker,name, maxBatchSize,subscription));
198        }
199        if (enableAudit) {
200            subscription.setEnableAudit(enableAudit);
201            subscription.setMaxProducersToAudit(maxProducersToAudit);
202            subscription.setMaxAuditDepth(maxAuditDepth);
203        }
204    }
205
206    public void configure(Broker broker, SystemUsage memoryManager, DurableTopicSubscription sub) {
207        String clientId = sub.getSubscriptionKey().getClientId();
208        String subName = sub.getSubscriptionKey().getSubscriptionName();
209        int prefetch = sub.getPrefetchSize();
210        sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark());
211        //override prefetch size if not set by the Consumer
212        if (prefetch == ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH || prefetch == ActiveMQPrefetchPolicy.DEFAULT_OPTIMIZE_DURABLE_TOPIC_PREFETCH){
213            sub.setPrefetchSize(getDurableTopicPrefetch());
214        }
215        if (pendingDurableSubscriberPolicy != null) {
216            PendingMessageCursor cursor = pendingDurableSubscriberPolicy.getSubscriberPendingMessageCursor(broker,clientId, subName,sub.getPrefetchSize(),sub);
217            cursor.setSystemUsage(memoryManager);
218            sub.setPending(cursor);
219        }
220        int auditDepth = getMaxAuditDepth();
221        if (auditDepth == BaseDestination.MAX_AUDIT_DEPTH && this.isPrioritizedMessages()) {
222            sub.setMaxAuditDepth(auditDepth * 10);
223        } else {
224            sub.setMaxAuditDepth(auditDepth);
225        }
226        sub.setMaxProducersToAudit(getMaxProducersToAudit());
227        sub.setUsePrefetchExtension(isUsePrefetchExtension());        
228    }
229    
230    public void configure(Broker broker, SystemUsage memoryManager, QueueBrowserSubscription sub) {
231       
232        int prefetch = sub.getPrefetchSize();
233        //override prefetch size if not set by the Consumer
234        
235        if (prefetch == ActiveMQPrefetchPolicy.DEFAULT_QUEUE_BROWSER_PREFETCH){
236            sub.setPrefetchSize(getQueueBrowserPrefetch());
237        }
238        sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark());
239        sub.setUsePrefetchExtension(isUsePrefetchExtension());
240    }
241    
242    public void configure(Broker broker, SystemUsage memoryManager, QueueSubscription sub) {
243        
244        int prefetch = sub.getPrefetchSize();
245        //override prefetch size if not set by the Consumer
246        
247        if (prefetch == ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH){
248            sub.setPrefetchSize(getQueuePrefetch());
249        }
250        sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark());
251        sub.setUsePrefetchExtension(isUsePrefetchExtension());
252    }
253
254    // Properties
255    // -------------------------------------------------------------------------
256    public DispatchPolicy getDispatchPolicy() {
257        return dispatchPolicy;
258    }
259
260    public void setDispatchPolicy(DispatchPolicy policy) {
261        this.dispatchPolicy = policy;
262    }
263
264    public SubscriptionRecoveryPolicy getSubscriptionRecoveryPolicy() {
265        return subscriptionRecoveryPolicy;
266    }
267
268    public void setSubscriptionRecoveryPolicy(SubscriptionRecoveryPolicy subscriptionRecoveryPolicy) {
269        this.subscriptionRecoveryPolicy = subscriptionRecoveryPolicy;
270    }
271
272    public boolean isSendAdvisoryIfNoConsumers() {
273        return sendAdvisoryIfNoConsumers;
274    }
275
276    /**
277     * Sends an advisory message if a non-persistent message is sent and there
278     * are no active consumers
279     */
280    public void setSendAdvisoryIfNoConsumers(boolean sendAdvisoryIfNoConsumers) {
281        this.sendAdvisoryIfNoConsumers = sendAdvisoryIfNoConsumers;
282    }
283
284    public DeadLetterStrategy getDeadLetterStrategy() {
285        return deadLetterStrategy;
286    }
287
288    /**
289     * Sets the policy used to determine which dead letter queue destination
290     * should be used
291     */
292    public void setDeadLetterStrategy(DeadLetterStrategy deadLetterStrategy) {
293        this.deadLetterStrategy = deadLetterStrategy;
294    }
295
296    public PendingMessageLimitStrategy getPendingMessageLimitStrategy() {
297        return pendingMessageLimitStrategy;
298    }
299
300    /**
301     * Sets the strategy to calculate the maximum number of messages that are
302     * allowed to be pending on consumers (in addition to their prefetch sizes).
303     * Once the limit is reached, non-durable topics can then start discarding
304     * old messages. This allows us to keep dispatching messages to slow
305     * consumers while not blocking fast consumers and discarding the messages
306     * oldest first.
307     */
308    public void setPendingMessageLimitStrategy(PendingMessageLimitStrategy pendingMessageLimitStrategy) {
309        this.pendingMessageLimitStrategy = pendingMessageLimitStrategy;
310    }
311
312    public MessageEvictionStrategy getMessageEvictionStrategy() {
313        return messageEvictionStrategy;
314    }
315
316    /**
317     * Sets the eviction strategy used to decide which message to evict when the
318     * slow consumer needs to discard messages
319     */
320    public void setMessageEvictionStrategy(MessageEvictionStrategy messageEvictionStrategy) {
321        this.messageEvictionStrategy = messageEvictionStrategy;
322    }
323
324    public long getMemoryLimit() {
325        return memoryLimit;
326    }
327
328    /**
329     * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
330     * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
331     */
332    public void setMemoryLimit(long memoryLimit) {
333        this.memoryLimit = memoryLimit;
334    }
335
336    public MessageGroupMapFactory getMessageGroupMapFactory() {
337        if (messageGroupMapFactory == null) {
338            messageGroupMapFactory = new MessageGroupHashBucketFactory();
339        }
340        return messageGroupMapFactory;
341    }
342
343    /**
344     * Sets the factory used to create new instances of {MessageGroupMap} used
345     * to implement the <a
346     * href="http://activemq.apache.org/message-groups.html">Message Groups</a>
347     * functionality.
348     */
349    public void setMessageGroupMapFactory(MessageGroupMapFactory messageGroupMapFactory) {
350        this.messageGroupMapFactory = messageGroupMapFactory;
351    }
352
353    /**
354     * @return the pendingDurableSubscriberPolicy
355     */
356    public PendingDurableSubscriberMessageStoragePolicy getPendingDurableSubscriberPolicy() {
357        return this.pendingDurableSubscriberPolicy;
358    }
359
360    /**
361     * @param pendingDurableSubscriberPolicy the pendingDurableSubscriberPolicy
362     *                to set
363     */
364    public void setPendingDurableSubscriberPolicy(PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy) {
365        this.pendingDurableSubscriberPolicy = pendingDurableSubscriberPolicy;
366    }
367
368    /**
369     * @return the pendingQueuePolicy
370     */
371    public PendingQueueMessageStoragePolicy getPendingQueuePolicy() {
372        return this.pendingQueuePolicy;
373    }
374
375    /**
376     * @param pendingQueuePolicy the pendingQueuePolicy to set
377     */
378    public void setPendingQueuePolicy(PendingQueueMessageStoragePolicy pendingQueuePolicy) {
379        this.pendingQueuePolicy = pendingQueuePolicy;
380    }
381
382    /**
383     * @return the pendingSubscriberPolicy
384     */
385    public PendingSubscriberMessageStoragePolicy getPendingSubscriberPolicy() {
386        return this.pendingSubscriberPolicy;
387    }
388
389    /**
390     * @param pendingSubscriberPolicy the pendingSubscriberPolicy to set
391     */
392    public void setPendingSubscriberPolicy(PendingSubscriberMessageStoragePolicy pendingSubscriberPolicy) {
393        this.pendingSubscriberPolicy = pendingSubscriberPolicy;
394    }
395
396    /**
397     * @return true if producer flow control enabled
398     */
399    public boolean isProducerFlowControl() {
400        return producerFlowControl;
401    }
402
403    /**
404     * @param producerFlowControl
405     */
406    public void setProducerFlowControl(boolean producerFlowControl) {
407        this.producerFlowControl = producerFlowControl;
408    }
409
410    /**
411     * Set's the interval at which warnings about producers being blocked by
412     * resource usage will be triggered. Values of 0 or less will disable
413     * warnings
414     * 
415     * @param blockedProducerWarningInterval the interval at which warning about
416     *            blocked producers will be triggered.
417     */
418    public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval) {
419        this.blockedProducerWarningInterval = blockedProducerWarningInterval;
420    }
421
422    /**
423     * 
424     * @return the interval at which warning about blocked producers will be
425     *         triggered.
426     */
427    public long getBlockedProducerWarningInterval() {
428        return blockedProducerWarningInterval;
429    }
430    
431    /**
432     * @return the maxProducersToAudit
433     */
434    public int getMaxProducersToAudit() {
435        return maxProducersToAudit;
436    }
437
438    /**
439     * @param maxProducersToAudit the maxProducersToAudit to set
440     */
441    public void setMaxProducersToAudit(int maxProducersToAudit) {
442        this.maxProducersToAudit = maxProducersToAudit;
443    }
444
445    /**
446     * @return the maxAuditDepth
447     */
448    public int getMaxAuditDepth() {
449        return maxAuditDepth;
450    }
451
452    /**
453     * @param maxAuditDepth the maxAuditDepth to set
454     */
455    public void setMaxAuditDepth(int maxAuditDepth) {
456        this.maxAuditDepth = maxAuditDepth;
457    }
458
459    /**
460     * @return the enableAudit
461     */
462    public boolean isEnableAudit() {
463        return enableAudit;
464    }
465
466    /**
467     * @param enableAudit the enableAudit to set
468     */
469    public void setEnableAudit(boolean enableAudit) {
470        this.enableAudit = enableAudit;
471    }
472
473    public int getMaxQueueAuditDepth() {
474        return maxQueueAuditDepth;
475    }
476
477    public void setMaxQueueAuditDepth(int maxQueueAuditDepth) {
478        this.maxQueueAuditDepth = maxQueueAuditDepth;
479    }
480
481    public boolean isOptimizedDispatch() {
482        return optimizedDispatch;
483    }
484
485    public void setOptimizedDispatch(boolean optimizedDispatch) {
486        this.optimizedDispatch = optimizedDispatch;
487    }
488    
489    public int getMaxPageSize() {
490        return maxPageSize;
491    }
492
493    public void setMaxPageSize(int maxPageSize) {
494        this.maxPageSize = maxPageSize;
495    } 
496    
497    public int getMaxBrowsePageSize() {
498        return maxBrowsePageSize;
499    }
500
501    public void setMaxBrowsePageSize(int maxPageSize) {
502        this.maxBrowsePageSize = maxPageSize;
503    } 
504    
505    public boolean isUseCache() {
506        return useCache;
507    }
508
509    public void setUseCache(boolean useCache) {
510        this.useCache = useCache;
511    }
512
513    public long getMinimumMessageSize() {
514        return minimumMessageSize;
515    }
516
517    public void setMinimumMessageSize(long minimumMessageSize) {
518        this.minimumMessageSize = minimumMessageSize;
519    }   
520    
521    public boolean isUseConsumerPriority() {
522        return useConsumerPriority;
523    }
524
525    public void setUseConsumerPriority(boolean useConsumerPriority) {
526        this.useConsumerPriority = useConsumerPriority;
527    }
528
529    public boolean isStrictOrderDispatch() {
530        return strictOrderDispatch;
531    }
532
533    public void setStrictOrderDispatch(boolean strictOrderDispatch) {
534        this.strictOrderDispatch = strictOrderDispatch;
535    }
536
537    public boolean isLazyDispatch() {
538        return lazyDispatch;
539    }
540
541    public void setLazyDispatch(boolean lazyDispatch) {
542        this.lazyDispatch = lazyDispatch;
543    }
544
545    public int getTimeBeforeDispatchStarts() {
546        return timeBeforeDispatchStarts;
547    }
548
549    public void setTimeBeforeDispatchStarts(int timeBeforeDispatchStarts) {
550        this.timeBeforeDispatchStarts = timeBeforeDispatchStarts;
551    }
552
553    public int getConsumersBeforeDispatchStarts() {
554        return consumersBeforeDispatchStarts;
555    }
556
557    public void setConsumersBeforeDispatchStarts(int consumersBeforeDispatchStarts) {
558        this.consumersBeforeDispatchStarts = consumersBeforeDispatchStarts;
559    }
560
561    /**
562     * @return the advisoryForSlowConsumers
563     */
564    public boolean isAdvisoryForSlowConsumers() {
565        return advisoryForSlowConsumers;
566    }
567
568    /**
569     * @param advisoryForSlowConsumers the advisoryForSlowConsumers to set
570     */
571    public void setAdvisoryForSlowConsumers(boolean advisoryForSlowConsumers) {
572        this.advisoryForSlowConsumers = advisoryForSlowConsumers;
573    }
574
575    /**
576     * @return the advisoryForDiscardingMessages
577     */
578    public boolean isAdvisoryForDiscardingMessages() {
579        return advisoryForDiscardingMessages;
580    }
581
582    /**
583     * @param advisoryForDiscardingMessages the advisoryForDiscardingMessages to set
584     */
585    public void setAdvisoryForDiscardingMessages(
586            boolean advisoryForDiscardingMessages) {
587        this.advisoryForDiscardingMessages = advisoryForDiscardingMessages;
588    }
589
590    /**
591     * @return the advisoryWhenFull
592     */
593    public boolean isAdvisoryWhenFull() {
594        return advisoryWhenFull;
595    }
596
597    /**
598     * @param advisoryWhenFull the advisoryWhenFull to set
599     */
600    public void setAdvisoryWhenFull(boolean advisoryWhenFull) {
601        this.advisoryWhenFull = advisoryWhenFull;
602    }
603
604    /**
605     * @return the advisoryForDelivery
606     */
607    public boolean isAdvisoryForDelivery() {
608        return advisoryForDelivery;
609    }
610
611    /**
612     * @param advisoryForDelivery the advisoryForDelivery to set
613     */
614    public void setAdvisoryForDelivery(boolean advisoryForDelivery) {
615        this.advisoryForDelivery = advisoryForDelivery;
616    }
617
618    /**
619     * @return the advisoryForConsumed
620     */
621    public boolean isAdvisoryForConsumed() {
622        return advisoryForConsumed;
623    }
624
625    /**
626     * @param advisoryForConsumed the advisoryForConsumed to set
627     */
628    public void setAdvisoryForConsumed(boolean advisoryForConsumed) {
629        this.advisoryForConsumed = advisoryForConsumed;
630    }
631    
632    /**
633     * @return the advisdoryForFastProducers
634     */
635    public boolean isAdvisdoryForFastProducers() {
636        return advisdoryForFastProducers;
637    }
638
639    /**
640     * @param advisdoryForFastProducers the advisdoryForFastProducers to set
641     */
642    public void setAdvisdoryForFastProducers(boolean advisdoryForFastProducers) {
643        this.advisdoryForFastProducers = advisdoryForFastProducers;
644    }
645
646    public void setMaxExpirePageSize(int maxExpirePageSize) {
647        this.maxExpirePageSize = maxExpirePageSize;
648    }
649    
650    public int getMaxExpirePageSize() {
651        return maxExpirePageSize;
652    }
653    
654    public void setExpireMessagesPeriod(long expireMessagesPeriod) {
655        this.expireMessagesPeriod = expireMessagesPeriod;
656    }
657    
658    public long getExpireMessagesPeriod() {
659        return expireMessagesPeriod;
660    }
661
662    /**
663     * Get the queuePrefetch
664     * @return the queuePrefetch
665     */
666    public int getQueuePrefetch() {
667        return this.queuePrefetch;
668    }
669
670    /**
671     * Set the queuePrefetch
672     * @param queuePrefetch the queuePrefetch to set
673     */
674    public void setQueuePrefetch(int queuePrefetch) {
675        this.queuePrefetch = queuePrefetch;
676    }
677
678    /**
679     * Get the queueBrowserPrefetch
680     * @return the queueBrowserPrefetch
681     */
682    public int getQueueBrowserPrefetch() {
683        return this.queueBrowserPrefetch;
684    }
685
686    /**
687     * Set the queueBrowserPrefetch
688     * @param queueBrowserPrefetch the queueBrowserPrefetch to set
689     */
690    public void setQueueBrowserPrefetch(int queueBrowserPrefetch) {
691        this.queueBrowserPrefetch = queueBrowserPrefetch;
692    }
693
694    /**
695     * Get the topicPrefetch
696     * @return the topicPrefetch
697     */
698    public int getTopicPrefetch() {
699        return this.topicPrefetch;
700    }
701
702    /**
703     * Set the topicPrefetch
704     * @param topicPrefetch the topicPrefetch to set
705     */
706    public void setTopicPrefetch(int topicPrefetch) {
707        this.topicPrefetch = topicPrefetch;
708    }
709
710    /**
711     * Get the durableTopicPrefetch
712     * @return the durableTopicPrefetch
713     */
714    public int getDurableTopicPrefetch() {
715        return this.durableTopicPrefetch;
716    }
717
718    /**
719     * Set the durableTopicPrefetch
720     * @param durableTopicPrefetch the durableTopicPrefetch to set
721     */
722    public void setDurableTopicPrefetch(int durableTopicPrefetch) {
723        this.durableTopicPrefetch = durableTopicPrefetch;
724    }
725    
726    public boolean isUsePrefetchExtension() {
727        return this.usePrefetchExtension;
728    }
729
730    public void setUsePrefetchExtension(boolean usePrefetchExtension) {
731        this.usePrefetchExtension = usePrefetchExtension;
732    }
733    
734    public int getCursorMemoryHighWaterMark() {
735        return this.cursorMemoryHighWaterMark;
736    }
737
738    public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark) {
739        this.cursorMemoryHighWaterMark = cursorMemoryHighWaterMark;
740        }
741
742    public void setStoreUsageHighWaterMark(int storeUsageHighWaterMark) {
743        this.storeUsageHighWaterMark = storeUsageHighWaterMark;   
744    }
745
746    public int getStoreUsageHighWaterMark() {
747        return storeUsageHighWaterMark;
748    }
749
750    public void setSlowConsumerStrategy(SlowConsumerStrategy slowConsumerStrategy) {
751        this.slowConsumerStrategy = slowConsumerStrategy;
752    }
753    
754    public SlowConsumerStrategy getSlowConsumerStrategy() {
755        return this.slowConsumerStrategy;
756    }
757    
758    
759    public boolean isPrioritizedMessages() {
760        return this.prioritizedMessages;
761    }
762
763    public void setPrioritizedMessages(boolean prioritizedMessages) {
764        this.prioritizedMessages = prioritizedMessages;
765    }
766
767    public void setAllConsumersExclusiveByDefault(boolean allConsumersExclusiveByDefault) {
768        this.allConsumersExclusiveByDefault = allConsumersExclusiveByDefault;
769    }
770
771    public boolean isAllConsumersExclusiveByDefault() {
772        return allConsumersExclusiveByDefault;
773    }
774
775    public boolean isGcInactiveDestinations() {
776        return this.gcInactiveDestinations;
777    }
778
779    public void setGcInactiveDestinations(boolean gcInactiveDestinations) {
780        this.gcInactiveDestinations = gcInactiveDestinations;
781    }
782
783    public long getInactiveTimoutBeforeGC() {
784        return this.inactiveTimoutBeforeGC;
785    }
786
787    public void setInactiveTimoutBeforeGC(long inactiveTimoutBeforeGC) {
788        this.inactiveTimoutBeforeGC = inactiveTimoutBeforeGC;
789    }
790    
791    public boolean isReduceMemoryFootprint() {
792        return reduceMemoryFootprint;
793    }
794
795    public void setReduceMemoryFootprint(boolean reduceMemoryFootprint) {
796        this.reduceMemoryFootprint = reduceMemoryFootprint;
797    }
798}