> > I face a tough problem. My server application needs to prioritize some > > messages. [snip] > > Maybe using a filter? > > > Well, that looks fairly like a stateful filter so I would think it is > rather appropriate. (actually a filter is useful for anything :) > but how do you plan to handle your priority buffer ? >
if you are using Java 5, you can use java.util.concurrent.PriorityBlockingQueue. I believe the Doug Lea concurrent package for 1.4.x includes a PriorityBlockingQueue, but I don't recall off the top of my head. What I'm wondering is how would the filter work? Put a filter in that collects the writes, add them to the priority queue, and the pop the top one off the queue and send it to the next filter? That sound about right? I haven't worked with filters at all (other than the prexisting thread pool filters). -- Justin Rudd "Get the facts first. You can distort them later." - Mark Twain http://seagecko.org/thoughts/
