Hi upankar
I hgave tried the following code in BasicQueue.java and it seems to work. Not
sure of the implications in a clustered environment. Still to add some thread
safe locks if necessary.
|
| public SpyMessage[] browse(String selector) throws JMSException
| {
| if (selector == null)
| {
| SpyMessage list[];
| synchronized (messages)
| {
| list = new SpyMessage[messages.size() + events.size()];
| Iterator iter = messages.iterator();
|
| int i = 0;
| for (; iter.hasNext(); i++)
| list =
| ((MessageReference)
iter.next()).getMessageForDelivery();
|
| Iterator eventsIter = events.keySet().iterator();
| for(; eventsIter.hasNext(); i++) {
| list =
| ((MessageReference)
|
eventsIter.next()).getMessageForDelivery();
| }
| }
| return list;
| }
| else
| {
| Selector s = new Selector(selector);
| LinkedList selection = new LinkedList();
|
| synchronized (messages)
| {
| Iterator i = messages.iterator();
| while (i.hasNext())
| {
| MessageReference m = (MessageReference) i.next();
| if (s.test(m.getHeaders()))
| selection.add(m.getMessageForDelivery());
| }
| }
|
| SpyMessage list[];
| list = new SpyMessage[selection.size()];
| list = (SpyMessage[]) selection.toArray(list);
| return list;
| }
| }
|
|
Shafiek
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3912000#3912000
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3912000
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user