summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/Link.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2009-01-22 22:53:50 +0000
committerGordon Sim <gsim@apache.org>2009-01-22 22:53:50 +0000
commitd7ce27f7cc96894f149e5c20c03b306b80636727 (patch)
tree22caa566993da19f9e211f69fdca64c13f1f04e6 /cpp/src/qpid/broker/Link.cpp
parent74481dd2b6b97374bd4f260ca89d9103ce6383ed (diff)
downloadqpid-python-d7ce27f7cc96894f149e5c20c03b306b80636727.tar.gz
QPID-1567: More changes to make clustering and federation work together
* replicate outgoing link traffic to all nodes * coordinate amongst nodes so that only one node actually maintains active links with the others able to take over if that node fails git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@736841 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Link.cpp')
-rw-r--r--cpp/src/qpid/broker/Link.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/Link.cpp b/cpp/src/qpid/broker/Link.cpp
index 2bd15759ef..835b37e6eb 100644
--- a/cpp/src/qpid/broker/Link.cpp
+++ b/cpp/src/qpid/broker/Link.cpp
@@ -106,6 +106,7 @@ void Link::setStateLH (int newState)
case STATE_OPERATIONAL : mgmtObject->set_state("Operational"); break;
case STATE_FAILED : mgmtObject->set_state("Failed"); break;
case STATE_CLOSED : mgmtObject->set_state("Closed"); break;
+ case STATE_PASSIVE : mgmtObject->set_state("Passive"); break;
}
}
@@ -239,6 +240,7 @@ void Link::ioThreadProcessing()
if (state != STATE_OPERATIONAL)
return;
+ QPID_LOG(debug, "Link::ioThreadProcessing()");
//process any pending creates
if (!created.empty()) {
@@ -404,6 +406,7 @@ Manageable::status_t Link::ManagementMethod (uint32_t op, Args& args, string& te
case _qmf::Link::METHOD_BRIDGE :
_qmf::ArgsLinkBridge& iargs = (_qmf::ArgsLinkBridge&) args;
+ QPID_LOG(debug, "Link::bridge() request received");
// Durable bridges are only valid on durable links
if (iargs.i_durable && !durable) {
@@ -437,3 +440,17 @@ Manageable::status_t Link::ManagementMethod (uint32_t op, Args& args, string& te
return Manageable::STATUS_UNKNOWN_METHOD;
}
+
+void Link::setPassive(bool passive)
+{
+ Mutex::ScopedLock mutex(lock);
+ if (passive) {
+ setStateLH(STATE_PASSIVE);
+ } else {
+ if (state == STATE_PASSIVE) {
+ setStateLH(STATE_WAITING);
+ } else {
+ QPID_LOG(warning, "Ignoring attempt to activate non-passive link");
+ }
+ }
+}