activemq-cpp-3.6.0
|
The MockTransport defines a base level Transport class that is intended to be used in place of an a regular protocol Transport suck as TCP. More...
#include <src/main/activemq/transport/mock/MockTransport.h>
Public Member Functions | |
MockTransport (const Pointer< wireformat::WireFormat > wireFormat, const Pointer< ResponseBuilder > responseBuilder) | |
virtual | ~MockTransport () |
virtual void | fireCommand (const Pointer< Command > command) |
Fires a Command back through this transport to its registered CommandListener if there is one. | |
virtual void | fireException (const exceptions::ActiveMQException &ex) |
Fires a Exception back through this transport to its registered ExceptionListener if there is one. | |
void | setResponseBuilder (const Pointer< ResponseBuilder > responseBuilder) |
Sets the ResponseBuilder that this class uses to create Responses to Commands sent. | |
virtual void | setOutgoingListener (TransportListener *listener) |
Sets a Listener that gets notified for every command that would have been sent by this transport to the Broker, this allows a client to verify that its messages are making it to the wire. | |
Pointer< wireformat::WireFormat > | getWireFormat () const |
Gets the currently set WireFormat. | |
virtual void | oneway (const Pointer< Command > command) |
Sends a one-way command. | |
virtual Pointer< FutureResponse > | asyncRequest (const Pointer< Command > command, const Pointer< ResponseCallback > responseCallback) |
Sends a commands asynchronously, returning a FutureResponse object that the caller can use to check to find out the response from the broker. | |
virtual Pointer< Response > | request (const Pointer< Command > command) |
Sends the given command to the broker and then waits for the response. | |
virtual Pointer< Response > | request (const Pointer< Command > command, unsigned int timeout) |
Sends the given command to the broker and then waits for the response. | |
virtual void | setWireFormat (const Pointer< wireformat::WireFormat > wireFormat AMQCPP_UNUSED) |
Sets the WireFormat instance to use. | |
virtual void | setTransportListener (TransportListener *listener) |
Sets the observer of asynchronous events from this transport. | |
virtual TransportListener * | getTransportListener () const |
Gets the observer of asynchronous events from this transport. | |
virtual void | start () |
Starts the Transport, the send methods of a Transport will throw an exception if used before the Transport is started. | |
virtual void | stop () |
Stops the Transport. | |
virtual void | close () |
Closes this object and deallocates the appropriate resources. | |
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 intermediate Transports in certain circumstances. | |
virtual bool | isFaultTolerant () const |
Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect. | |
virtual bool | isConnected () const |
Is the Transport Connected to its Broker. | |
virtual bool | isClosed () const |
Has the Transport been shutdown and no longer usable. | |
virtual std::string | getRemoteAddress () const |
virtual void | reconnect (const decaf::net::URI &uri AMQCPP_UNUSED) |
std::string | getName () const |
void | setName (const std::string &name) |
bool | isFailOnSendMessage () const |
void | setFailOnSendMessage (bool value) |
int | getNumSentMessageBeforeFail () const |
void | setNumSentMessageBeforeFail (int value) |
int | getNumSentMessages () const |
void | setNumSentMessages (int value) |
bool | isFailOnReceiveMessage () const |
void | setFailOnReceiveMessage (bool value) |
int | getNumReceivedMessageBeforeFail () const |
void | setNumReceivedMessageBeforeFail (int value) |
int | getNumReceivedMessages () const |
void | setNumReceivedMessages (int value) |
bool | isFailOnKeepAliveSends () const |
void | setFailOnKeepAliveSends (bool value) |
int | getNumSentKeepAlivesBeforeFail () const |
void | setNumSentKeepAlivesBeforeFail (int value) |
int | getNumSentKeepAlives () const |
void | setNumSentKeepAlives (int value) |
bool | isFailOnStart () const |
void | setFailOnStart (bool value) |
bool | isFailOnStop () const |
void | setFailOnStop (bool value) |
bool | isFailOnClose () const |
void | setFailOnClose (bool value) |
virtual bool | isReconnectSupported () const |
virtual bool | isUpdateURIsSupported () const |
virtual void | updateURIs (bool rebalance AMQCPP_UNUSED, const decaf::util::List< decaf::net::URI > &uris AMQCPP_UNUSED) |
Public Member Functions inherited from activemq::transport::Transport | |
virtual | ~Transport () |
virtual void | reconnect (const decaf::net::URI &uri)=0 |
reconnect to another location | |
virtual void | updateURIs (bool rebalance, const decaf::util::List< decaf::net::URI > &uris)=0 |
Updates the set of URIs the Transport can connect to. | |
Public Member Functions inherited from decaf::io::Closeable | |
virtual | ~Closeable () |
Static Public Member Functions | |
static MockTransport * | getInstance () |
The MockTransport defines a base level Transport class that is intended to be used in place of an a regular protocol Transport suck as TCP.
This Transport assumes that it is the base Transport in the Transports stack, and destroys any Transports that are passed to it in its constructor.
This Transport defines an Interface ResponseBuilder which must be implemented by any protocol for which the Transport is used to Emulate. The Transport hands off all outbound commands to the ResponseBuilder for processing, it is up to the builder to create appropriate responses and schedule any asynchronous messages that might result from a message sent to the Broker.
activemq::transport::mock::MockTransport::MockTransport | ( | const Pointer< wireformat::WireFormat > | wireFormat, |
const Pointer< ResponseBuilder > | responseBuilder | ||
) |
|
inlinevirtual |
|
virtual |
Sends a commands asynchronously, returning a FutureResponse object that the caller can use to check to find out the response from the broker.
command | The Command object that is to sent out. |
responseCallback | A callback object that will be notified once a response to the command is received. |
IOException | if an exception occurs during the read of the command. |
UnsupportedOperationException | if this method is not implemented by this transport. |
Implements activemq::transport::Transport.
|
virtual |
Closes this object and deallocates the appropriate resources.
The object is generally no longer usable after calling close.
IOException | if an error occurs while closing. |
Implements decaf::io::Closeable.
|
inlinevirtual |
Fires a Command back through this transport to its registered CommandListener if there is one.
command | - Command to send to the Listener. |
References NULL.
|
inlinevirtual |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Implements activemq::transport::Transport.
|
inlinevirtual |
Gets the observer of asynchronous events from this transport.
Implements activemq::transport::Transport.
|
inlinevirtual |
Gets the currently set WireFormat.
Implements activemq::transport::Transport.
|
inlinevirtual |
Has the Transport been shutdown and no longer usable.
Implements activemq::transport::Transport.
|
inlinevirtual |
Is the Transport Connected to its Broker.
Implements activemq::transport::Transport.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.
Implements activemq::transport::Transport.
|
inlinevirtual |
Implements activemq::transport::Transport.
|
inlinevirtual |
Implements activemq::transport::Transport.
|
inlinevirtual |
Narrows down a Chain of Transports to a specific Transport to allow a higher level transport to skip intermediate Transports in certain circumstances.
typeId | - The type_info of the Object we are searching for. |
Implements activemq::transport::Transport.
References NULL.
|
virtual |
Sends a one-way command.
Does not wait for any response from the broker.
command | The command to be sent. |
IOException | if an exception occurs during writing of the command. |
UnsupportedOperationException | if this method is not implemented by this transport. |
Implements activemq::transport::Transport.
|
inlinevirtual |
|
virtual |
Sends the given command to the broker and then waits for the response.
command | the command to be sent. |
IOException | if an exception occurs during the read of the command. |
UnsupportedOperationException | if this method is not implemented by this transport. |
Implements activemq::transport::Transport.
|
virtual |
Sends the given command to the broker and then waits for the response.
command | The command to be sent. |
timeout | The time to wait for this response. |
IOException | if an exception occurs during the read of the command. |
UnsupportedOperationException | if this method is not implemented by this transport. |
Implements activemq::transport::Transport.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Sets a Listener that gets notified for every command that would have been sent by this transport to the Broker, this allows a client to verify that its messages are making it to the wire.
listener | - The CommandListener to notify for each message |
|
inline |
Sets the ResponseBuilder that this class uses to create Responses to Commands sent.
These are either real Response Objects, or Commands that would have been sent Asynchronously be the Broker.
responseBuilder | - The ResponseBuilder to use from now on. |
|
inlinevirtual |
Sets the observer of asynchronous events from this transport.
listener | the listener of transport events. |
Implements activemq::transport::Transport.
|
inlinevirtual |
Sets the WireFormat instance to use.
wireFormat | The WireFormat the object used to encode / decode commands. |
Implements activemq::transport::Transport.
|
virtual |
Starts the Transport, the send methods of a Transport will throw an exception if used before the Transport is started.
IOException | if and error occurs while starting the Transport. |
Implements activemq::transport::Transport.
|
virtual |
Stops the Transport.
IOException | if an error occurs while stopping the transport. |
Implements activemq::transport::Transport.
|
inlinevirtual |