KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > tool > properties > JmsConsumerProperties


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.activemq.tool.properties;
19
20 public class JmsConsumerProperties extends JmsClientProperties {
21     public static final String JavaDoc TIME_BASED_RECEIVING = "time"; // Receive messages on a time-based interval
22
public static final String JavaDoc COUNT_BASED_RECEIVING = "count"; // Receive a specific count of messages
23

24     protected boolean durable = false; // Consumer is a durable subscriber
25
protected boolean unsubscribe = true; // If true, unsubscribe a durable subscriber after it finishes running
26
protected boolean asyncRecv = true; // If true, use onMessage() to receive messages, else use receive()
27

28     protected long recvCount = 1000000; // Receive a million messages by default
29
protected long recvDuration = 5 * 60 * 1000; // Receive for 5 mins by default
30
protected String JavaDoc recvType = TIME_BASED_RECEIVING;
31
32     public boolean isDurable() {
33         return durable;
34     }
35
36     public void setDurable(boolean durable) {
37         this.durable = durable;
38     }
39
40     public boolean isUnsubscribe() {
41         return unsubscribe;
42     }
43
44     public void setUnsubscribe(boolean unsubscribe) {
45         this.unsubscribe = unsubscribe;
46     }
47
48     public boolean isAsyncRecv() {
49         return asyncRecv;
50     }
51
52     public void setAsyncRecv(boolean asyncRecv) {
53         this.asyncRecv = asyncRecv;
54     }
55
56     public long getRecvCount() {
57         return recvCount;
58     }
59
60     public void setRecvCount(long recvCount) {
61         this.recvCount = recvCount;
62     }
63
64     public long getRecvDuration() {
65         return recvDuration;
66     }
67
68     public void setRecvDuration(long recvDuration) {
69         this.recvDuration = recvDuration;
70     }
71
72     public String JavaDoc getRecvType() {
73         return recvType;
74     }
75
76     public void setRecvType(String JavaDoc recvType) {
77         this.recvType = recvType;
78     }
79 }
80
Popular Tags