I'm a bit new to EJB, so forgive me if this question is too simple - I just can't seem to figure it out. I have some stateful beans running on a server and when the bean runs, it should have the ability to send out a message indicating its progress to whatever client is currently using the bean. When this was a non-distrbuted application, I could simply register the client with the "server" as a listener and then the server would iterate over its listeners and send out status messages.
This is a problem for a couple of reasons now: 1. The server throws a NoClassLoaderFoundException because when it tries to resolve the type of the listener, it fails (maybe putting the appropriate client interfaces in the JBoss client directory would solve this, but that leads to #2...). 2. I obviously don't want to be sending a GUI back and forth (since that is the registered listener to be displaying the status of the bean).
So, long question short, is there a way to send a message to the client using the bean at the time? I've looked into message-driven beans and JMS but it seemed like messages there went to a Queue, in which case I would need a different queue for each client, which ties the client/server together a little tighter than I care to do.
Thanks in advance. Jeff
posted 9 years ago
I'd like to clarify my thoughts just a little bit here because I know my first message was quite long.
Simply put, is there a way for a bean to send a message to the client that is currently using it (i.e. a status message to update a progress bar on the client GUI)?