diff options
| author | Alan Conway <aconway@apache.org> | 2012-05-08 15:04:51 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-05-08 15:04:51 +0000 |
| commit | 6f68a7a7c39eb412d07d459574f1d1ab52fed7db (patch) | |
| tree | 81480793b64678e54bf091e35bb4e16f3da93cb4 /cpp/src/qpid/broker/Bridge.cpp | |
| parent | e20364fc61452aef02f6f30639b7e6c5638ec7a4 (diff) | |
| download | qpid-python-6f68a7a7c39eb412d07d459574f1d1ab52fed7db.tar.gz | |
QPID-3603: Add ErrorListener to Bridge to handle session errors.
Will be used in HA code.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1335563 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Bridge.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Bridge.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/Bridge.cpp b/cpp/src/qpid/broker/Bridge.cpp index 53fe38a504..1f6aae7111 100644 --- a/cpp/src/qpid/broker/Bridge.cpp +++ b/cpp/src/qpid/broker/Bridge.cpp @@ -90,8 +90,7 @@ void Bridge::create(Connection& c) FieldTable options; if (args.i_sync) options.setInt("qpid.sync_frequency", args.i_sync); SessionHandler& sessionHandler = c.getChannel(channel); - sessionHandler.setDetachedCallback( - boost::bind(&Bridge::sessionDetached, shared_from_this())); + sessionHandler.setErrorListener(shared_from_this()); if (args.i_srcIsLocal) { if (args.i_dynamic) throw Exception("Dynamic routing not supported for push routes"); @@ -377,8 +376,29 @@ const string& Bridge::getLocalTag() const { return link->getBroker()->getFederationTag(); } -void Bridge::sessionDetached() { + +// SessionHandler::ErrorListener methods. +void Bridge::connectionException( + framing::connection::CloseCode code, const std::string& msg) +{ + if (errorListener) errorListener->connectionException(code, msg); +} + +void Bridge::channelException( + framing::session::DetachCode code, const std::string& msg) +{ + if (errorListener) errorListener->channelException(code, msg); +} + +void Bridge::executionException( + framing::execution::ErrorCode code, const std::string& msg) +{ + if (errorListener) errorListener->executionException(code, msg); +} + +void Bridge::detach() { detached = true; + if (errorListener) errorListener->detach(); } std::string Bridge::createName(const std::string& linkName, |
