Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 41294 invoked from network); 22 Nov 2005 21:44:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Nov 2005 21:44:14 -0000 Received: (qmail 98784 invoked by uid 500); 22 Nov 2005 21:44:11 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 98718 invoked by uid 500); 22 Nov 2005 21:44:11 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 98700 invoked by uid 99); 22 Nov 2005 21:44:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Nov 2005 13:44:10 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [216.68.127.190] (HELO carmanconsulting.com) (216.68.127.190) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Nov 2005 13:45:41 -0800 Received: from CARMANI9300 (carmanconsulting.com [127.0.0.1]) by carmanconsulting.com (8.13.4/8.13.4) with ESMTP id jAMLhh6K010431 for ; Tue, 22 Nov 2005 16:43:48 -0500 From: "James Carman" To: "'Jakarta Commons Developers List'" Subject: RE: [collections] BlockingBuffer and TimeoutBuffer Date: Tue, 22 Nov 2005 16:43:52 -0500 Message-ID: <001001c5efad$d5cade30$6401a8c0@CARMANI9300> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 In-Reply-To: <43838D67.4060605@btopenworld.com> Thread-Index: AcXvq64kI+qNqaPMTTy7gRwRdG620QAAhCpw X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Yep, you're right. It's not documented very well. I will make it so. I thought about doing this before, but I was afraid to mess up the serialization stuff. But, this should work quite well. -----Original Message----- From: Stephen Colebourne [mailto:scolebourne@btopenworld.com] Sent: Tuesday, November 22, 2005 4:28 PM To: Jakarta Commons Developers List Subject: Re: [collections] BlockingBuffer and TimeoutBuffer I believe that 0 is what the JDK uses in Object.wait(long) for an infinite wait. A negative number would also mean infinite. Stephen James Carman wrote: > Stephen, > > I don't know about using 0 to indicate that it's a wait forever situation. > A negative number would be better for that, wouldn't you say? A 0 would > mean that you don't want to wait at all (of course, why would you use > BlockingBuffer if you're going to supply a 0). > > James > > -----Original Message----- > From: Stephen Colebourne [mailto:scolebourne@btopenworld.com] > Sent: Monday, November 21, 2005 6:53 PM > To: Jakarta Commons Developers List > Subject: [collections] BlockingBuffer and TimeoutBuffer > > Having had a look at the new class TimeoutBuffer, I realised that it > could just be written as an extra parameter to BlockingBuffer. I think > this would be cleaner. > > BlockingBuffer.decorate(buf); // no timeout > BlockingBuffer.decorate(buf, timeout); // timeout > > The method implementation will simply check if the stored timeout value > is zero. If it is it does the get()/remove() as is, otherwise it uses > get(long)/remove(long). > > Note that adding a new field inn this case is OK with serialization as > the field will default to zero if an old version of the class is > deserialized using the new jar. > > Stephen > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org