KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > command > MessageDispatch


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.command;
19
20 import org.apache.activemq.state.CommandVisitor;
21
22
23 /**
24  *
25  * @openwire:marshaller code="21"
26  * @version $Revision$
27  */

28 public class MessageDispatch extends BaseCommand {
29
30     public static final byte DATA_STRUCTURE_TYPE=CommandTypes.MESSAGE_DISPATCH;
31
32     protected ConsumerId consumerId;
33     protected ActiveMQDestination destination;
34     protected Message message;
35     protected int redeliveryCounter;
36
37     transient protected long deliverySequenceId;
38     transient protected Object JavaDoc consumer;
39     transient protected Runnable JavaDoc transmitCallback;
40     
41     public byte getDataStructureType() {
42         return DATA_STRUCTURE_TYPE;
43     }
44     
45     public boolean isMessageDispatch() {
46         return true;
47     }
48
49     /**
50      * @openwire:property version=1 cache=true
51      */

52     public ConsumerId getConsumerId() {
53         return consumerId;
54     }
55     public void setConsumerId(ConsumerId consumerId) {
56         this.consumerId = consumerId;
57     }
58
59     /**
60      * @openwire:property version=1 cache=true
61      */

62     public ActiveMQDestination getDestination() {
63         return destination;
64     }
65     public void setDestination(ActiveMQDestination destination) {
66         this.destination = destination;
67     }
68     
69     /**
70      * @openwire:property version=1
71      */

72     public Message getMessage() {
73         return message;
74     }
75     public void setMessage(Message message) {
76         this.message = message;
77     }
78
79     public long getDeliverySequenceId() {
80         return deliverySequenceId;
81     }
82     public void setDeliverySequenceId(long deliverySequenceId) {
83         this.deliverySequenceId = deliverySequenceId;
84     }
85     
86     /**
87      * @openwire:property version=1
88      */

89     public int getRedeliveryCounter() {
90         return redeliveryCounter;
91     }
92     public void setRedeliveryCounter(int deliveryCounter) {
93         this.redeliveryCounter = deliveryCounter;
94     }
95
96     public Object JavaDoc getConsumer() {
97         return consumer;
98     }
99
100     public void setConsumer(Object JavaDoc consumer) {
101         this.consumer = consumer;
102     }
103
104     public Response visit(CommandVisitor visitor) throws Exception JavaDoc {
105         return visitor.processMessageDispatch(this);
106     }
107
108     public Runnable JavaDoc getTransmitCallback() {
109         return transmitCallback;
110     }
111
112     public void setTransmitCallback(Runnable JavaDoc transmitCallback) {
113         this.transmitCallback = transmitCallback;
114     }
115     
116 }
117
Popular Tags