qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r960547 - in /qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server: configuration/plugin/ virtualhost/plugin/policies/
Date Mon, 05 Jul 2010 11:15:45 GMT
Author: ritchiem
Date: Mon Jul  5 11:15:45 2010
New Revision: 960547

URL: http://svn.apache.org/viewvc?rev=960547&view=rev
Log:
QPID-1447 : Added improved toString to SCD components

Modified:
    qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/configuration/plugin/SlowConsumerDetectionPolicyConfiguration.java
    qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/configuration/plugin/SlowConsumerDetectionQueueConfiguration.java
    qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicy.java
    qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicyConfiguration.java

Modified: qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/configuration/plugin/SlowConsumerDetectionPolicyConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/configuration/plugin/SlowConsumerDetectionPolicyConfiguration.java?rev=960547&r1=960546&r2=960547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/configuration/plugin/SlowConsumerDetectionPolicyConfiguration.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/configuration/plugin/SlowConsumerDetectionPolicyConfiguration.java
Mon Jul  5 11:15:45 2010
@@ -28,7 +28,7 @@ import org.apache.qpid.server.configurat
 import java.util.Arrays;
 import java.util.List;
 
-public class    SlowConsumerDetectionPolicyConfiguration extends ConfigurationPlugin
+public class SlowConsumerDetectionPolicyConfiguration extends ConfigurationPlugin
 {
     public static class SlowConsumerDetectionPolicyConfigurationFactory implements ConfigurationPluginFactory
     {
@@ -67,4 +67,10 @@ public class    SlowConsumerDetectionPol
             throw new ConfigurationException("No Slow consumer policy defined.");
         }
     }
+
+    @Override
+    public String formatToString()
+    {
+        return "Policy:"+getPolicyName();
+    }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/configuration/plugin/SlowConsumerDetectionQueueConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/configuration/plugin/SlowConsumerDetectionQueueConfiguration.java?rev=960547&r1=960546&r2=960547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/configuration/plugin/SlowConsumerDetectionQueueConfiguration.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/configuration/plugin/SlowConsumerDetectionQueueConfiguration.java
Mon Jul  5 11:15:45 2010
@@ -20,11 +20,6 @@
  */
 package org.apache.qpid.server.configuration.plugin;
 
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.configuration.plugins.ConfigurationPlugin;
@@ -34,6 +29,11 @@ import org.apache.qpid.server.registry.A
 import org.apache.qpid.slowconsumerdetection.policies.SlowConsumerPolicyPlugin;
 import org.apache.qpid.slowconsumerdetection.policies.SlowConsumerPolicyPluginFactory;
 
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 public class SlowConsumerDetectionQueueConfiguration extends ConfigurationPlugin
 {
     private SlowConsumerPolicyPlugin _policyPlugin;
@@ -92,7 +92,7 @@ public class SlowConsumerDetectionQueueC
             !containsPositiveLong("messageCount"))
         {
             throw new ConfigurationException("At least one configuration property" +
-                                             "('messageAge','depth' or 'messageCount') must
be specified.");             
+                                             "('messageAge','depth' or 'messageCount') must
be specified.");
         }
 
         SlowConsumerDetectionPolicyConfiguration policyConfig = getConfiguration(SlowConsumerDetectionPolicyConfiguration.class.getName());
@@ -116,12 +116,6 @@ public class SlowConsumerDetectionQueueC
                 _logger.debug("Policy Keys:" + key);
             }
 
-            _logger.debug("Configured SCDQC");
-            _logger.debug("Age:" + getMessageAge());
-            _logger.debug("Depth:" + getDepth());
-            _logger.debug("Count:" + getMessageCount());
-            _logger.debug("Policy:" + policyConfig.getPolicyName());
-            _logger.debug("Available factories:" + factories);
         }
 
         SlowConsumerPolicyPluginFactory<SlowConsumerPolicyPlugin> pluginFactory = factories.get(policyConfig.getPolicyName().toLowerCase());
@@ -132,5 +126,28 @@ public class SlowConsumerDetectionQueueC
         }
 
         _policyPlugin = pluginFactory.newInstance(policyConfig);
+
+        // Debug the creation of this Config
+        _logger.debug(this);
+    }
+
+    public String formatToString()
+    {
+        StringBuilder sb = new StringBuilder();
+        if (getMessageAge() > 0)
+        {
+            sb.append("Age:").append(getMessageAge()).append(":");
+        }
+        if (getDepth() > 0)
+        {
+            sb.append("Depth:").append(getDepth()).append(":");
+        }
+        if (getMessageCount() > 0)
+        {
+            sb.append("Count:").append(getMessageCount()).append(":");
+        }
+
+        sb.append("Policy[").append(getPolicy()).append("]");
+        return sb.toString();
     }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicy.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicy.java?rev=960547&r1=960546&r2=960547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicy.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicy.java
Mon Jul  5 11:15:45 2010
@@ -132,4 +132,10 @@ public class TopicDeletePolicy implement
     {
         _configuration = (TopicDeletePolicyConfiguration) config;
     }
+
+    @Override
+    public String toString()
+    {
+        return "TopicDelete" + (_configuration == null ? "" : "[" + _configuration + "]");
+    }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicyConfiguration.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicyConfiguration.java?rev=960547&r1=960546&r2=960547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicyConfiguration.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/experimental/slowconsumerdetection/src/main/java/org/apache/qpid/server/virtualhost/plugin/policies/TopicDeletePolicyConfiguration.java
Mon Jul  5 11:15:45 2010
@@ -71,4 +71,11 @@ public class TopicDeletePolicyConfigurat
         return (hasConfiguration() && contains("delete-persistent"));
     }
 
+    @Override
+    public String formatToString()
+    {
+        return (deletePersistent()?"delete-durable":"");
+    }
+
+
 }



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


Mime
View raw message