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
00040 class FailoverListener : public MessageListener, private qpid::sys::Runnable
00041 {
00042 public:
00043 FailoverListener(const boost::shared_ptr<ConnectionImpl>&, const std::vector<Url>& initUrls);
00044 ~FailoverListener();
00045 void stop();
00046
00047 std::vector<Url> getKnownBrokers() const;
00048 void received(Message& msg);
00049 void run();
00050
00051 private:
00052 mutable sys::Mutex lock;
00053 std::auto_ptr<SubscriptionManager> subscriptions;
00054 sys::Thread thread;
00055 std::vector<Url> knownBrokers;
00056 };
00057 }}
00058
00059 #endif