commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject [collections] New Buffer Wrapper Classes...
Date Wed, 09 Nov 2005 14:15:25 GMT
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message