activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r422967 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
Date Tue, 18 Jul 2006 05:02:05 GMT
Author: jstrachan
Date: Mon Jul 17 22:02:04 2006
New Revision: 422967

URL: http://svn.apache.org/viewvc?rev=422967&view=rev
Log:
added a couple of setter methods to make configuration a little simpler to avoid having to
mentally multiply numbers by 1024 * 1024 and to fix AMQ-827 

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java?rev=422967&r1=422966&r2=422967&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java
Mon Jul 17 22:02:04 2006
@@ -140,6 +140,9 @@
         }
     }
 
+    /**
+     * Sets the memory limit in bytes
+     */
     public void setLimit(long limit) {
         if(percentUsageMinDelta < 0 ) {
             throw new IllegalArgumentException("percentUsageMinDelta must be greater or equal
to 0");
@@ -150,6 +153,20 @@
         }
     }
     
+    /**
+     * Sets the memory limit in megabytes
+     */
+    public void setLimitMb(long limitMb) {
+        setLimitKb(1024 * limitMb);
+    }
+    
+    /**
+     * Sets the memory limit in kilobytes
+     */
+    public void setLimitKb(long limitKb) {
+        setLimit(1024 * limitKb);
+    }
+
     /*
     * Sets the minimum number of percentage points the usage has to change before a UsageListener
     * event is fired by the manager.



Mime
View raw message