BlockingQueue decorator that logs removed objects

Posted by scompt.com on Stack Overflow See other posts from Stack Overflow or by scompt.com
Published on 2010-05-21T09:34:34Z Indexed on 2010/05/21 9:40 UTC
Read the original article Hit count: 190

Filed under:
|
|
|

I have a BlockingQueue that's being used in a producer-consumer situation. I would like to decorate this queue so that every object that's taken from it is logged. I know what the straightforward implementation would look like: simply implement BlockingQueue and accept a BlockingQueue in the constructor to which all of the methods would delegate. Is there another way that I'm missing? A library perhaps? Something with a callback interface?

© Stack Overflow or respective owner

Related posts about java

Related posts about blockingqueue