commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <>
Subject Re: [collections] New Buffer Wrapper Classes...
Date Thu, 10 Nov 2005 12:40:06 GMT
These sound like good ideas.

Not sure why you need two TimeoutWrappers though, as
you are only trapping the remove() aren't you?


--- James Carman <> wrote:
> Based on my response to Sandy McArthur about using
> Buffers to implements
> Commons Pool, I started digging around the API.  I
> came up with a couple of
> ideas:
> 1.  A BoundedBuffer wrapper/decorator class, which
> basically enforces a
> maximum size of the enclosed buffer.
> 2.  A TimeoutBuffer wrapper/decorator class which
> waits until a specified
> timeout value expires when asking to remove()
> objects from an empty Buffer. 
> With these two classes, we can make any underlying
> implementation (stack,
> queue, priority queue, etc.) bounded or cause them
> to wait rather than throw
> a BufferUnderflowException immediately when removing
> objects from them.  We
> may have to come up with two timeout wrappers, one
> for read and one for
> write (optionally they could be in the same class
> with potentially different
> values for each).  What do you guys think?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message