1 18 19 package org.apache.activemq.broker; 20 21 import org.apache.activemq.broker.region.Destination; 22 import org.apache.activemq.broker.region.Subscription; 23 import org.apache.activemq.broker.region.policy.PendingDurableSubscriberMessageStoragePolicy; 24 import org.apache.activemq.command.ActiveMQDestination; 25 import org.apache.activemq.command.BrokerId; 26 import org.apache.activemq.command.BrokerInfo; 27 import org.apache.activemq.command.ConnectionInfo; 28 import org.apache.activemq.command.ConsumerInfo; 29 import org.apache.activemq.command.DestinationInfo; 30 import org.apache.activemq.command.Message; 31 import org.apache.activemq.command.MessageAck; 32 import org.apache.activemq.command.MessageDispatch; 33 import org.apache.activemq.command.MessageDispatchNotification; 34 import org.apache.activemq.command.MessagePull; 35 import org.apache.activemq.command.ProducerInfo; 36 import org.apache.activemq.command.RemoveSubscriptionInfo; 37 import org.apache.activemq.command.Response; 38 import org.apache.activemq.command.SessionInfo; 39 import org.apache.activemq.command.TransactionId; 40 import org.apache.activemq.kaha.Store; 41 42 import java.net.URI ; 43 import java.util.LinkedList ; 44 import java.util.Map ; 45 import java.util.Set ; 46 47 public class StubBroker implements Broker { 48 public LinkedList addConnectionData = new LinkedList (); 49 public LinkedList removeConnectionData = new LinkedList (); 50 51 public class AddConnectionData { 52 public final ConnectionContext connectionContext; 53 public final ConnectionInfo connectionInfo; 54 55 public AddConnectionData(ConnectionContext context, ConnectionInfo info) { 56 connectionContext = context; 57 connectionInfo = info; 58 } 59 } 60 61 public class RemoveConnectionData { 62 public final ConnectionContext connectionContext; 63 public final ConnectionInfo connectionInfo; 64 public final Throwable error; 65 66 public RemoveConnectionData(ConnectionContext context, ConnectionInfo info, Throwable error) { 67 connectionContext = context; 68 connectionInfo = info; 69 this.error = error; 70 } 71 } 72 73 public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { 74 addConnectionData.add(new AddConnectionData(context, info)); 75 } 76 77 public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception { 78 removeConnectionData.add(new RemoveConnectionData(context, info, error)); 79 } 80 81 82 public void addBroker(Connection connection, BrokerInfo info) { 84 } 85 86 public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { 87 } 88 89 public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { 90 } 91 92 public void addSession(ConnectionContext context, SessionInfo info) throws Exception { 93 } 94 95 public void beginTransaction(ConnectionContext context, TransactionId xid) throws Exception { 96 } 97 98 public void commitTransaction(ConnectionContext context, TransactionId xid, boolean onePhase) throws Exception { 99 } 100 101 public void forgetTransaction(ConnectionContext context, TransactionId transactionId) throws Exception { 102 } 103 104 public Broker getAdaptor(Class type) { 105 return null; 106 } 107 108 public ConnectionContext getAdminConnectionContext() { 109 return null; 110 } 111 112 public BrokerId getBrokerId() { 113 return null; 114 } 115 116 public String getBrokerName() { 117 return null; 118 } 119 120 public Connection[] getClients() throws Exception { 121 return null; 122 } 123 124 public ActiveMQDestination[] getDestinations() throws Exception { 125 return null; 126 } 127 128 public Set getDurableDestinations() { 129 return null; 130 } 131 132 public BrokerInfo[] getPeerBrokerInfos() { 133 return null; 134 } 135 136 public TransactionId[] getPreparedTransactions(ConnectionContext context) throws Exception { 137 return null; 138 } 139 140 public boolean isFaultTolerantConfiguration() { 141 return false; 142 } 143 144 public boolean isSlaveBroker() { 145 return false; 146 } 147 148 public boolean isStopped() { 149 return false; 150 } 151 152 public int prepareTransaction(ConnectionContext context, TransactionId xid) throws Exception { 153 return 0; 154 } 155 156 public void processDispatch(MessageDispatch messageDispatch) { 157 } 158 159 public void removeBroker(Connection connection, BrokerInfo info) { 160 } 161 162 public void removeDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { 163 } 164 165 public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { 166 } 167 168 public void removeSession(ConnectionContext context, SessionInfo info) throws Exception { 169 } 170 171 public void rollbackTransaction(ConnectionContext context, TransactionId xid) throws Exception { 172 } 173 174 public void setAdminConnectionContext(ConnectionContext adminConnectionContext) { 175 } 176 177 public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { 178 } 179 180 public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { 181 return null; 182 } 183 184 public Destination addDestination(ConnectionContext context, ActiveMQDestination destination) throws Exception { 185 return null; 186 } 187 188 public void gc() { 189 } 190 191 public Map getDestinationMap() { 192 return null; 193 } 194 195 public Set getDestinations(ActiveMQDestination destination) { 196 return null; 197 } 198 199 public Response messagePull(ConnectionContext context, MessagePull pull) throws Exception { 200 return null; 201 } 202 203 public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification) throws Exception { 204 } 205 206 public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { 207 } 208 209 public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) 210 throws Exception { 211 } 212 213 public void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception { 214 } 215 216 public void send(ProducerBrokerExchange producerExchange, Message message) throws Exception { 217 } 218 219 public void start() throws Exception { 220 } 221 222 public void stop() throws Exception { 223 } 224 225 public PendingDurableSubscriberMessageStoragePolicy getPendingDurableSubscriberPolicy() { 226 return null; 227 } 228 229 public void setPendingDurableSubscriberPolicy(PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy) { 230 } 231 232 public Store getTempDataStore() { 233 return null; 234 } 235 236 public URI getVmConnectorURI(){ 237 return null; 238 } 239 } 240 | Popular Tags |