mirror of https://github.com/apache/activemq.git
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:
parent
7b154cfacf
commit
e0f168a58d
|
@ -140,6 +140,9 @@ public class UsageManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the memory limit in bytes
|
||||||
|
*/
|
||||||
public void setLimit(long limit) {
|
public void setLimit(long limit) {
|
||||||
if(percentUsageMinDelta < 0 ) {
|
if(percentUsageMinDelta < 0 ) {
|
||||||
throw new IllegalArgumentException("percentUsageMinDelta must be greater or equal to 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
|
* Sets the minimum number of percentage points the usage has to change before a UsageListener
|
||||||
* event is fired by the manager.
|
* event is fired by the manager.
|
||||||
|
|
Loading…
Reference in New Issue