Is it possible to limit the number of UIs per session


I’m developing a vaadin portlet that is used in a large (in number of pages) liferay portal. As nearly every portal page contains one instance of that one portlet, the user session of one user traversing the pages may contain a large number of UI instances.

Is there a way add a limit inside my application, so that an “older” UI gets dropped when a new UI is instantiated?

An old post, but in case not yet resolved: I think you could do this with a custom UIProvider - although using heartbeat and configuring UIs to close after a few missed heartbeats might be a more reliable solution depending on your use case.