[email protected] wrote:
Author: tross
Date: Fri May 15 19:50:47 2009
New Revision: 775302

URL: http://svn.apache.org/viewvc?rev=775302&view=rev
Log:
from (aconway)... added facility to disable management methods.
Use this facility to disable several methods that are unsafe for clusters when 
running in a cluster.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp
    qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp
    qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.h

I'm not sure this fix is entirely correct. It will cause the purge command to be disabled if the cluster module is loaded, even if the broker is not actually configured as a cluster node.

Since modules installed in the module directory are loaded by default I think it would be better to only disable purge if the node has been configured as a cluster node.

--- qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp Fri May 15 19:50:47 
2009
[...]
     void initialize(Plugin::Target& target) {
         Broker* broker = dynamic_cast<Broker*>(&target);
+        disallowManagementMethods(broker->getManagementAgent());
         if (broker && cluster)
             cluster->initialize();
     }

I.e. the disallowManagementMethods() call should be part of the block conditionally executed only if broker and cluster are non-null.

e.g. ===================================================================
--- src/qpid/cluster/ClusterPlugin.cpp  (revision 775852)
+++ src/qpid/cluster/ClusterPlugin.cpp  (working copy)
@@ -160,9 +160,10 @@

     void initialize(Plugin::Target& target) {
         Broker* broker = dynamic_cast<Broker*>(&target);
-        disallowManagementMethods(broker->getManagementAgent());
-        if (broker && cluster)
+        if (broker && cluster) {
+            disallowManagementMethods(broker->getManagementAgent());
             cluster->initialize();
+        }
     }
 };

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to