Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 68537 invoked by uid 500); 28 Nov 2002 18:28:55 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 68523 invoked from network); 28 Nov 2002 18:28:54 -0000 Posted-Date: Thu, 28 Nov 2002 19:28:56 +0100 (MET) Date: Thu, 28 Nov 2002 19:28:56 +0100 (CET) From: Michael Melhem Reply-To: Michael.Melhem@managesoft.com To: ovidiu@cup.hp.com, Subject: Expire Continuations Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Ovidiu!! How are you mate, I guess you are not coming to the Frankfurt Stammtisch???? :-P I was thinking about how to Expire Continuations and have come up with the following: We know from the "bus discussion" that placing every wk (WebContinuation) into the "expirations" Sorted TreeSet is a problematic solution. So how about placing only the "leaf" nodes in this set for each tree? This can be done by: for each new wk (if wk.getparent().numChildren() < 2) expirations.remove(wk.getparent()); expirations.add(wk); This could be an expensive operation especially if the set of wk's is very large .... although.. the treeSet guarantees log(n) time cost for basic operations. What do you think ? Given that we have a sorted set of "leaf" nodes (from all continuation trees) we need to excute the following algorithm to rid the system of expired wk's For each leaf node in the set which is expired: delete it, and recursively delete its parent only if its parent has also expired *and* has no (other) children. We could make the ContinuationsManager an avlaon monitored Resource, so that we can periodically trigger continuations clean ups. This implies the max life of an "wk" after lastAcceesTime equals timeToLive + cleanUp_period. What do you think?? Best Regards, Michael Melhem --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org