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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to