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

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@422967 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-07-18 05:02:04 +00:00
parent 7b154cfacf
commit e0f168a58d
1 changed files with 17 additions and 0 deletions

View File

@ -140,6 +140,9 @@ public class UsageManager {
}
}
/**
* 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 @@ public class UsageManager {
}
}
/**
* 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.