0

I'm currently developing a JMS system. I have been able to develop the publisher (JSF), the subscriber (MDB) and I can print the JMS messages to the console from the onMessage method of the MDB.

My problem is that I can't manage to display them in a view: Either JSF, Applet or JTextArea swing.

How can I invoke the JTextArea of a given applet from the onMessage method of the MDB? I have tried to instantiate an Applet object from the MDB

ex: TestApplet tst = new TestApplet(): Then into the onMessage method, after having extracted the message into testMessage variable I tried: tst.textAtrea.append(testMessage);

Here I got an error from the container.

Beside the above example, I would appreciate any other solution to my problem (just want to display the JMS messages in a view, not only at the console)

Beryllium
  • 12,808
  • 10
  • 56
  • 86
  • When you add the mdb tag, it gets translated to ms-access. I think you intended message-driven-bean instead so changed the tags accordingly. – HansUp Sep 23 '13 at 14:17

2 Answers2

0

It is bad idea to invoke a part of applet from MDB. Message will not be consumed till onMessage method is executed successfully. I would rather try to put the message in the some storage system (files or databases) and then display from these resources.

Abhijith Nagarajan
  • 3,865
  • 18
  • 23
  • Hmmm..., i already thought about it but that might cause some delays in a scenario of real time data distribution. I'm working on my diploma thesis and it is a concern for me. – erzen kaja Sep 23 '13 at 13:14
0

You cannot really use MDBs together with a Swing client in your scenario.

Instead

Any other client type (JSF, applet) will be more difficult.

Community
  • 1
  • 1
Beryllium
  • 12,808
  • 10
  • 56
  • 86