Thanks.
- I need to broadcast a particular message (from an session bean) to all the above mentioned web modules.
What initiates this message? At what point in time, does the Session EJB do processing that includes the "message sending" to multiple web modules.
- Then those web apps can process the message and reply to the EJB module accordingly.
It sounds like you have business logic contained within the class that is deployed with the web modules. This is not really a good place for business logic. Describe the "processing" that is executed by this object in the web module.
The main problem is sending some kind of a message from a EJB to the client web app.
Well, let's see what we can come up with. Your response to my first question above is important.
If the processing in the Session EJB is not started by some activity within the web module, e.g. user clicks button or hyperlink, then you need to add something in the web modules to keep checking for a message from the Session EJB. Here the web modules will not be checking the Session EJB but rather a message table in a database. The Session EJB will post a message (intended for reading by the web module) to the database. Processing goes down, not up
Keep in mind that a Session EJB is a temporary object. After the Session EJB posts its message to the database, it must then have code that keeps reading the message table for the responses from the web module.
Sounds like there will be two Session EJB, one to do the processing and posting of the message to the database. And the other Session EJB will be used by the web modules for reading the message table and posting the responses to the message table.
Sounds like a queer design, however. Robin's suggestion below is another option. However, business logic should not be coded in Message EJB either. So, the best option it to keep the business logic in Session EJB.
Whatever processing you currently have in the class in the web module, should be reengineered into another Session EJB.
[ November 10, 2008: Message edited by: James Clark ]