qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r943488 - in /qpid/trunk/qpid/cpp/src: qpid/cluster/Cluster.cpp tests/ConnectionOptions.h
Date Wed, 12 May 2010 13:41:32 GMT
Author: aconway
Date: Wed May 12 13:41:32 2010
New Revision: 943488

URL: http://svn.apache.org/viewvc?rev=943488&view=rev
Log:
Delay generating URL in cluster till global constructors to handle multi-protocol URLs.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
    qpid/trunk/qpid/cpp/src/tests/ConnectionOptions.h

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=943488&r1=943487&r2=943488&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Wed May 12 13:41:32 2010
@@ -245,7 +245,6 @@ Cluster::Cluster(const ClusterSettings& 
     poller(b.getPoller()),
     cpg(*this),
     name(settings.name),
-    myUrl(settings.url.empty() ? Url() : Url(settings.url)),
     self(cpg.self()),
     clusterId(true),
     expiryPolicy(new ExpiryPolicy(mcast, self, broker.getTimer())),
@@ -276,14 +275,6 @@ Cluster::Cluster(const ClusterSettings& 
     timer = new ClusterTimer(*this);
     broker.setClusterTimer(std::auto_ptr<sys::Timer>(timer));
 
-    mAgent = broker.getManagementAgent();
-    if (mAgent != 0){
-        _qmf::Package  packageInit(mAgent);
-        mgmtObject = new _qmf::Cluster (mAgent, this, &broker,name,myUrl.str());
-        mAgent->addObject (mgmtObject);
-        mgmtObject->set_status("JOINING");
-    }
-
     // Failover exchange provides membership updates to clients.
     failoverExchange.reset(new FailoverExchange(this));
     broker.getExchanges().registerExchange(failoverExchange);
@@ -312,8 +303,10 @@ Cluster::~Cluster() {
 
 void Cluster::initialize() {
     if (settings.quorum) quorum.start(poller);
-    if (myUrl.empty())
+    if (settings.url.empty())
         myUrl = Url::getIpAddressesUrl(broker.getPort(broker::Broker::TCP_TRANSPORT));
+    else
+        myUrl = settings.url;
     broker.getKnownBrokers = boost::bind(&Cluster::getUrls, this);
     broker.setExpiryPolicy(expiryPolicy);
     dispatcher.start();
@@ -323,12 +316,22 @@ void Cluster::initialize() {
     deliverFrameQueue.start();
     mcast.start();
 
+    /// Create management object
+    mAgent = broker.getManagementAgent();
+    if (mAgent != 0){
+        _qmf::Package  packageInit(mAgent);
+        mgmtObject = new _qmf::Cluster (mAgent, this, &broker,name,myUrl.str());
+        mAgent->addObject (mgmtObject);
+        mgmtObject->set_status("JOINING");
+    }
+
     // Run initMapCompleted immediately to process the initial configuration.
     assert(state == INIT);
     initMapCompleted(*(Mutex::ScopedLock*)0); // Fake lock, single-threaded context.
 
     // Add finalizer last for exception safety.
     broker.addFinalizer(boost::bind(&Cluster::brokerShutdown, this));
+
 }
 
 // Called in connection thread to insert a client connection.

Modified: qpid/trunk/qpid/cpp/src/tests/ConnectionOptions.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/ConnectionOptions.h?rev=943488&r1=943487&r2=943488&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/ConnectionOptions.h (original)
+++ qpid/trunk/qpid/cpp/src/tests/ConnectionOptions.h Wed May 12 13:41:32 2010
@@ -39,7 +39,7 @@ struct  ConnectionOptions : public qpid:
         addOptions()
             ("broker,b", optValue(host, "HOST"), "Broker host to connect to")
             ("port,p", optValue(port, "PORT"), "Broker port to connect to")
-            ("protocol,P", optValue(protocol, "tcp|rdma"), "Protocol to use for broker connection")
+            ("protocol,P", optValue(protocol, "tcp|ssl|rdma"), "Protocol to use for broker
connection")
             ("virtualhost,v", optValue(virtualhost, "VHOST"), "virtual host")
             ("username", optValue(username, "USER"), "user name for broker log in.")
             ("password", optValue(password, "PASSWORD"), "password for broker log in.")



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message