Qpid C++ API Reference
Generated on Mon Jun 7 18:25:34 2010 for Qpid C++ Client API by doxygen 1.6.2-20100208

qpid::client::FailoverManager Class Reference

Utility to manage failover. More...

#include <FailoverManager.h>

List of all members.

Classes

struct  Command
 Interface to implement for doing work that can be resumed on failover. More...
struct  ReconnectionStrategy

Public Member Functions

 FailoverManager (const ConnectionSettings &settings, ReconnectionStrategy *strategy=0)
 Create a manager to control failover for a logical connection.
Connectionconnect (std::vector< Url > brokers=std::vector< Url >())
 Return the current connection if open or attept to reconnect to the specified list of urls.
ConnectiongetConnection ()
 Return the current connection whether open or not.
void close ()
 Close the current connection.
void execute (Command &)
 Reliably execute the specified command.

Detailed Description

Utility to manage failover.

Definition at line 36 of file FailoverManager.h.


Constructor & Destructor Documentation

qpid::client::FailoverManager::FailoverManager ( const ConnectionSettings settings,
ReconnectionStrategy strategy = 0 
)

Create a manager to control failover for a logical connection.

Parameters:
settings the initial connection settings
strategy optional stratgey callback allowing application to edit or reorder the list of urls to which reconnection is attempted

Member Function Documentation

void qpid::client::FailoverManager::close (  ) 

Close the current connection.

Connection& qpid::client::FailoverManager::connect ( std::vector< Url >  brokers = std::vector< Url >()  ) 

Return the current connection if open or attept to reconnect to the specified list of urls.

If no list is specified the list of known brokers from the last connection will be used. If no list is specified and this is the first connect attempt, the host and port from the initial settings will be used.

If the full list is tried and all attempts fail, CannotConnectException is thrown.

void qpid::client::FailoverManager::execute ( Command  ) 

Reliably execute the specified command.

This involves creating a session on which to carry out the work of the command, handling failover occuring while exeuting that command and re-starting the work.

Multiple concurrent threads can call execute with different commands; each thread will be allocated its own session. FailoverManager will coordinate the different threads on failover to ensure they continue to use the same logical connection.

Connection& qpid::client::FailoverManager::getConnection (  ) 

Return the current connection whether open or not.


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

Qpid C++ API Reference
Generated on Mon Jun 7 18:25:34 2010 for Qpid C++ Client API by doxygen 1.6.2-20100208