KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > broker > EmptyBroker


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.broker;
19
20 import org.apache.activemq.broker.region.Destination;
21 import org.apache.activemq.broker.region.Subscription;
22 import org.apache.activemq.broker.region.policy.PendingDurableSubscriberMessageStoragePolicy;
23 import org.apache.activemq.command.ActiveMQDestination;
24 import org.apache.activemq.command.BrokerId;
25 import org.apache.activemq.command.BrokerInfo;
26 import org.apache.activemq.command.ConnectionInfo;
27 import org.apache.activemq.command.ConsumerInfo;
28 import org.apache.activemq.command.DestinationInfo;
29 import org.apache.activemq.command.Message;
30 import org.apache.activemq.command.MessageAck;
31 import org.apache.activemq.command.MessageDispatch;
32 import org.apache.activemq.command.MessageDispatchNotification;
33 import org.apache.activemq.command.MessagePull;
34 import org.apache.activemq.command.ProducerInfo;
35 import org.apache.activemq.command.RemoveSubscriptionInfo;
36 import org.apache.activemq.command.Response;
37 import org.apache.activemq.command.SessionInfo;
38 import org.apache.activemq.command.TransactionId;
39 import org.apache.activemq.kaha.Store;
40
41 import java.net.URI JavaDoc;
42 import java.util.Collections JavaDoc;
43 import java.util.Map JavaDoc;
44 import java.util.Set JavaDoc;
45
46 /**
47  * Dumb implementation - used to be overriden by listeners
48  *
49  * @version $Revision$
50  */

51 public class EmptyBroker implements Broker {
52
53     public BrokerId getBrokerId() {
54         return null;
55     }
56
57     public String JavaDoc getBrokerName() {
58         return null;
59     }
60
61     public Broker getAdaptor(Class JavaDoc type) {
62         if (type.isInstance(this)) {
63             return this;
64         }
65         return null;
66     }
67
68     public Map JavaDoc getDestinationMap() {
69         return Collections.EMPTY_MAP;
70     }
71
72     public Set JavaDoc getDestinations(ActiveMQDestination destination) {
73         return Collections.EMPTY_SET;
74     }
75
76     public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception JavaDoc {
77
78     }
79
80     public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable JavaDoc error) throws Exception JavaDoc {
81
82     }
83
84     public void addSession(ConnectionContext context, SessionInfo info) throws Exception JavaDoc {
85
86     }
87
88     public void removeSession(ConnectionContext context, SessionInfo info) throws Exception JavaDoc {
89
90     }
91
92     public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception JavaDoc {
93
94     }
95
96     public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception JavaDoc {
97
98     }
99
100     public Connection[] getClients() throws Exception JavaDoc {
101
102         return null;
103     }
104
105     public ActiveMQDestination[] getDestinations() throws Exception JavaDoc {
106
107         return null;
108     }
109
110     public TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception JavaDoc {
111
112         return null;
113     }
114
115     public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception JavaDoc {
116
117     }
118
119     public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception JavaDoc {
120
121         return 0;
122     }
123
124     public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception JavaDoc {
125
126     }
127
128     public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception JavaDoc {
129
130     }
131
132     public void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception JavaDoc {
133
134     }
135
136     public Destination addDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception JavaDoc {
137
138         return null;
139     }
140
141     public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception JavaDoc {
142
143     }
144
145     public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception JavaDoc {
146         return null;
147     }
148
149     public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception JavaDoc {
150
151     }
152
153     public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception JavaDoc {
154
155     }
156
157     public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception JavaDoc {
158
159     }
160
161     public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception JavaDoc {
162
163     }
164
165     public void gc() {
166
167     }
168
169     public void start() throws Exception JavaDoc {
170
171     }
172
173     public void stop() throws Exception JavaDoc {
174
175     }
176
177     public void addBroker(Connection connection, BrokerInfo info) {
178
179     }
180
181     public void removeBroker(Connection connection, BrokerInfo info) {
182
183     }
184
185     public BrokerInfo[] getPeerBrokerInfos() {
186         return null;
187     }
188
189     /**
190      * Notifiy the Broker that a dispatch has happened
191      *
192      * @param messageDispatch
193      */

194     public void processDispatch(MessageDispatch messageDispatch) {
195
196     }
197
198     public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception JavaDoc {
199
200     }
201
202     public boolean isSlaveBroker() {
203         return false;
204     }
205
206     public boolean isStopped() {
207         return false;
208     }
209
210     public Set JavaDoc getDurableDestinations() {
211         return null;
212     }
213
214     public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception JavaDoc {
215     }
216
217     public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception JavaDoc {
218     }
219
220     public boolean isFaultTolerantConfiguration() {
221         return false;
222     }
223
224     public ConnectionContext getAdminConnectionContext() {
225         return null;
226     }
227
228     public void setAdminConnectionContext(ConnectionContext adminConnectionContext) {
229     }
230
231     
232     public Response messagePull(ConnectionContext context, MessagePull pull) {
233         return null;
234     }
235     
236     
237     public Store getTempDataStore() {
238         return null;
239     }
240     
241     public URI JavaDoc getVmConnectorURI(){
242         return null;
243     }
244
245 }
246
Popular Tags