mirror of https://github.com/apache/activemq.git
limit the child when the parent is limited.
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@386504 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2edfb2864c
commit
24235a99e4
|
@ -78,6 +78,8 @@ public class UsageManager {
|
||||||
* @throws InterruptedException
|
* @throws InterruptedException
|
||||||
*/
|
*/
|
||||||
public void waitForSpace() throws InterruptedException {
|
public void waitForSpace() throws InterruptedException {
|
||||||
|
if(parent!=null)
|
||||||
|
parent.waitForSpace();
|
||||||
synchronized (usageMutex) {
|
synchronized (usageMutex) {
|
||||||
for( int i=0; percentUsage >= 100 ; i++) {
|
for( int i=0; percentUsage >= 100 ; i++) {
|
||||||
usageMutex.wait();
|
usageMutex.wait();
|
||||||
|
@ -118,6 +120,8 @@ public class UsageManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFull() {
|
public boolean isFull() {
|
||||||
|
if(parent!=null && parent.isFull())
|
||||||
|
return true;
|
||||||
synchronized (usageMutex) {
|
synchronized (usageMutex) {
|
||||||
return percentUsage >= 100;
|
return percentUsage >= 100;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue