[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] javax.jms.MessageListener and SWT...

Hi,

I am trying to use a class that extends org.eclipse.swt.widgets.Composite
and also implements javax.jms.MessageListener.  This class is used as the
'control' on a TabItem within a TabFolder.  I have registered the control as
the message listener on a javax.jms.MessageConsumer, but when I send
messages to the queue in question, my onMessage() within the control does
not get called.  I have exactly the same sort of code working within a SWING
user interface.  Is there a problem with using this type of callback in SWT?

Sample code for the control is as follows:

        public class JMSMessageListenerPanel extends Composite implements
MessageListener
        {
                public void onMessage(Message msg)
                {
                        try
                        {
                                JMSMessage jmsMsg = new JMSMessage(msg);
                                ArrayList msgs = new ArrayList();
                                msgs.add(jmsMsg);

                                // Show the message in the message dialog
                                JMSMessageDialog msgDialog = new
JMSMessageDialog(rootWindow, msgs);
                                rootWindow.logMessage(MSG_RECEIVED_STR);
                        }
                        catch (JMSException e)
                        {
                                rootWindow.logException(e);
                        }
                }
        }

Thanks.