[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Server-side browser refactoring

timfox do-not-reply at jboss.com
Fri Jun 19 09:08:58 EDT 2009


I think you're making this more complex than it needs to be:

I'd probably do something like the following, let's say you've added a method to get an iterator on the queue, then you just need to write a bit of code that does this (pseudocode)


  | Iterator iter = queue.iterator();
  | 
  | while (iter.hasNext())
  | {
  |    MessageReference ref = iter.next();
  |    HandleStatus status = consumer.handle(ref);
  |    if (status == HandleStatus.BUSY)
  |    {
  |       break;
  |    }   
  | }
  | 
  | 

put that in a Runnable and call it when a) the browser is first created and b) when promptdelivery is called on the consumer.

That's it.



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238791#4238791

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4238791



More information about the jboss-dev-forums mailing list