These sound like good ideas. Not sure why you need two TimeoutWrappers though, as you are only trapping the remove() aren't you?
Stephen --- James Carman <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]