1 Reply Latest reply on Feb 4, 2011 11:21 AM by monkeyden

    get the number of current sessions & conversations?

    jeanluc

      Is there a way to display the number of current sessions and conversations? Not for the current user, but for the entire application.


      Thanks.

        • 1. Re: get the number of current sessions & conversations?
          monkeyden

          There is already a session listener SeamListener.  I would simply extend that one, and change web.xml to register your version.  Then, I might have an application-scoped counter to keep track, adding in sessionCreated() and subtracting in sessionDestroyed().  I haven't tried it but, in theory, it would work.


          For conversations, most are so short lived that it likely wouldn't tell you much.  What you really want, I suspect, is the number of long-running conversations (LRCs).  That would take some thinking as, to my knowledge, Seam doesn't maintain a list of LRCs.  You might want to look at @Interceptors.  Look at some of the work done in org.jboss.seam.core.ConversationInterceptor for guidance.