activemq::transport::correlator::ResponseCorrelator Class Reference

This type of transport filter is responsible for correlating asynchronous responses with requests. More...

#include <src/main/activemq/transport/correlator/ResponseCorrelator.h>

Inheritance diagram for activemq::transport::correlator::ResponseCorrelator:
Inheritance graph
[legend]

Public Member Functions

 ResponseCorrelator (Pointer< Transport > next)
 Creates a new ResponseCorrelator transport filter that wraps the given transport.
virtual ~ResponseCorrelator ()
virtual void oneway (const Pointer< Command > command)
 Sends a one-way command.
virtual Pointer< FutureResponseasyncRequest (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< Responserequest (const Pointer< Command > command)
 Sends the given command to the broker and then waits for the response.
virtual Pointer< Responserequest (const Pointer< Command > command, unsigned int timeout)
 Sends the given command to the broker and then waits for the response.
virtual void onCommand (const Pointer< Command > command)
 This is called in the context of the nested transport's reading thread.
virtual void onException (const decaf::lang::Exception &ex)
 Event handler for an exception from a command transport.

Protected Member Functions

virtual void doClose ()
 Subclasses can override this method to do their own close work.

Detailed Description

This type of transport filter is responsible for correlating asynchronous responses with requests.

Non-response messages are simply sent directly to the CommandListener. It owns the transport that it


Constructor & Destructor Documentation

activemq::transport::correlator::ResponseCorrelator::ResponseCorrelator ( Pointer< Transport next  ) 

Creates a new ResponseCorrelator transport filter that wraps the given transport.

Parameters:
next the next transport in the chain
Exceptions:
NullPointerException if next if NULL.
virtual activemq::transport::correlator::ResponseCorrelator::~ResponseCorrelator (  )  [virtual]

Member Function Documentation

virtual Pointer<FutureResponse> activemq::transport::correlator::ResponseCorrelator::asyncRequest ( const Pointer< Command command,
const Pointer< ResponseCallback responseCallback 
) [virtual]

Sends a commands asynchronously, returning a FutureResponse object that the caller can use to check to find out the response from the broker.

Parameters:
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.
Returns:
A FutureResponse instance that can be queried for the Response to the Command.
Exceptions:
IOException if an exception occurs during the read of the command.
UnsupportedOperationException if this method is not implemented by this transport.

Reimplemented from activemq::transport::TransportFilter.

virtual void activemq::transport::correlator::ResponseCorrelator::doClose (  )  [protected, virtual]

Subclasses can override this method to do their own close work.

This method is always called after all the next transports have been closed to prevent this transport for destroying resources needed by the lower level transports.

Reimplemented from activemq::transport::TransportFilter.

virtual void activemq::transport::correlator::ResponseCorrelator::onCommand ( const Pointer< Command command  )  [virtual]

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.

Parameters:
command The received from the nested transport.

Reimplemented from activemq::transport::TransportFilter.

virtual void activemq::transport::correlator::ResponseCorrelator::oneway ( const Pointer< Command command  )  [virtual]

Sends a one-way command.

Does not wait for any response from the broker.

Parameters:
command The command to be sent.
Exceptions:
IOException if an exception occurs during writing of the command.
UnsupportedOperationException if this method is not implemented by this transport.

Reimplemented from activemq::transport::TransportFilter.

virtual void activemq::transport::correlator::ResponseCorrelator::onException ( const decaf::lang::Exception ex  )  [virtual]

Event handler for an exception from a command transport.

Parameters:
source The source of the exception.
ex The exception that was caught.

Reimplemented from activemq::transport::TransportFilter.

virtual Pointer<Response> activemq::transport::correlator::ResponseCorrelator::request ( const Pointer< Command command,
unsigned int  timeout 
) [virtual]

Sends the given command to the broker and then waits for the response.

Parameters:
command The command to be sent.
timeout The time to wait for this response.
Returns:
the response from the broker.
Exceptions:
IOException if an exception occurs during the read of the command.
UnsupportedOperationException if this method is not implemented by this transport.

Reimplemented from activemq::transport::TransportFilter.

virtual Pointer<Response> activemq::transport::correlator::ResponseCorrelator::request ( const Pointer< Command command  )  [virtual]

Sends the given command to the broker and then waits for the response.

Parameters:
command the command to be sent.
Returns:
the response from the broker.
Exceptions:
IOException if an exception occurs during the read of the command.
UnsupportedOperationException if this method is not implemented by this transport.

Reimplemented from activemq::transport::TransportFilter.


The documentation for this class was generated from the following file:

Generated on 1 Dec 2014 for activemq-cpp-3.8.2 by  doxygen 1.6.1