diff options
author | Alan Conway <aconway@apache.org> | 2008-09-18 13:55:30 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-09-18 13:55:30 +0000 |
commit | e2b079386b19c34a26bb4a7c67bd002ebb9bdc94 (patch) | |
tree | c190fa29f5a58530bba7f174ec6f5727c36630ba /cpp/src/qpid/cluster/DumpClient.cpp | |
parent | fcc3335293a77c8e9130ea1836ee55872d6b28f5 (diff) | |
download | qpid-python-e2b079386b19c34a26bb4a7c67bd002ebb9bdc94.tar.gz |
Refactor Cluster logic into separate handlers for Joining & Member modes.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@696657 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/DumpClient.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/DumpClient.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/cpp/src/qpid/cluster/DumpClient.cpp b/cpp/src/qpid/cluster/DumpClient.cpp index f20ceb2ab6..f76a55c0d3 100644 --- a/cpp/src/qpid/cluster/DumpClient.cpp +++ b/cpp/src/qpid/cluster/DumpClient.cpp @@ -44,36 +44,39 @@ using namespace framing::message; using namespace client; -DumpClient::DumpClient(const Url& url, Broker& b, const boost::function<void(const char*)>& f) - : donor(b), failed(f) +DumpClient::DumpClient(const Url& url, Broker& b, + const boost::function<void()>& ok, + const boost::function<void(const std::exception&)>& fail) + : donor(b), done(ok), failed(fail) { + // FIXME aconway 2008-09-16: Identify as DumpClient connection. connection.open(url); session = connection.newSession(); } -DumpClient::~DumpClient() { - session.close(); - connection.close(); -} +DumpClient::~DumpClient() {} // Catch-up exchange name: an illegal AMQP exchange name to avoid clashes. static const char CATCH_UP_CHARS[] = "\000qpid-dump-exchange"; static const std::string CATCH_UP(CATCH_UP_CHARS, sizeof(CATCH_UP_CHARS)); void DumpClient::dump() { - // FIXME aconway 2008-09-08: send cluster map frame first. donor.getExchanges().eachExchange(boost::bind(&DumpClient::dumpExchange, this, _1)); // Catch-up exchange is used to route messages to the proper queue without modifying routing key. session.exchangeDeclare(arg::exchange=CATCH_UP, arg::type="fanout", arg::autoDelete=true); donor.getQueues().eachQueue(boost::bind(&DumpClient::dumpQueue, this, _1)); session.sync(); + session.close(); + // FIXME aconway 2008-09-17: send dump complete indication. + connection.close(); } void DumpClient::run() { try { dump(); - } catch (const Exception& e) { - failed(e.what()); + done(); + } catch (const std::exception& e) { + failed(e); } delete this; } |