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:
Hiram R. Chirino 2006-03-17 02:11:34 +00:00
parent 2edfb2864c
commit 24235a99e4
1 changed files with 4 additions and 0 deletions

View File

@ -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;
} }