00001 #ifndef QPID_CLUSTER_FAILOVEREXCHANGE_H
00002 #define QPID_CLUSTER_FAILOVEREXCHANGE_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/broker/Exchange.h"
00026 #include "qpid/broker/DeliverableMessage.h"
00027 #include "qpid/Url.h"
00028
00029 #include <vector>
00030 #include <set>
00031
00032 namespace qpid {
00033 namespace cluster {
00034
00038 class FailoverExchange : public broker::Exchange
00039 {
00040 public:
00041 static const std::string TYPE_NAME;
00042
00043 FailoverExchange(management::Manageable* parent);
00044
00045 void setUrls(const std::vector<Url>&);
00046
00047
00048 std::string getType() const;
00049 bool bind(broker::Queue::shared_ptr queue, const std::string& routingKey, const framing::FieldTable* args);
00050 bool unbind(broker::Queue::shared_ptr queue, const std::string& routingKey, const framing::FieldTable* args);
00051 bool isBound(broker::Queue::shared_ptr queue, const std::string* const routingKey, const framing::FieldTable* const args);
00052 void route(broker::Deliverable& msg, const std::string& routingKey, const framing::FieldTable* args);
00053
00054 private:
00055 void sendUpdate(const broker::Queue::shared_ptr&);
00056
00057 typedef sys::Mutex::ScopedLock Lock;
00058 typedef std::vector<Url> Urls;
00059 typedef std::set<broker::Queue::shared_ptr> Queues;
00060
00061 sys::Mutex lock;
00062 Urls urls;
00063 Queues queues;
00064
00065 };
00066 }}
00067
00068 #endif