Push messages from business logic into backing bean

In my simple web application a table with the contents of a database table is shown to the client. Now I want this table in the browser to be updated each time the db table is updated. In my business logic a jms message is fired to a specified topic each time the db table is updated. The reverse ajax stuff needed for the client update is provided by the Icefaces jsf implementation. There is a backing bean for each session which is responsible for the server side rerendering of the client. Now my question is: How do I connect the bussiness logic firing a jms message if the db table is updated, with the backing bean?

My thoughts:

1. Create a message listener for the topic. Each time the message listener receives a message it notifies the backing beans of each session to rerender the client. But how does the message listener know about the backing beans?

2. The backing bean responsible for rerendering the client adds itself as a listener. But where? As I understand it cannot be a backing bean and a jms MessageListener at the same time.

Has anyone an idea/pattern for this problem?

[1125 byte] By [sebp78a] at [2007-11-27 10:29:45]
# 1

You could keep a list of beans that need to be notified in the application scope. (You should probably use weak references so that they may be garbage collected.) Then you JMS listener could get access to them.

Somebody posted a thread recently where they were doing something very similar, you might want to try to find it.

RaymondDeCampoa at 2007-7-28 17:59:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...