#include <ResponseCorrelator.h>
Inheritance diagram for activemq::transport::ResponseCorrelator:
Public Member Functions | |
ResponseCorrelator (Transport *next, const bool own=true) | |
virtual | ~ResponseCorrelator () |
virtual unsigned long | getMaxResponseWaitTime () const |
virtual void | setMaxResponseWaitTime (const unsigned long milliseconds) |
virtual void | oneway (Command *command) throw ( CommandIOException, exceptions::UnsupportedOperationException ) |
virtual Response * | request (Command *command) throw ( CommandIOException, exceptions::UnsupportedOperationException ) |
virtual void | onCommand (Command *command) |
virtual void | setCommandListener (CommandListener *listener) |
virtual void | setTransportExceptionListener (TransportExceptionListener *listener) |
virtual void | start () throw ( cms::CMSException ) |
virtual void | close () throw ( cms::CMSException ) |
Private Member Functions | |
unsigned int | getNextCommandId () throw ( exceptions::ActiveMQException ) |
Private Attributes | |
unsigned int | nextCommandId |
std::map< unsigned int, FutureResponse * > | requestMap |
unsigned long | maxResponseWaitTime |
concurrent::Mutex | commandIdMutex |
concurrent::Mutex | mapMutex |
bool | closed |
|
Constructor.
|
|
|
|
Stops the polling thread and closes the streams. This can be called explicitly, but is also called in the destructor. Once this object has been closed, it cannot be restarted.
Reimplemented from activemq::transport::TransportFilter. |
|
Gets the maximum wait time for a response in milliseconds.
|
|
Returns the next available command id. |
|
This is called in the context of the nested transport's reading thread. In the case of a response object, updates the request map and notifies those waiting on the response. Non-response messages are just delegated to the command listener.
Reimplemented from activemq::transport::TransportFilter. |
|
Sends a one-way command. Does not wait for any response from the broker.
Reimplemented from activemq::transport::TransportFilter. |
|
Sends the given request to the server and waits for the response.
Reimplemented from activemq::transport::TransportFilter. |
|
Assigns the command listener for non-response commands.
Reimplemented from activemq::transport::TransportFilter. |
|
Sets the maximum wait time for a response in milliseconds.
|
|
Sets the observer of asynchronous exceptions from this transport.
Reimplemented from activemq::transport::TransportFilter. |
|
Starts this transport object and creates the thread for polling on the input stream for commands. If this object has been closed, throws an exception. Before calling start, the caller must set the IO streams and the reader and writer objects.
Reimplemented from activemq::transport::TransportFilter. |
|
Flag to indicate the closed state. |
|
Sync object for accessing the next command id variable. |
|
Sync object for accessing the request map. |
|
Maximum amount of time in milliseconds to wait for a response. |
|
The next command id for sent commands. |
|
Map of request ids to future response objects. |