Reputation: 2459
I need to create a User Monitor screen that shows real-time data of the logged-in users. I was told that I should use a particular Java class (let's call it Aggregator.java) that was created by somebody that aggregates all the necessary information that needs to be displayed. Aggregator.java polls from the database every 5 seconds and stores all the data in a cache. Once it updates the cache, Aggregator.java notifies all the dependents that implement a particular interface.
In this case, how can my JSP be notified about the changes in Aggregator.java? Initially, I planned to use WebSockets but since I have to use this Aggregator.java, I'm not sure about what to do.
If there's even a dirty way on how to do this, I would love to know about it. But, of course, I'm all about them best practices.
Upvotes: 0
Views: 127
Reputation: 2092
I would recommend Spring Integration with a WebSocket outbound adapter.
You can create a channel and send a message with the updates from your Aggregator.java
Upvotes: 2