00001 #ifndef QPID_CLIENT_FAILOVERLISTENER_H
00002 #define QPID_CLIENT_FAILOVERLISTENER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "qpid/client/MessageListener.h"
00026 #include "qpid/Url.h"
00027 #include "qpid/sys/Mutex.h"
00028 #include "qpid/sys/Thread.h"
00029 #include <vector>
00030
00031 namespace qpid {
00032 namespace client {
00033
00034 class SubscriptionManager;
00035
00039 class FailoverListener : public MessageListener {
00040 public:
00041 FailoverListener(const boost::shared_ptr<ConnectionImpl>&, const std::vector<Url>& initUrls);
00042 ~FailoverListener();
00043 void stop();
00044
00045 std::vector<Url> getKnownBrokers() const;
00046 void received(Message& msg);
00047
00048 private:
00049 mutable sys::Mutex lock;
00050 std::auto_ptr<SubscriptionManager> subscriptions;
00051 sys::Thread thread;
00052 std::vector<Url> knownBrokers;
00053 };
00054 }}
00055
00056 #endif