1 /***
2 *
3 * Copyright 2004 Protique Ltd
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 **/
18
19 package org.codehaus.activemq;
20
21
22 /***
23 * Defines the pretech message policies for different types of consumers
24 * @version $Revision: 1.7 $
25 */
26 public class ActiveMQPrefetchPolicy {
27 private int queuePrefetch;
28 private int queueBrowserPrefetch;
29 private int topicPrefetch;
30 private int durableTopicPrefetch;
31
32
33 /***
34 * Initialize default prefetch policies
35 */
36 public ActiveMQPrefetchPolicy() {
37 this.queuePrefetch = 10;
38 this.queueBrowserPrefetch = 500;
39 this.topicPrefetch = 1000;
40 this.durableTopicPrefetch = 100;
41 }
42
43 /***
44 * @return Returns the durableTopicPrefetch.
45 */
46 public int getDurableTopicPrefetch() {
47 return durableTopicPrefetch;
48 }
49
50 /***
51 * @param durableTopicPrefetch The durableTopicPrefetch to set.
52 */
53 public void setDurableTopicPrefetch(int durableTopicPrefetch) {
54 this.durableTopicPrefetch = durableTopicPrefetch;
55 }
56
57 /***
58 * @return Returns the queuePrefetch.
59 */
60 public int getQueuePrefetch() {
61 return queuePrefetch;
62 }
63
64 /***
65 * @param queuePrefetch The queuePrefetch to set.
66 */
67 public void setQueuePrefetch(int queuePrefetch) {
68 this.queuePrefetch = queuePrefetch;
69 }
70
71 /***
72 * @return Returns the queueBrowserPrefetch.
73 */
74 public int getQueueBrowserPrefetch() {
75 return queueBrowserPrefetch;
76 }
77
78 /***
79 * @param queueBrowserPrefetch The queueBrowserPrefetch to set.
80 */
81 public void setQueueBrowserPrefetch(int queueBrowserPrefetch) {
82 this.queueBrowserPrefetch = queueBrowserPrefetch;
83 }
84
85 /***
86 * @return Returns the topicPrefetch.
87 */
88 public int getTopicPrefetch() {
89 return topicPrefetch;
90 }
91
92 /***
93 * @param topicPrefetch The topicPrefetch to set.
94 */
95 public void setTopicPrefetch(int topicPrefetch) {
96 this.topicPrefetch = topicPrefetch;
97 }
98 }