From 24235a99e49234baaf75f1e0b0373a41e9f44dfc Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Fri, 17 Mar 2006 02:11:34 +0000 Subject: [PATCH] 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 --- .../main/java/org/apache/activemq/memory/UsageManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java b/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java index 4968825cde..c5ac58f12f 100755 --- a/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java +++ b/activemq-core/src/main/java/org/apache/activemq/memory/UsageManager.java @@ -78,6 +78,8 @@ public class UsageManager { * @throws InterruptedException */ public void waitForSpace() throws InterruptedException { + if(parent!=null) + parent.waitForSpace(); synchronized (usageMutex) { for( int i=0; percentUsage >= 100 ; i++) { usageMutex.wait(); @@ -118,6 +120,8 @@ public class UsageManager { } public boolean isFull() { + if(parent!=null && parent.isFull()) + return true; synchronized (usageMutex) { return percentUsage >= 100; }