KickJava   Java API By Example, From Geeks To Geeks.

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


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.util.IntrospectionSupport;
21
22
23 /**
24  *
25  * @openwire:marshaller
26  * @version $Revision: 1.11 $
27  */

28 abstract public class BaseCommand implements Command {
29
30     protected int commandId;
31     protected boolean responseRequired;
32     
33     private transient Endpoint from;
34     private transient Endpoint to;
35     
36     public void copy(BaseCommand copy) {
37         copy.commandId = commandId;
38         copy.responseRequired = responseRequired;
39     }
40
41     /**
42      * @openwire:property version=1
43      */

44     public int getCommandId() {
45         return commandId;
46     }
47
48     public void setCommandId(int commandId) {
49         this.commandId = commandId;
50     }
51
52     /**
53      * @openwire:property version=1
54      */

55     public boolean isResponseRequired() {
56         return responseRequired;
57     }
58
59     public void setResponseRequired(boolean responseRequired) {
60         this.responseRequired = responseRequired;
61     }
62
63     public String JavaDoc toString() {
64         return IntrospectionSupport.toString(this, BaseCommand.class);
65     }
66     
67     public boolean isWireFormatInfo() {
68         return false;
69     }
70
71     public boolean isBrokerInfo() {
72         return false;
73     }
74
75     public boolean isResponse() {
76         return false;
77     }
78
79     public boolean isMessageDispatch() {
80         return false;
81     }
82
83     public boolean isMessage() {
84         return false;
85     }
86
87     public boolean isMarshallAware() {
88         return false;
89     }
90
91     public boolean isMessageAck() {
92         return false;
93     }
94
95     public boolean isMessageDispatchNotification() {
96         return false;
97     }
98
99     public boolean isShutdownInfo() {
100         return false;
101     }
102
103     /**
104      * The endpoint within the transport where this message came from.
105      */

106     public Endpoint getFrom() {
107         return from;
108     }
109
110     public void setFrom(Endpoint from) {
111         this.from = from;
112     }
113
114     /**
115      * The endpoint within the transport where this message is going to - null means all endpoints.
116      */

117     public Endpoint getTo() {
118         return to;
119     }
120
121     public void setTo(Endpoint to) {
122         this.to = to;
123     }
124     
125     
126 }
127
Popular Tags