I am using an applicationscoped bean and an a4j:push to populate messages to every user of the application. As soon as a user starts the app a listener is attached to a list, so that if an event occurs all listeners in the list are notified so far so good. My problem is, that I don't know how to unregister the listeners now. If a user closes the application, the listener still ramins in the list, and after a while there will be tons of unused listeners.
I am looking for a solution to remove the listener from the list as soon as the polling from the client stops, is there a way to achieve this? To put it clearly, how can I check if the polling has stopped? Or does anyone has another idea how to indetify "dead" listeners and remove them?