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/Runnable.h"
00029 #include "qpid/sys/Thread.h"
00030 #include <vector>
00031
00032 namespace qpid {
00033 namespace client {
00034
00035 class SubscriptionManager;
00036 class ConnectionImpl;
00037
00041 class FailoverListener : public MessageListener, private qpid::sys::Runnable
00042 {
00043 public:
00044 FailoverListener(const boost::shared_ptr<ConnectionImpl>&, const std::vector<Url>& initUrls);
00045 ~FailoverListener();
00046 void stop();
00047
00048 std::vector<Url> getKnownBrokers() const;
00049 void received(Message& msg);
00050 void run();
00051
00052 private:
00053 mutable sys::Mutex lock;
00054 std::auto_ptr<SubscriptionManager> subscriptions;
00055 sys::Thread thread;
00056 std::vector<Url> knownBrokers;
00057 };
00058 }}
00059
00060 #endif