18 #ifndef _ACTIVEMQ_TANSPORT_MOCK_MOCKTRANSPORT_H_
19 #define _ACTIVEMQ_TANSPORT_MOCK_MOCKTRANSPORT_H_
74 bool failOnSendMessage;
75 int numSentMessageBeforeFail;
77 bool failOnReceiveMessage;
78 int numReceivedMessageBeforeFail;
79 int numReceivedMessages;
80 bool failOnKeepAliveSends;
81 int numSentKeepAlivesBeforeFail;
82 int numSentKeepAlives;
109 if (listener !=
NULL) {
110 listener->onCommand(command);
122 if (listener !=
NULL) {
123 listener->onException(ex);
134 this->responseBuilder = responseBuilder;
144 outgoingListener = listener;
153 return this->wireFormat;
170 this->listener = listener;
174 return this->listener;
177 virtual void start();
181 virtual void close();
184 if (
typeid( *
this ) == typeId) {
220 return this->failOnSendMessage;
224 this->failOnSendMessage = value;
228 return this->numSentMessageBeforeFail;
232 this->numSentMessageBeforeFail = value;
236 return this->numSentMessages;
240 this->numSentMessages = value;
244 return this->failOnReceiveMessage;
248 this->failOnReceiveMessage = value;
252 return this->numReceivedMessageBeforeFail;
256 this->numReceivedMessageBeforeFail = value;
260 return this->numReceivedMessages;
264 this->numReceivedMessages = value;
268 return this->failOnKeepAliveSends;
272 this->failOnKeepAliveSends = value;
276 return this->numSentKeepAlivesBeforeFail;
280 this->numSentKeepAlivesBeforeFail = value;
284 return this->numSentKeepAlives;
288 this->numSentKeepAlives = value;
292 return this->failOnReceiveMessage;
296 this->failOnReceiveMessage = value;
300 return this->failOnStop;
304 this->failOnStop = value;
308 return this->failOnClose;
312 this->failOnClose = value;
std::string getName() const
Definition: MockTransport.h:211
virtual void updateURIs(bool rebalance AMQCPP_UNUSED, const decaf::util::List< decaf::net::URI > &uris AMQCPP_UNUSED)
Definition: MockTransport.h:323
bool isFailOnKeepAliveSends() const
Definition: MockTransport.h:267
virtual void setWireFormat(const Pointer< wireformat::WireFormat > wireFormat AMQCPP_UNUSED)
Sets the WireFormat instance to use.
Definition: MockTransport.h:167
void setFailOnReceiveMessage(bool value)
Definition: MockTransport.h:247
void setNumReceivedMessages(int value)
Definition: MockTransport.h:263
int getNumReceivedMessageBeforeFail() const
Definition: MockTransport.h:251
#define AMQCPP_API
Definition: Config.h:30
void setFailOnStart(bool value)
Definition: MockTransport.h:295
void setFailOnSendMessage(bool value)
Definition: MockTransport.h:223
void setNumSentMessages(int value)
Definition: MockTransport.h:239
#define NULL
Definition: Config.h:33
virtual std::string getRemoteAddress() const
Definition: MockTransport.h:203
virtual void setOutgoingListener(TransportListener *listener)
Sets a Listener that gets notified for every command that would have been sent by this transport to t...
Definition: MockTransport.h:143
virtual bool isUpdateURIsSupported() const
Definition: MockTransport.h:319
void setNumSentKeepAlivesBeforeFail(int value)
Definition: MockTransport.h:279
int getNumSentMessageBeforeFail() const
Definition: MockTransport.h:227
bool isFailOnStop() const
Definition: MockTransport.h:299
Definition: Response.h:46
virtual bool isReconnectSupported() const
Definition: MockTransport.h:315
void setNumSentKeepAlives(int value)
Definition: MockTransport.h:287
Definition: IOException.h:28
virtual void setTransportListener(TransportListener *listener)
Sets the observer of asynchronous events from this transport.
Definition: MockTransport.h:169
bool isFailOnReceiveMessage() const
Definition: MockTransport.h:243
virtual void reconnect(const decaf::net::URI &uri AMQCPP_UNUSED)
Definition: MockTransport.h:207
static MockTransport * getInstance()
Definition: MockTransport.h:99
virtual void fireCommand(const Pointer< Command > command)
Fires a Command back through this transport to its registered CommandListener if there is one...
Definition: MockTransport.h:108
Listens for Commands sent from the MockTransport.
Definition: InternalCommandListener.h:45
Interface for a transport layer for command objects.
Definition: Transport.h:59
virtual ~MockTransport()
Definition: MockTransport.h:97
An int value that may be updated atomically.
Definition: AtomicInteger.h:37
int getNumReceivedMessages() const
Definition: MockTransport.h:259
void setResponseBuilder(const Pointer< ResponseBuilder > responseBuilder)
Sets the ResponseBuilder that this class uses to create Responses to Commands sent.
Definition: MockTransport.h:133
virtual bool isConnected() const
Is the Transport Connected to its Broker.
Definition: MockTransport.h:195
virtual void fireException(const exceptions::ActiveMQException &ex)
Fires a Exception back through this transport to its registered ExceptionListener if there is one...
Definition: MockTransport.h:121
void setNumSentMessageBeforeFail(int value)
Definition: MockTransport.h:231
bool isFailOnStart() const
Definition: MockTransport.h:291
This class represents an instance of a URI as defined by RFC 2396.
Definition: URI.h:36
void setName(const std::string &name)
Definition: MockTransport.h:215
The MockTransport defines a base level Transport class that is intended to be used in place of an a r...
Definition: MockTransport.h:61
Definition: ActiveMQException.h:35
virtual bool isFaultTolerant() const
Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.
Definition: MockTransport.h:191
int getNumSentMessages() const
Definition: MockTransport.h:235
int getNumSentKeepAlivesBeforeFail() const
Definition: MockTransport.h:275
void setFailOnStop(bool value)
Definition: MockTransport.h:303
void setNumReceivedMessageBeforeFail(int value)
Definition: MockTransport.h:255
void setFailOnClose(bool value)
Definition: MockTransport.h:311
bool isFailOnSendMessage() const
Definition: MockTransport.h:219
virtual TransportListener * getTransportListener() const
Gets the observer of asynchronous events from this transport.
Definition: MockTransport.h:173
bool isFailOnClose() const
Definition: MockTransport.h:307
void setFailOnKeepAliveSends(bool value)
Definition: MockTransport.h:271
virtual Transport * narrow(const std::type_info &typeId)
Narrows down a Chain of Transports to a specific Transport to allow a higher level transport to skip ...
Definition: MockTransport.h:183
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
Pointer< wireformat::WireFormat > getWireFormat() const
Gets the currently set WireFormat.
Definition: MockTransport.h:152
virtual bool isClosed() const
Has the Transport been shutdown and no longer usable.
Definition: MockTransport.h:199
int getNumSentKeepAlives() const
Definition: MockTransport.h:283
A listener of asynchronous exceptions from a command transport object.
Definition: TransportListener.h:38